Edison-Scope
Edison-Scope, is an Intel Edison controlled 200 Msa/S mixed signal oscilloscope. It provides an Operating System agnostic method to control the MSO-28 oscilloscope. By leveraging the web browser on the modern smart devices, one can control USB based hardware traditionally requires a desktop OS. Conceptually this project is very similar to the PiMSO project, but the similarity exist only on the client side. The server side was rewritten using Node.js. Node.js provided a more device independent solution to the server side of the WebMSO project.
This project participated in the Intel IoT roadshow hackathon in NYC. Porting the synchronous WebMSO28 code over to the asynchronous Node.js turned out to be more difficult than I had anticipated. By the end of the 24 hours hackathon, some control of the MSO-28 via Node was obtained, but the project was about 50% done. Now that the project is finally in a deployable alpha state, I am posting it on the Instructable as I had promised at the hackathon.
Gather All the Parts.
What you will need for this project depends on which version of the Intel Edison kit that you plan to use.
Intel Edison Arduino Kit (larger, higher cost):
- Link Instruments, MSO-28 Mixed Signal Oscilloscope
- 1GB or larger USB flash drive or SD card + SD reader
Intel Edison Breakout board (smaller, needs adapter cables)
- Link Instruments, MSO-28 Mixed Signal Oscilloscope
- Power connector PJ-002AH-SMT 2.1mmx5.5mmDC
- power adapter, 12V 1 - 1.5A, 2.1mmx5.5mm (I used the one that came with the Edison Arduino kit)
- USB OTG micro M to mini M cable or USB micro OTG host cable
- 1GB or larger USB flash drive or SD card + SD reader
Edison Breakout Case
Additonally, I've also designed an enclosure for the Edison Breakout board to prevent me from ripping out the delicate micro-USB connectors on the Edison Breakout board. Unfortunately the breakout board cannot provide USB +5V during battery powered mode, nevertheless, I've left room in the enclosure for a 3.7V lithium battery pack for future projects. For example, a standalone BTLE to WiFi Bridge.
The Easy Way (Recommended)
The easiest way to get going is to copy this pre-configured Edison image onto a blank USB drive or SD card and flash the image onto the Edison.
1. Download and copy the flash image onto the blank media.
2. Power up your Edison, access it via a terminal session. Example below was done on a ubuntu 14.04 LTS, adjust it per your OS of choice.
sudo screen /dev/ttyUSB0 115200
3. Log in to your Edison. User: root, password: blank.
4. Plug the USB/SD drive into the USB OTG port, remember to switch the OTG switch on the Arduino kit board or use the OTG USB host cable on the breakout board. Check the prescence of the USB device with
lsusb
check all your settings if you don't see the USB drive.
5. Mount the USB drive.
mkdir /mnt/usb
mount /dev/sda1 /mnt/usb
6. Expand and flash the image onto the Intel Edison. Be patience, it takes a while.
gunzip -c /mnt/usb/edisonscope-20150113b.img.gz | dd of=/dev/mmcblk0 bs=1M
7. Plug in the MSO-28 and Reboot the Edison.
shutdown -r now
8. Log into the Edison
user: root, pwd: edison-1
9. You should be able to see Node process, nodescope28
ps |grep node
if you experienced flash error, just re-flash the image again.
10. You should also be able to see the MSO-28 attached to the USB port as 3195:f281 and enumerated in /dev as MSO-28-0
lsusb
ls /dev
11. Now go to your smart device and look for an AP called edison-scope, the passkey is the same as your login password, 'edison-1'
12. Open up a browser window and access http://edison-scope.local or http://192.168.42.1 you should be able see the the WebMSO control panel.
Roll Your Own (Advanced)
The MSO-28 uses the Silabs VCP driver which is not activated by default on the Yocto distro shipped with the Intel Edison. In order to activate the usbser support you'll need to follow the Intel Edison Board Support Package User Guide to turn on the usbser/cp210x support under menuconfig and bitbake a custom image.
Alternately, you can grab a pre bitbaked image from here and flash it on to a blank media.
Power up your Edison, access it via a terminal session. Example below was done on a ubuntu 14.04 LTS, adjust it per your OS of choice.Copy your flash image on to a blank media,
mkdir /mnt/usb mount /dev/sda1 /mnt/usb
gunzip -c /mnt/usb/3.10.7-poky-edison-silbser.img.gz | dd of=/dev/mmcblk0 bs=1M
Once you've flashed an image on the Edison with the usbser/cp210x support, you'll need to add the following packages.
1. Login root/ , setup Edison
configure_edison --setup
setup edison name and password, this will also be the WAP SSID and WPS Key.
2. Configure opkg source feed by adding the following lines to /etc/opkg/base-feeds.conf
src all http://iotdk.intel.com/repos/1.1/iotdk/all src x86 http://iotdk.intel.com/repos/1.1/iotdk/all src i586 http://iotdk.intel.com/repos/1.1/iotdk/all src/gz all-ed http://iotdk.intel.com/repos/1.1/iotdk/all src/gz edison http://iotdk.intel.com/repos/1.1/iotdk/all src/gz core2-32 http://iotdk.intel.com/repos/1.1/iotdk/all
You can add it with vi editor or create the base-feeds.conf file on your pc and scp it into the Edison. (adjust the IP address for the location of your Edison)
sudo scp base-feeds.conf root@192.168.1.101:/etc/opkg/.
3. Update your packages
opkg update upgrade
4. Install git
opkg install git
5. If you are like me, can't remember any vi commands, install the nano editor.
wget http://www.nano-editor.org/dist/v2.2/nano-2.2.6.t... tar xvf nano-2.2.6.tar.gz cd nano-2.2.6 ./configure make make install
6. Grab and install the WebMSO-config.git so the Edison will recognize the MSO-28 and MSO-19.
cd .. git clone git://github.com/tkrmnz/WebMSO-config.git cd WebMSO-config cp /home/root/WebMSO-config/74-linkmso.rules /etc/udev/rules.d/.
7. At this point plug the MSO-28 into the Intel Edison's USB OTG port, you should see it listed under /dev as MSO-28-0.
ls /dev/MSO*
8. Download and copy the nodescope28.js into the NodeScope28 directory. Also install the necessary Node packages.
cd .. git clone git://github.com/tkrmnz/NodeScope28.git npm install express finalhandler serve-static serialport hex async fs comma-separated-values line-reader path
9. Download the WebMSO28 content.
cd .. git clone git://github.com/tkrmnz/WebMSO28Node.git cd WebMSO28Node mkdir /home/root/NodeScope28/public cp -rf * /home/root/NodeScope28/public/.
10. Create a temporary ram drive for the nodescope28 to store the captured data.
mkdir /mnt/tmp mount -t tmpfs -o size=20m tmpfs /mnt/tmp ln -s /mnt/tmp /root/home/NodeScope28/public/fcgi-bin/tmp
11. Determine the IP address of the Intel Edison.
ifconfig
12. Start the NodeScope28 server
cd NodeScope28 node nodescope28.js
You should be able to access the MSO-28 via a browser, http://IP of Edison:2880
13. Currently the default listening port for the Edison config server is port 80 and the EdisonScope28 listens to port 2880, you can change the listening ports by performing the following steps.
Change the last line of the edison-config-server.js so it listens to port 8080 instead of 80.
nano /usr/lib/edison_config_tools/edison-config-server.js
Change the last line of nodescope28.js so it listens to port 80 instead of port 2880.
nano /home/root/NodeScope28/nodescope28.js
14. Reboot the Edison to confirm that the edsion-config is listening to port 8080
shutdown -r now
upon reboot, log in and confirm that the USB root hub is active, if is not, unplug and plug in the MSO-28 to trigger the USB OTG detection.
lsusb
15. To autostart the nodescope28 on bootup. Add the node_scope.service to /lib/systemd/system
cp /home/root/NodeScope28/node_scope.service /lib/systemd/system/. systemctl enable node_scope.service
Reboot the Edison. The NodeScope28 accessible from a web browser via port 80.
shutdown -r now
16. To configure the EdisonScope as WAP(Wireless Access Point). Press and hold the SW1 button for 5 Sec on the Edison Breakout board or the PWR button on the Edison Arduino kit. To revert back to the infrastructure mode, run the configure-edison.
configure_edison --wifi
Applications
In addition to the fact that you can now run the MSO-28 oscilloscope from your Windows PC, Mac, Linux, Android, and IOS devices via the web browser, what else can you do with it? For one, multiple users can remotely share the same captured data in a classroom situation. Additionally, remote control and viewing of the data from anywhere on world that is internet accessible is also possible. Captured and archived the data to a cloud server, one can retrieve and analyze the data at a later time. Add a GPS module to the Edison, we now have temporal and positional information to the captured data. A cluster of Edison-Scope can form the data acquisition nodes for the Internet of Industrial Things. Off the top of my head, energy exploration and military are two fields that can benefit from such information.