Monitoring network and internet speeds can be a major concern, especially in the case of LAN parties or video streaming. Modern Operating Systems provide utilities to track all the bits and bytes that pass over a network connection, but typically these tools lack obvious visualization. That’s where the Internet Speedometer can help. Using a BeagleBone Black and the power of its two Programable Realtime Units (PRUs), the Internet Speedometer will not only test download times, but also output the speed results visually to the tricolor LED strip.

But what are PRUs and why use them? PRUs are quite possibly the coolest feature of the BeagleBone Black, and one that sets it apart from other single board computers. They function much like microcontrollers; however, the two PRU cores on the BeagleBone Black operate at 200mhz with instructions executing on them at a fixed time of 5NS. That’s fast! What’s more is this speed does not come at a cost to the main processor’s load. Applications run in Linux will not take a performance hit even if there is high PRU activity. The two cores are not completely isolated and can share data between themselves and the CPU making interoperation possible. Programming of the cores is done using assembler in Linux and the execution of code is started by the main CPU. And this sharing of data and signaling features enable clever developers to offload work from the main processor and parallelize their applications. The result is a BeagleBone Black can perform high speed I/O with no performance hit to user experience — other boards simply don’t have this combination.


NOTE: Recently the BeagleBone Black switched Linux distributions from Ångström to Debian, and to anticipate this the Internet Speedometer uses Debian. If your BeagleBone Black is not a Rev C. or is not running Debian, consult our guides for Installing Debian on the BeagleBone Black (for OSX and Windows users).



Step #1: Programable Real-time Units

Internet SpeedometerInternet SpeedometerInternet Speedometer
  • The tricolor LED strip from RadioShack comes with support files including example Arduino code and data sheets for the Integrated Circuit controlling the LED segments.
  • Though the example code is only for Arduino, the data sheets contain necessary timing waveform information for the tricolor LED strip and it was possible to write a custom BeagleBone PRU driver for an LED strip.
  • In order to run this custom driver, however, the PRUs need to be accessible to Linux. To do this it is necessary to install and configure a library called PyPRUSS, which handles access to the PRU on the BeagleBone Black and is not preinstalled.

Step #2: Connect the BeagleBone Black

Internet SpeedometerInternet SpeedometerInternet Speedometer
  • Plug an ethernet cable into the BeagleBone Black and then power the board on by connecting a Mini-USB cable to the BeagleBone Black and your laptop or computer.
  • Login using SSH to the BeagleBone Black as the root user. ssh [email protected]
  • At the password prompt enter: root
  • Note: Windows users can use an SSH program such as PuTTY.

Step #3: Install PyPRUSS

Internet SpeedometerInternet SpeedometerInternet SpeedometerInternet Speedometer
  • PyPRUSS is available prepackaged for Ångström, but not for Debian. This means downloading and configuration is necessary to get everything running smoothly.
  • Login to the BeagleBone Black either over SSH or by attaching a monitor and keyboard.
  • On the command line clone the git repository of PyPRUSS by typing the following and hitting return: git clone
  • Change the working directory to the newly cloned PyPRUSS directory: cd pypruss
  • Execute the Python setup script, python install
  • Then export the library path: export LD_LIBRARY_PATH=/usr/local/lib
  • And finally, load the module uio_pruss: modprobe uio_pruss
  • Note: If you're experiencing any issues with this step, consult Step 1 of PyPRUSS repository page.

Step #4: Install am335x_pru_package

Internet SpeedometerInternet SpeedometerInternet Speedometer
  • The assembler that is bundled with PyPRUSS does not work properly. Thankfully, the am335x_pru_package does contain a working assembler.
  • Change working directories back to home: cd
  • Clone the am33x_pru_package repository: git clone

Step #5: PASM Setup

Internet SpeedometerInternet SpeedometerInternet SpeedometerInternet Speedometer
  • Change directories to ~/am335x_pru_package: cd ~/am335x_pru_package
  • Compile the assembler: make
  • Copy the assembler to the PyPRUSS directory structure: cp pru_sw/utils/pasm ~/pypruss/PASM/pasm

Step #6: Device Tree Setup

Internet SpeedometerInternet SpeedometerInternet SpeedometerInternet Speedometer
  • In order to use the PRUs in Linux a device tree needs to be setup and loaded at boot up. In short, a device tree is a "data structure describing hardware."
  • Change directories to /lib/firmware: cd /lib/firmware
  • Run the text editor nano: nano BB-BONE-PRU-00A0.dts And copy in the lines of code below into nano: [protected-iframe id="f93bb3df679254b695c8dd27bdaa4241-30206320-52394698" info="" width="600" height="1000"]
  • Save the device tree file by holding control and pressing o. When prompted to write out the file, simply hit return.
  • Once saved, quit nano by holding control and pressing x.
  • Convert the device tree file just created into a .dtbo file using this command: dtc -@ -O dtb -o BB-BONE-PRU-00A0.dtbo BB-BONE-PRU-00A0.dts
  • Finally, shutdown the BeagleBone Black so the new device tree files will cleanly load and to allow for safe wiring. shutdown -h now

Step #7: Wiring the Tricolor LED Strip

Internet SpeedometerInternet SpeedometerInternet SpeedometerInternet Speedometer
  • While the power is off connect a jumper wire from pin 12 on the BeagleBone's P8 header rail to a breadboard. This wire controls the signal from the BeagleBone to the tricolor LED strip.
  • On the same P8 header rail, connect a jumper wire to pin 2 on the board and the other end to the breadboard. This wire is used for grounding the board and the LED strip. If this wire is not connected the time of the entire circuit will not be in sync and the LED strip will not work as expected.
  • The tricolor LED strips wires follow a standard color scheme: red for power, green for signal, and black for ground.
  • Connect the red wire in its own row on the breadboard.
  • Connect the green wire to the same row as the wire going to pin 12 on the BeagleBone Black.
  • Connect the black wire to the same row as the wire going to pin 2 on the BeagleBone Black.
  • With the wall wart unplugged, connect the adaptaplug so the stripes on the plug match the stripes on the wall wart.
  • Connect the striped wire of the adaptaplug to the same row as the red wire of the LED strip.
  • Connect the solid black wire of the adaptaplug to the same row as the black wire of the LED strip.
  • Warning: If the power and ground wires are improperly connected and power is applied, the BeagleBone Black will not function. Before plugging in the wall wart, double and triple check your wiring of the power and ground wires!
  • Finally, plug in the wall wart to a wall outlet and plug a USB cable between your BeagleBone and your computer.

Step #8: Capemgr Setup

Internet SpeedometerInternet SpeedometerInternet SpeedometerInternet Speedometer
  • Now that the wiring is complete and the BeagleBone has been booted up, login as root and load the module uio_pruss: modprobe uio_pruss
  • Change working directories to /lib/firmware: cd /lib/firmware Export the variables PINS and SLOTS with the following values: export PINS=/sys/kernel/debug/pinctrl/44e10800.pinmux/pins export SLOTS=/sys/devices/bone_capemgr.9/slots
  • Note: Rather than typing out the entire pathname at a command line, tapping the tab button autocompletes the path. Try typing in only the command below and after typing y, type tab: export PINS=/sy Autocomplete has its limitations, however, it can save a bit of typing.

Step #9: Capemgr Setup cont.

Internet Speedometer
  • Load the PRU by running: echo BB-BONE-PRU > $SLOTS Verify the PRU is loaded by checking the following command's output. It should match image one. cat $SLOTS
  • To test out the configuration, navigate back to ~/pypruss/examples/blinkled: cd ~/pypruss/examples/blinkled Run python
  • The onboard LED should blink a few times, letting you know it is working.

Step #10: Install the Speedometer code

Internet SpeedometerInternet SpeedometerInternet Speedometer
  • Now that we have proper PRU access, we can setup the speedometer code.
  • Change directories to ~/pypruss/examples: ~/pypruss/examples
  • Clone the git repository: git clone
  • Change directory to bb-led-internet-speedometer: cd bb-led-internet-speedometer

Step #11: Run

Internet SpeedometerInternet SpeedometerInternet Speedometer
  • Run the Speedometer by running the python script sudo python
  • The pyGet script is configured to download a test file on’s servers that is 10Mb. Under normal circumstances, a file this size will download quickly and the tricolor LED strip will be green. When the download is not as quick, the output color will be orange. And when the download speed is very slow, the output color will be red. (Image 1)
  • Each time a 10Mb file is downloaded, notes how long it took and stores the result in speed.txt.
  • Depending on the contents of speed.txt, one of three .bin files is invoked from the script: either red.bin, orange.bin, or green.bin. (Image 2)
  • NOTE: The speedometer code also contains a blue.bin and a other.bin. The blue.bin is simply an extra color that never gets used by, but is included. The other.bin is used as a failsafe in the conditional statements of
  • NOTE: If you want to hack around the code — which is strongly encouraged — remember to run make in the bb-led-internet-speedometer directory or else the code changes will not be compiled into the .bin files.
Jon Karve

Jon Karve

I'm a developer and maker living in Philadelphia, PA. I love anything involving microcontrollers, home automation, and of course, flashing LEDs. I am currently working as an Application Specialist for CRF Health.

Tyler Worman

Tyler Worman

I'm a maker living in Ann Arbor, MI! I enjoy listening to music, playing disc golf, and experimenting with rapid prototyping tools.

  • J’Valkra Edronh

    Maybe I’m being delusional, but couldn’t this work on the raspberry pi as well?

  • Guest

    Very neat, I did a similar project based around a PIC microcontroller. It shows the last 16 seconds of network usage on a pair of LED matrices. More details here:

  • Guest

    Very neat! I did a similar project based around a PIC microcontroller. It shows the last 16 seconds of network usage on a pair of LED matrices. More details here:

    • guestito

      To be honest, it is ridiculous that these guys needed to use a $50 1GHz processor dev board with 80 inputs/outputs and to execute the same task a couple of $1 microcontrollers could do. It’s just depressing how lazy Mkezine editors have gotten.

      • ScottJL

        True, but when you’re done with that project you’re left sitting with a couple of $1 microcontrollers. The guy with the BBB can go do a lot of other things with his device, or even do them while doing this function.

  • Peter Buelow

    I love this. And it’s a good stepping stone to a christmas project I want to do. However, I have a question. If I set the .p files value of SEGMETS_TO_LIGHT to be 10 or 0, it simply fails to glow that color and the lights are done until I restart. I need to be able to light all the segments, but the most I can get is 9. I plan to dig into this a bit more later this week when I get some time, but I’m hoping there is a simple answer. Note, I can get between 1 and 9, but not 0 or 10, which doesn’t make sense with the very limited code in the .p files. Thanks though for a great hack.

  • Sonny Driscoll

    Can I use a normal LED Strip for this build, or does it need to be the RadioShack version with the embedded support files?

    I am outside of the US and can’t source the exact same part.

    Thanks in advance

    • You could use a different type of strip. You may need to modify the PRU code (or maybe eliminate it entirely) depending on what controller your LED strips use. Get your LED strip working first. Next, alter the base script where it calls the PRU programs.

      • Sonny Driscoll

        Thanks for the reply Tyler! Theres one more thing you may be able to help me with..

        This is the first time I have used a BeagleBone Black and I am attempting to connect it to my MacBook.

        I have bought an Ethernet adapter to allow an Ethernet connection but, but I am unable to connect to the SSH with the session timing out.

        I installed the HoRNDIS and FTDI updates but this has not solved the issue.

        My question is can i complete this build accessing SSH using just the USB connection, and not the Ethernet connection?

        Thanks again

        • You should be able to do the entire project using just the USB connection. We never disabled it that I can remember.

          Are you trying to connect the Beagle and the Mac directly together via Ethernet? If so, then configuration is most likely the issue. The easiest way to get this working is assigning both devices a static IP. See here:

          If you aren’t directly connecting them and have a different setup, let me know and I’ll see if I can give you a hand.

          • Sonny Driscoll

            Tyler thanks for the reply.

            Before your response I’d managed to get the SSH log in working, but now when I try to clone the git repository PyPRUSS it isn’t connecting. In fact, I can’t even ping google, so I know it is a networking issue but I cant figure out what I am doing wrong.

            I have allowed the internet connection to be shared on my network preferences, but I am not sure if I need to do something first to allow the Macbook to talk to the Beaglebone on the Ethernet, and share its internet connection.

            Any ideas?

            Your help is greatly appreciated.



          • Hey Sonny – I’m glad you got SSH working. You have to do a few more steps to get internet sharing working across the connection though. Check out this video walkthrough to get it setup.

            Basically make the Beagle see the Mac as a gateway. Then force the Mac to share it’s internet connection with the Beagle over the USB interface.

          • Sonny Driscoll

            Thanks Tyler,

            Unfortunately I still can’t get it to work. I am unable to complete the first line of code in the terminal re:

            “screen /dev/tty.usb*B 115200”

            And when I try to skip this step and move to the next operation, I am given this result:

   BeagleBone Debian Image 2014-04-23


            Last login: Wed Apr 23 20:20:40 2014 from

            [email protected]:~# udhcpc -i usb0

            -bash: udhcpc: command not found

            [email protected]:~#

            Not sure if there is anything you can see here? I really can’t determine why I am unable to share the internet connection.



          • Sonny Driscoll

            Do you think it would be possible to just install Angstrom to the BeagleBone for the build as it already contains PyPRUSS (I believe)? Presumably though it needs the internet connection anyway to analyse and display output via the LED?

          • I’d skip Angstrom as the direction forward for the beaglebone is Debian. It would need the internet connection to display and output via LED. See my other post about using dhclient on debian to get DHCP working for your internet sharing.

          • You can either install udhcpc client on Debian (it comes with angstrom) or use Debian’s packaged dhclient.

            try substituting dhclient for that command or if that doesn’t work “dhclient usb0”

  • CrabbyPete

    Thanks for putting this up. I really helps learning to develop on the beaglebone PRU. Programming the beaglebone and the 2 PRU’s make the whole beaglebone one heck of board

  • Mike_Alport

    Please can you give me some suggestions?
    I got all the way to the end of your step #9 but then got a Segmentation fault:
    [email protected]:~/pypruss/examples/blinkled# modprobe uio_pruss
    [email protected]:~/pypruss/examples/blinkled# cat $SLOTS
    0: 54:PF—
    1: 55:PF—
    2: 56:PF—
    3: 57:PF—
    4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
    5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
    7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-BONE-PRU
    [email protected]:~/pypruss/examples/blinkled# python
    File ./blinkled.bin open failed
    Segmentation fault

    • Sorry I’m a bit late in replying.. Someone just linked me to this and said some more questions were posted.

      Did you ever get this resolved? If not, let me know and I can try to recreate the build. I haven’t tried the example again since after we tested it for the article. It’s possible something may have changed in the libraries it depends on.

  • sora

    interesting project
    at the end of the steps why I’m getting this kind of error?

    Traceback (most recent call last):
    File “”, line 23, in
    print speed[0]
    IndexError: list index out of range

    and this is what i get when trying to print out cmd and cmd.stdout

    <open file '’, mode ‘rb’ at 0xb67aa0d0>

    any explanation would be great since I’m green with this thing :)

    • Did you have a speed.txt file populated with data? If the python script didn’t have any data to write to speed.txt for some reason, when it goes to read it would probably generate that error. Did you ever get it working?

      If you still have problems, let me know and I can try to recreate this build.

      Apologies for the late reply, someone just notified me there were questions on the article. Make doesn’t notify the authors of new questions after the post originally runs.

  • Vince Li

    Where are the steps?????

  • Bryan Wilder

    Can someone help me with a error? I’ve tried everything twice now but get the same “SystemError: error return without exception set”.

    • Apologies for the late reply. Usually this is caused by the device not being available.

      Did you run?
      echo BB-BONE-PRU > $SLOTS

      after if you run cat $SLOTS you should match the image shown in Step 9 above. If that doesn’t happen, let me know! I saw on the PyPruss issues page that a bug was opened for this issue, it’s not been verified though as a bug vs the device tree not being set properly so I can’t say for certain it’s PyPruss causing this.

  • Caleb McGrath

    I have a Freetronics Arduino EtherTen and wanted to make this with either an analog gauge or a servo motor. I am unable to find code for an arduino to monitor my network traffic. Can I get the data from my routers inbuilt monitoring page somehow?

    • Sorry for the late reply. If your router provides that information via some API or a page that you could scrape, you can probably grab it by requesting that page and stripping out the data you need.

      Unless your Arduino actually has all the network traffic flow through it, you’ll have to get the information from some other device.

  • Clay Jackson

    OK – I’m hung up trying to create the DTC file, I copied the lines in the instructions into it,but keep getting Syntax errors when I try to compile it. Looks like it’s supposed to download a file from git?

    • Did you ever get this working? I’ve noticed the page with the original DTS file is now down. I found it in waybackmachine. The contents of the DTS file should be as follows:

      * pru dts file BB-BONE-PRU-00A0.dts

      / {
      compatible = “ti,beaglebone”, “ti,beaglebone-black”;
      /* identification */

      part-number = “BB-BONE-PRU”;
      version = “00A0”;
      exclusive-use =

      [email protected] {
      target = ;

      __overlay__ {

      mygpio: pinmux_mygpio{
      pinctrl-single,pins = ;




      [email protected] {

      target = ;

      __overlay__ {
      test_helper: helper {
      compatible = “bone-pinmux-helper”;
      pinctrl-names = “default”;
      pinctrl-0 = ;
      status = “okay”;



      [email protected]{
      target = ;
      __overlay__ {
      status = “okay”;

  • Coolperson

    Hows does this possibily calculate when my network speeds go high? Could someone please explain? As I know, packets are addressed directly to IPs from routers. So, how could the BBB calculate my others PCs internet speed?

    • Sorry for the late reply. This isn’t calculating the speed of your other PCs. This is simply downloading a file at a regular interval and reporting the difference between speed at which it downloads and the previous time.

      If you have other PCs using data on your network they will take away from the bandwidth available to this device.