Bitscope makes some low-cost USB logic analyers and low bandwidth oscilloscopes. Since I am a computer engineer and primarily work in the digital domain, this is adequate for a lot of my projects, and I’ve had a Bitscope Mini for a few years now. I think there are better options available on the market now that weren’t back when I bought it, but I’m sticking with the tools I already own. To reduce workspace cable clutter with my laptop on the bench, I decided to use a Raspberry Pi to run Bitscope Server. They have a server version of the sofwtare with builds for armv7 linux, but it doesn’t set itself up as a linux systemd service and doesn’t run on boot, and is honestly kinda terrible. Today, I’m going to go through the whole setup process to get it working on a Pi 2B.

Prepare the Pi

Start by flashing an SD card with the latest Raspberry Pi OS, Lite version (no desktop) is fine. I use Etcher for this. After Etcher is done, remove and re-insert the card and a partition called BOOT should show up, as well as a partition that your computer may not be able to read (DON’T let Windows format it, just leave it alone). Create a new file in BOOT called ‘ssh’ with no extension. It doesn’t need any contents, it just has to be there to tell the OS it should enable the SSH server for us (so we don’t need to connect a display and keyboard to get started).

Next we do the usual to get a Pi ready. Find the IP address (I look at my router’s DHCP leases, but it might also show up as raspberrypi.local) and SSH into it. Default username is pi, password is raspberry. We have a few things to do as general housekeeping:

  1. Change the default password
  2. Change the time zone
  3. Change the hostname

All of these are cone with raspi-config

sudo raspi-config

Password and Hostname are both under the first menu, System Options. Set Password to anything you’ll remember. Then go back to the System Options menu to change the hostname. You need to change it from ‘raspberrypi’ so you don’t have issues in the future with a bunch of raspberry pi’s all trying to call themselves raspberrypi.local, preventing you from finding the right one. It’s also good practice to avoid hostname collisions on a network, although it isn’t strictly required. I named mine ‘bitscope’. If you want to enable WiFi on your Pi (I’m using wired Ethernet), you can also set it under System Options

The final change is the time zone. Raspberry Pi OS defaults to UTC time. This isn’t necessarily a problem unless you have an app which depends on the local time, but it’s good practice to change it anyway in case you install something that does care about local time. This option is under Localization. First, choose your geographic area, then any city on the list in the same time zone as you. Once you are done, click Finish, and let it reboot for you.

Install Bitscope Server

Bitscope provides a small help page on Bitscope Server, but it isn’t much. You have to go to the downloads page to get the right .deb file from the Downloads Page. It’s odd that they have no binaries for Generic Linux, but they have i386 and amd64 for Raspbian Debian.. but we need Raspbian Debian and ARMv7. No ARMv8, sorry. Before you go any further, SSH into the Pi again to be ready to download the image.

Once you’re there, check the box for Bitscope Server and click Download. It’ll take you to a page with the download link to the deb. Right click on the link, and copy it. Now, go back to the SSH session and type ‘wget ’ and then paste the link you copied. In my case, I ran this command:

wget http://bitscope.com/download/files/bitscope-server_1.0.FK26A_armhf.deb

Now we need to manually install the deb using dpkg. Adjust this command if your filename is different:

sudo dpkg --install bitscope-server_1.0.FK26A_armhf.deb

It should install. If it gives you errors, you either got the wrong architecture (make sure it’s not i386 or amd64), or you are running a 64-bit OS (ARMv8). The good news is that, even on Pi’s which support ARMv8, Raspberry Pi OS is currently (as of 2021) booting in 32-bit mode by default on all Pi’s.

Finally, we can try to run the server. It outputs nothing unless you add -v for verbose output.

bitscope-server -v

If we run the help, it’s clearly not really designed to run on UNIX based systems at all. It has no systemd service out of the box, it has the option to daemonize (which just makes it disappear from the terminal, we still need to launch and control it), and the install/uninstall options are Windows only (so why even include them in the help on UNIX?).

Writing a Systemd service for Bitscope Server

Systemd shouldn’t be intimidating, but I see a lot of hacks around the internet for getting things to start on boot. By writing a service, systemd will take care of all of that for us. Referring to my cheat-sheet on systemd service files, I first find where the binary is

which bitscope-server

And it tells us

/usr/bin/bitscope-server

So now we can create the service file and edit it:

sudo touch /etc/systemd/system/bitscope.service
sudo chmod 664 /etc/systemd/system/bitscope.service
sudo nano /etc/systemd/system/bitscope.service

The contents of the file:

[Unit]
Description=Bitscope Server
After=network-online.target

[Service]
ExecStart=/usr/bin/bitscope-server
StandardOutput=null
Restart=always

[Install]
WantedBy=multi-user.target

Save and exit, then reload the daemons, start the service, and enable it to auto-start

sudo systemctl daemon-reload
sudo systemctl start bitscope
sudo systemctl enable bitscope

And we can view the status

sudo systemctl status bitscope

This bitscope-server command is really poorly behaved for a server process. Without -v, it outputs nothing at all describing what it’s doing, and with or without -v, it will continuously read stdin checking for ENTER to quit, and then it asks for a y or n to quit. When run as a systemd service, stdin is null, and it still reads from it anyway and interprets this failure as an ENTER, so it asks over and over and over to type Y or N to quit. The best solution to this is to set the standard output also null, so it doesn’t fill any log files with garbage. You can still check the status and it will report any errors that systemd sees, as well as the status of the process and if it quit on its own.

Conclusions

The Bitscope software is a mess. The list of platforms they offer downloads for really terrifies me as to their software development process. They have Windows x86 and x64 (makes sense), macOS x86 only (wtf?), Raspberry Pi Raspbian x86, x64, and ARMv7, and generic Linux x64 (Not sure who’s running Raspbian on x86 or x64). Their current release of MacOS software is still 32-bit only (which Apple deprecated in 2012 and removed support for entirely in 2018), because they wrote their entire MacOS system using the Carbon API, which dates back to the early days of OS X as a compatibility layer for Mac OS 9 apps and was never intended to be used for native OS X apps. It was also deprecated in 2007 and support was removed entirely in 2018, so no modern macs can run their software.

In addition to all of the weird platform problems, the server software is really designed to run as a terminal program and as you can see by the continuous reading for ‘press ENTER to quit’, its very poorly behaved on Linux. Maybe it does better in a Windows environment, but I don’t expect anyone is going to want to deal with the overhead of Windows for a little scope server.