PiMSO - a Raspberry Pi Based Wi-Fi Oscilloscope




Introduction: PiMSO - a Raspberry Pi Based Wi-Fi Oscilloscope

About: Lifelong tinkerer.

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.

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.

Update: An Intel Edison based oscilloscope is available here https://www.instructables.com/id/Edison-Scope/

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

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;

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
make install
cp src/spawn-fcgi /usr/bin/.

Copy the init script from /home/pi/mso28fcgi to /etc/init.d

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

5. You can test the installing by starting the spawn-fcgi using

/etc/init.d/spawn-fcgi1 start

You should be able to see the blinking indicator next to the '''Stby''' above the timing window of the WebMSO28 client page.
If you see No MSO, then your spwan-fcgi is not running.

To stop the spawn-fcgi '''ctrl-z''' and kill the process

fuser -k 9000/tcp

6. To auto start spawn-fcgi on boot.

update-rc.d spawn-fcgi1 defaults

To remove spawn-fcgi from auto boot.

update-rc.d -f spawn-fcgi1 remove

At this point server works with ethernet cable.

Step 5: PiMSO Access Point Setup

1. Grab WebMSO28AP files from Github.

git clone git://github.com/tkrmnz/WebMSO28AP.git

2. Copy the various conf files to their directories.

cd WebMSO28AP
cp dnsmasq.conf /etc/.
cp hostpad.conf /etc/hostapd/.
cp hosts /etc/.
cp interfaces /etc/network/.

Add DAEMON_CONF=”/etc/hostapd/hostapd.conf” to /etc/default/hostapd

nano /etc/default/hostapd

Look for DAEMON_CONF="", insert the following


Enable the hostapd and restart dnsmasq

update-rc.d hostapd enable
/etc/init.d/dnsmasq restart

Step 6: Connecting to PiMSO

You should be able to see and connect to the Access Point with the SSID of "WebMSO" with your portable device. Point the brower on your portable device to


you should be able to see the WebMSO28 web client.

If you have a PiLCD, go to Step 7, otherwise you are done.

Step 7: PiLCD Setup

The goal of PiLCD module is provide a convenient way for the user to interact with a headless Raspberry Pi. The PiLCD module consists of a 16x2 LCD display with a rotary encoder switch. Together they provide a way for user to input data and read the results on the display.

One application is for a headless Raspberry Pi with a Wifi dongle to scan, select and connect to nearby Wifi Access Points.

The PiMSO project demonstrates how the PiLCD module can be used to provide a convenient way for the user see the Access Point and URL info of the PiMSO, it will also display current IPV4 address of the Ethernet connection.

1. In addition to wiringPi, you will also need nslookup, which is available in the dnsuitls package.

apt-get install dnsutils

2. Grab and install the PiLCD project from Github

cd /home/Pi
git clone git://github.com/tkrmnz/PiLCD.git
cd /home/pi/PiLCD

3. Copy the LCDinit scrip to init.d

cp LCDinit.sh /etc/init.d/.
cd /home/pi/wiringPi/examples
make /home/pi/PiLCD/lcd_ip2.c
chmod +x /etc/init.d/LCDinit.sh

4. you can test PiLCD by typing


You should be able to see the Wifi AP and URL information and Ethernet IPV4 by spinning the knob.

The LCDinit will execute the lcd_ip2 driver from PiLCD directory.
To run the LCDinit.sh on boot, do the following

update-rc.d LCDinit.sh defaults

To remove it from boot

update-rc.d -f LCDinit.sh remove
Build My Lab Contest

Finalist in the
Build My Lab Contest

Raspberry Pi Contest

Second Prize in the
Raspberry Pi Contest

Hardware Hacking

Participated in the
Hardware Hacking

Be the First to Share


    • Potato Speed Challenge

      Potato Speed Challenge
    • Bikes Challenge

      Bikes Challenge
    • Remix Contest

      Remix Contest

    13 Discussions


    3 years ago

    can i use MSO-19 instead of MSO-28


    Reply 3 years ago

    Try this https://www.linkinstruments.com/wiki/index.php?title=PiMSO19
    Let me know if you have any problems.


    Reply 3 years ago

    Thank you for your info........will definitely enquire if i have any problem


    3 years ago

    can i use MSO 19 instead of MSO 28

    WOW I think im going to build this ( vote ) but how much did it cost?


    Reply 6 years ago on Introduction

    The MSO-28 is available from Sparkfun https://www.sparkfun.com/products/11219
    or direct from Link Instruments http://www.linkinstruments.com/mso28.htm
    The wifi dongle is about $5, Ask Link about the PiLCD.


    6 years ago on Introduction

    Well done dudes ! I have a Hantek DSO 2090 40Mhz USB scope , a RPi and a 7 inch Android tablet. I also want to control the DSO from the tablet using the RPi. I don't want to fork out any extra cash.. Is this do able ? Ive had a look at the OpenHantek (Linux) software but still tinkering around.. Otherwise I might look at selling off the DSO and then getting a decent standalone scope e.g. GWInstek etc ? Any comments appreciated..


    Reply 6 years ago on Introduction

    You might be able to modify the OpenHantek to conform to the WebMSO protocol, this way you'll only need to rewrite the fcgi module. I don't know enough about Hantek DSO2900 to give you a more concrete answer. The benefits of the MSO-28 over the stand alone scopes are the Logic analyzer channels and the serial triggering engine. Those features were designed specifically to tackle micro-controller and FPGA projects. Modern day digital projects require more digital channels than analog channels. This is why the MSO-19 with only one analog channel and 8 LA/PG channels is actually more versatile than the MSO-28. It really depends on the type of projects that you have in mind. When I coach FIRST robotics, I travel with the MSO-19 in my laptop bag. My FIRST team uses it to design custom sensors for their robot.


    6 years ago on Introduction

    Other than the MSO-28, any other (higher bandwidth) capture frontends you recommend?

    I know there's a few in the works by some credible people (RedPitaya, Intronix, Novena/Bunnie), but there's also quite a few existing ones.. LabTool (Embedded Artists), Scanaplus (Ikalogic), BS120 (BitScope).

    I got burned a while back buying the dynon elab-080.. complete junk!


    Reply 6 years ago on Introduction

    Currently the MSO-28 is the only device developed to work with the WebMSO project. The WebMSO framework is open source, it will be up to the each manufacture to create the fcgi driver code for their own instruments.
    Bulk of the cost for the MSO28 is the 60MHz frontend and the 200Msa ADC. The design is robust enough that the one channel version, MSO-19, is currently serving as the only oscilloscope on the ISS. The MSO-19 went up to the ISS during xmas of 2011 to assist with avionics upgrade. It has since been a valuable remote controllable measurement asset for the NASA engineers on the ground.


    Reply 6 years ago on Introduction

    Thanks! Support for the MSO-19 is currently in development by sigrok, so perhaps in the future so will be the MSO-28!

    http://www.sigrok.org/wiki/Supported_hardware (DSLogic)


    6 years ago on Introduction

    That's awesome. Thanks for including the PiLCD instructions, too.