PiMSO – A Raspberry Pi based Wi-Fi Oscilloscope

PiMSO, is a Raspberry Pi controlled 200 Msa/S mixed signal oscilloscope. Depending on your application, it can be configure to use the Midori browser on the Pi GUI or access remotely via the internet. Since the PiMSO GUI is web based, You can also control it from a browser on your tablet or smart phone. But what happens when you are at a location that there are no convenient access to a network? For this project I’ll demonstrate how to build a Raspberry Pi based oscilloscope that is also a Wireless Access Point.
PiMSO - A Raspberry Pi based Wi-Fi Oscilloscope
As a bare minimum you’ll need the Raspberry Pi and a Ralink RT5370 based Wi-Fi dongle. For this project I used the Tenda W311M from MicroCenter, primarily because it is Access Point capable and inexpensive. An even less expensive dongle that based on the same Ralink RT5370 chip from Comfast can be purchased from Aliexpress for less than $5 inc S/H. A quick search on Aliexpress for RT5370 should yield a few other options. If you don’t have a MSO-28 you can still try it out, the WebMSO28 GUI will run regardless if you have the MSO-28. It’ll just show “NO DSO”.

If you don’t want to roll your own, you can grab a pre-configured Raspian distro from here and skip to Step 6. Otherwise here is how to roll your own on top of your favorite distro.

Step 1: Setting up the Raspberry Pi

1. Grab the latest version of Raspian from http://www.raspberrypi.org/downloads. Follow the raw images installation instruction provided on this site http://elinux.org/RPi_Easy_SD_Card_Setup.

2. Boot up the Raspbian and set the it to boot into command line.

Step 2: Package Installation

1. Gain root privilege.

sudo -i

2. Update the package list.

apt-get update

3. Install the necessary packages.

apt-get install git-core build-essential nginx hostapd iw minicom usbmount dnsmasq libfcgi-dev

4. Go to the home directory.

cd / home/pi

5. wiringPi is not necessary if you don’t have PiLCD, but it is nice to have for future I/O control.

git clone git://git.drogon.net/wiringPi
cd wiringPi
./build

6. Grab and install the WebMSO-config.git so the Pi will recognize MSO-28 and MSO-19

cd ..
git clone git://github.com/tkrmnz/WebMSO-config.git
cd WebMSO-config
cp /home/pi/WebMSO-config/74-linkmso.rules /etc/udev/rules.d/.

7. At this point plug the MSO-28 into the Raspberry Pi, you should see it listed under /dev as MSO-28-0.

Step 3: Setting up the web server

1. Edit the nginx default file.

nano /etc/nginx/sites-available/default

Change the nginx default root directory to /var/www

root /var/www;

2. Also add the following block for fcgi port forwarding.

location /fcgi-bin/mso28ctl.fcgi{
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}

3. Copy the proxy.conf to /etc/nginx

cp proxy.conf /etc/nginx/.

The content of the proxy.conf is shown below.

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;

4. Check to see if the gzip is enabled in the /etc/nginx/nginx.conf

nano /etc/nginx/nginx.conf

un-comment gzip on;

gzip on;
gzip_disable “msie6”;

5. Create the webpage folder

mkdir /var/www

6. Grab and install the WebMSO28fcgi javascripts content

cd /home/pi
git clone git://github.com/tkrmnz/WebMSO28fcgi.git
cd WebMSO28fcgi
cp -rf * /var/www/.

7. Start the nginx web server.

/etc/init.d/nginx start

At this point nginx should start serving the web page. ifconfig to get your ipv4 address and access it via a browser from a different computer on the same network.

Step 4: Setting up the FCGI server

1. Add execution privilege of the MSO28 fcgi driver in the /var/www/fcgi-bin directory.

chmod +x /var/www/fcgi-bin/mso28ctl.fcgi

2. Create a temporary ram drive for the mso28 fcgi driver to store the captured data.

mkdir /mnt/tmp
mount -t tmpfs -o size=20m tmpfs /mnt/tmp
ln -s /mnt/tmp /var/www/fcgi-bin/tmp

3. Grab and install the spawn-fcgi and mso28ctl.fcgi

cd /home/pi
git clone git://github.com/tkrmnz/mso28fcgi.git
copy spawn-fcgi-1.6.3.tar.bz2 to /home/pi and unzip the spawn-fcgi
cp mso28fcgi/spawn-fcgi-1.6.3.tar.bz2 .
tar -xvjf spawn-fcgi-1.6.3.tar.bz2

Install the spawn-fcgi

cd spawn-fcgi-1.6.3
./configure
make
make install
cp src/spawn-fcgi /usr/bin/.

Copy the init script from /home/pi/mso28fcgi to /etc/init.d
A Raspberry Pi based Wi-Fi Oscilloscope

cp /home/pi/mso28fcgi/spawn-fcgi1 to /etc/init.d/.
chmod +x /etc/init.d/spawn-fcgi1

4. Compile and copy the mso28ctl to /www/var/fcgi-bin

cd mso28fcgi
touch main.c
sh makemso2.sh
sh msocpy6.sh
Scroll to Top