Network USB Oscilloscope

Network access for USB BitScopes via Raspberry Pi.

We have long supported direct network access for remote data acquisition and diagnostic work with our network BitScope models such as BS325N or BS445N. It's how the SYDNEY online demo works across the Internet.

Shared access network connected USB mixed signal oscilloscope.

BitScope Micro connected to a network via Raspberry Pi.

These models can be used remotely without the need for a server because they plug into a LAN and use the UDP/IP stack to transport BitScope Protocol Packets directly between BitScope and the client.

However, we were asked at a recent OzBerryPi Meetup whether the USB BitScope models, like BitScope Mini or BitScope Micro, could be used remotely and shared via a network connection too.

We knew it was possible but we also knew it would require a server so we decided to explore the options by reconfiguring BitScope Pi.

We'd use Raspberry Pi as the server (instead of the stand-alone desktop system for our Electronics Projects Lab) and we'd use off-the-shelf hardware and software solutions to connect via the network (using WiFi in this example).

Two options immediately sprang to mind; X over SSH or VNC.

Our goal was to access a USB BitScope remotely from any PC, tablet or phone that supports either of these protocols which between them should allow support for almost any client device.

Installing Raspbian using NOOBS

NOOBS boot-time dialog box.

Installing the software on Raspberry Pi.

The first step is to install Raspbian on Raspberry Pi if you've not already done so and install BitScope DSO (or other software).

To use X over SSH you'll need a PC with and X server on it. To use VNC you don't, you just need to install a VNC client. On the RPi everything is already installed except the necessary VNC server.

First enable SSH for remote access on RPi. SSH is installed by default so simply open a terminal window and type sudo raspi-config at the prompt. Scroll down to Option 8 (Advanced Options) and Select. Scroll down to Option A4 (SSH) and Select. Choose Enable and when successful (it will report SSH server enabled) click Ok and then choose Finish.

Make sure your Raspberry Pi is connected to your network. Next we install the VNC server on the Raspberry Pi and a VNC client on the PC, tablet of phone we want to use to connect with the BitScope. We loggged into the RPi using the SSH server connection we just configured from a terminal on the PC (in our case) but you can do it on the Raspberry Pi itself if you have a keyboard and monitor connected to it (which you won't need when we're up and running).

The transcript should look similar to this (some unimportant verbosity has been removed):

alex@fermi:~$ ssh pi@ # log into the RPi via SSH
Last login: Wed Oct 23 21:44:33 2013 from fermi.causal
pi@raspberrypi:~$ sudo apt-get update # refresh repository database (output muted)
pi@raspberrypi:~$ sudo apt-get install tightvncserver # install the VNC server
After this operation, 9,988 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Fetched 6,967 kB in 44s (156 kB/s)

We've now logged into the RPi (at IP in our case, yours will be different) and installed the VNC server.

Next we start the VNC server and assign an access password:

pi@raspberrypi:~$ vncserver :1
You will require a password to access your desktops.
Password: raspberry
Warning: password truncated to the length of 8.
Verify:   raspberry
Would you like to enter a view-only password (y/n)? n
New 'X' desktop is raspberrypi:1
Creating default startup script /home/pi/.vnc/xstartup
Starting applications specified in /home/pi/.vnc/xstartup
Log file is /home/pi/.vnc/raspberrypi:1.log

To keep things simple we've used the same password as the pi account on the Raspberry Pi (raspberry). The VNC server has only used the first 8 characters of this password but this does not matter. We've also declined to create a separate read-only password (we don't need to set up read-only access at the moment). The command to start the server in future is always the same (vncserver :1) but the password creation will not be required next time you start.

Connecting with BitScope Pi via VNC.

The Raspberry Pi is now setup and we can connect with it via VNC or, if we're running on a client that has an X server, we can run an X application remotely on the Raspberry Pi and access it locally (via SSH) on the PC.

We'll start with VNC as it's the most widely supported option and probably easier to understand. Download and install the VNC client for your device from RealVNC or elsewhere (it's in many Linux distributions for example) and follow the installation advice in the client package for your device.

By way of example, here's the client run from our Linux workstation (called fermi).

alex@fermi:~$ vncviewer
Connected to RFB server, using protocol version 3.8
Enabling TightVNC protocol extensions
Performing standard VNC authentication
Password: raspberry
Authentication successful
Desktop name "pi's X desktop (raspberrypi:1)"
VNC server default format:
  32 bits per pixel.
  Least significant byte first in each pixel.
  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
Using default colormap which is TrueColor.  Pixel format:
  32 bits per pixel.
  Least significant byte first in each pixel.
  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0

Now we're up and running with remote desktop access to BitScope Pi!

We can connect with BitScope remotely from our PC exactly if we were sitting in at the BitScope Pi Workstation:

BitScope DSO via VNC talking to the Sydney BitScope.

The benefit of VNC is that clients are available for almost every platform and it looks identical to what you see sitting at the remote system (if your PC has a display resolution greater than or equal to the remote system).

BitScope DSO via VNC talking to the Sydney BitScope from Nexus 7.

For example, here is the same instance of BitScope DSO viewed from a Nexus 7 Android tablet. Note that we've connected via a 64bpp link and not all the remote desktop is visible on the display.

The important part (BitScope DSO) is though!

The bandwidth savings achieved using 64bpp mean the speed of the software when viewed remotely on this tablet is similar to what we get when accessed natively on BitScope Pi.

If we enabled read-only access (when configuring the VNC server) we could connect from different devices at the same time which could be useful in teaching and similar situations. More on this later.

It's important to note tha VNC is not ideal in some cases, especially on tablets and phones without keyboards or mice, unless the server is set up with a display resolution that maps well to the client device and the software can be used without a keyboard. With BitScope DSO it does work quite well, even on a small screen like the Nexus, because of the Act On Touch user interface design used by DSO but not every application works so well.

Connecting with BitScope Pi via X over SSH.

Probably preferrable to VNC if you're running on a PC or other client device that has an X server is X over SSH.

For example, it's trivial to use the -X option for SSH and start DSO remotely with two commands:

alex@fermi:~$ ssh -X pi@
pi@'s password: raspberry
pi@raspberrypi:~$ bitscope-dso
BitScope DSO via SSH talking to the Sydney BitScope.

In this case DSO runs on the Raspberry Pi but the user interface appears as a native application on the local PC. The performance is better because a portion of the graphics processing required is done on the (more powerful) client PC.

Connecting with BitScope, Other Options.

There are other options. The first of these, coming soon, is BitScope Server which runs on Raspberry Pi and makes any USB BitScope appear as network model. The benefit is that the software runs natively on the client PC, not the Raspberry Pi, which offers higher performance than either VNC or X over SSH. However, it is less universally available (i.e. it does not run on some devices) and it requires the BitScope software to be installed on each client first.

The bottom line is that BitScope can be used locally, remotely over a network or even the Internet, shared between multiple clients, independently on a single PC, Mac or Linux box or under the control of a tiny embedded system like Raspberry Pi for a self contained workstation. It's simply a choice of how you want to use it!

Update: Several people have asked if they can do all this using WiFi without the need for a separate Wireless Router or Access Point (AP). It is indeed possible. See this page for details about how to set up RPi as a Wireless HotSpot.

Related Posts

Physical Computing with BitScope, Blade and Raspberry Pi.May 27
Raspberry Pi 3 Launch and BitScope BladeFeb 29
Physical Computing with Raspberry Pi and BitScope!Dec 01
BitScope Micro with Raspberry Pi Touchscreen Display!Sep 09
BitScope, Ozberry & Pimoroni at Sydney Mini Maker Faire!Aug 12
BitScope Blade for Raspberry Pi at Hannover Maker Faire!Jun 05
Getting Started with BitScopeMay 08
BitScope Support Board via TrelloMay 01
BitScope Micro In-Line Data AcquisitionApr 02
BitScope ARM Platform CompatibilityFeb 10
Bootstrapping Raspberry Pi 2 for BitScopeFeb 05
Raspberry Pi 2 and BitScope PerformanceFeb 02
BitScope Micro & Raspberry Pi in Education at BETTJan 21
BitScope Connection Ports ExplainedDec 19
BitScope Micro and Oscilloscope ProbesDec 10
Raspberry Pi Model A+ or B+ or B+ Slimline?Nov 14
Electronic Measurement with BitScope & Raspberry PiNov 12
Hands on with BitScope Micro at electronica 2014Nov 11
BitScope Micro Video Tutorial with Farnell element14Nov 10
BitScope Micro and Raspberry Pi at electronica 2014!Nov 06
BitScope Micro element14 Webinar Review.Nov 03
Low cost networked data acquisition with Raspberry Pi.Dec 17
BitScope Server, shared remote access for any BitScope!Dec 15
Using a USB BitScope with any Linux system.Nov 05
BitScope DSO upgraded for Mac OS X Mavericks.Nov 03
Sydney BitScope, Online Demo Updated.Oct 30
BitScope Touch Screen User InterfaceOct 28
BitScope and friends at OzBerryPi Maker SpaceOct 20
How to Install BitScope DSO on Raspberry PiOct 18
Electronic Projects Lab for Raspberry PiOct 17
BitScope Ed, an Educational Blog about Electronics.Oct 09
Visualizing sound with Sonic Pi and BitScopeOct 05
How to Install Raspbian and BitScope on Raspberry PiSep 29
BitScope Software for Raspberry Pi OscilloscopeSep 27
BitScope Raspberry Pi OscilloscopeSep 25