Raspberry Pi Internet Speed Monitor

I was looking wistfully at the Lack Rack from my arm chair, admiring the (faux) copper conduit that covered the primary inbound internet link to the switch. I thought it would be cool looking to have an antique steam gauge attached to the piping. Two things caused that idea to quickly change – 1. the going prices for antique steam gauges right now, 2. once I was thinking about it as a gauge I thought an ‘internet speed gauge’ would be perfect. Alas, even if said gauge could be acquired without breaking the bank, converting MBPS to PSI and making it functional is above my level of engineering. So on to the next best thing – a Raspberry Pi hack.

Materials:

  • Raspberry Pi (3 or 4) with Raspbian 32-bit OS
  • Case with 3.5 in LCD Display
  • Copper spray paint 😉
  • Attention to detail at the command line

Speedtest CLI

Once you’ve got your Raspberry Pi up and running start with the Installing the Speedtest CLI instructions at https://pimylifeup.com/raspberry-pi-internet-speed-monitor/. Complete steps 1-6. When the article gets to Writing our Speed Test Python Script, you can skip that section. I do recommend it from a learning perspective, but the code from that step won’t be used in the final project.

Assuming this is a new installation, you will need to install InfluxDB and Grafana. Complete the respective instructions for each.

Continue with the primary article’s instructions for Using Grafana to Display your Speedtest Data.

If you’ve made it along this far, you should have a working Grafana dashboard displaying Upload Speed, Download Speed, and Ping (Latency). If you’re hitting a glitch – go back through what you’ve coded and double check that any references to the user (default = Pi) are accurate for the user on your device. You should be seeing updated data based on the frequency you specified in crontab -e.

Install Grafana Kiosk

Next, we want to set up our device as a kiosk, and have it boot and display the Network Speed dashboard automatically.

Install Grafana Kiosk from https://github.com/grafana/grafana-kiosk. For my installation I used the ARM v6 grafana-kiosk.linux.armv6 release.

Running the Dashboard on startup:

We’re going to use a yaml file to store our dashboard configuration:

Create a new file, config.yaml and populate it as such:

general:
  kiosk-mode: full
  autofit: true
  lxde: true
  lxde-home: /home/(user)
target:
  login-method: local
  username: admin
  password: (password)
  playlist: false
  URL: http://localhost:3000/d/bdf20d32-c4ff-4578-a3f4-7a38e1f722b9/network-speed?orgId=1
  ignore-certificate-errors: false

Be sure to substitute the proper ID wherever you see (user). The URL for the dashboard can be copied from the web interface of the dashboard.

Edit /home/(user)/.config/lxsession/LXDE-pi/autostart

Add a line: (one line, may show as wrapped)

@/usr/bin/grafana-kiosk -lxde-home /home/(user) -c /home/(user)/config.yaml

Save & Exit.

Now when you reboot the Pi, the dashboard should come up full screen after login.

Lack Rack part III: the Final chapter

If you caught the last blog installment you’ve seen that I’m a big proponent of the Steve Jobs “one more thing” methodology.

To ‘finish out’ (as if) the rack design I’ve made two more modifications. The first was reversing the switch positioning and doing some OCD-level cable maintenance.

The last, and the piece de resistance in my opinion, was removing one of the original lower shelves and replacing it with a bank that holds 4 Raspberry Pi. (Pies?)

In case your curious the Pi’s are configured for:

  • Pi-hole (security, DNS, ad-blocking)
  • HOOBS (home automation)
  • NEMS (a Nagios instance for monitoring)
  • Kali (shenanigans and attack emulation)

That should hold me over for a little while. And I’m really pleased with the results.

Lack Rack Updates

I have a tendency for DIY projects to never be finished. Actually that’s not entirely true. I finish them, but then I continue to build/expand on them. This has been true of many elements of my home office since moving to our home two years ago. A few months back I posted my DIY network rack built from IKEA end tables. A week or so later LED’s were added. I have several automation routines that will change the LED color based on status conditions.

The rack has served me very well so far, but I wanted to make a few improvements. Previously I had laptop (on riser stand) and a portable (15″ usb-C) monitor on the top. The monitor (and wireless keyboard) is connected an Intel NUC inside the rack that dual boots between REMnux and Windows11.

I wanted to make room for a full size monitor on top, but I was running low on real estate. A couple orders later on amazon and I had exactly what I wanted.

First I added a dual-arm stand that could accommodate a full size monitor (24″ fits well here), and a second arm that supports a laptop. I wound up replacing the monitor arm mount with a different mount that kept it closer to the support pole (the screen was a little too ‘in the face’ before that.) Since the composition materials of the Ikea tables are likely MDF, I added a steel panels on the top and bottom of the clamp for extra durability.

The height is perfect for a standing workstation. If I need to work on the laptop, there is enough free space to open and operate fully without impacting the monitor.

So here it is, the [updated] “Lack Rack” finished… for now.

DIY Home Network Rack – the Lack Rack


I’ve got an abundance of equipment in my home office/lab. I’d been contemplating doing a rack setup for a while but all of the options I was looking at were above budget for what I wanted to spend. Also, while I liked the idea of the functionality of a rack I wasn’t too keen on how a tower of metal would go with the décor. Then I stumbled across the “Lack Rack.

Here’s what I used: (All in it was about $110.)

Depending on how many tiers you want to do you can adjust the number of tables. Remember you’ll need one extra for the base.

The Plan:

There’s the expression, “Measure twice, cut once.” With me it’s more like measure 4 times. Measure the components you plan to include, adding in room for the rack shelves as well.

the original design plan.

Assembly:

Secure the casters to the bottom of one of the tabletops. Casters should be about 3/4 inch from the corners. Center them over where the mounting holes for the legs are.

For the lowest level, I used the full length of the table legs. So just build the table as per the instructions (screw in the legs).

Next, start stacking. I used a little bit of Gorilla glue on the bottom of the legs and attached it to the wheeled base. 4 steel braces were also used to secure the legs to the base.

The next set of legs are going to be cut shorter. Wrapping the area where you’re cutting with painters tape helps the edges from getting brittle. Power saw is probably easier but in this case a hack saw sufficed.

Add the shortened legs to the next top. Attach the short table to the previous level with steel braces. Note due to the legs being hollow at the bottom there is no glue securing the upper tiers.

Secure the metal rack shelves to the legs of below the table tops. You’ll want to keep them pretty close to the top as only about the top 2″ of the legs are solid to drill into.

Stack and secure.

Add another table stack to the top and it’s all done.

Here it is all loaded up. There’s a lot of space to add components still. There’s a switch on one of the shelves between the tiers. Also, though not currently utilized as such, all the shelves can support full 19″ network/rack hardware so as resources grow, I’ll have plenty of room to accommodate.