I never appreciated my internet connection enough when I lived in the city. Now that I’m a country mouse I think it really IS a series of tubes. Reliable it’s not. So I thought it would be fun to use an Arduino, my BlinkM and a bit of python to create a visual network monitor.
Here are the steps:
1. Plug your BlinkM into analog ports 2-5 (the standard way instructed by ThingM).
2. Load the Communicator sketch from ThingM onto your arduino.
3. Run the python script. This must be run as Administrator on windoze and although I haven’t tried it yet I believe it must be run as root on Linux. The code should be safe, but review it anyway for your own piece of mind.
Here’s the python script, this includes ping.py which is a pure python module I use for ping functionality. I also hacked code from John Tokash for talking to the BlinkM. You will also need the pySerial module installed.
As I expect is generally the case with RGB LEDs, the BlinkM needs a diffuser to properly mix colors. I’ve used a variety of things for diffusers in the past, usually something within arms reach. They tended to be relatively large and fragile.
This time I wanted to come up with something more compact but that still used whatever materials I have on hand. One of the first things I came across was a bag full of jewel cases from software long obsolete. Primary material search complete.
My idea was to stack some small chunks of jewel case plastic, glued with super glue, drill a hole in the bottom so that it would sit on the rounded top of the BlinkM LED. I thought perhaps it would be necessary to sand the layers to add diffusion.
So that’s what I did. I using a dremel cutoff wheel to slice up 4 similar sized chunks around 3/8”x1/2”. I used some gel type super to stick them together. Then I clamped the stack in my PCB vise and rounded the edges with a dremel round sander. Finally I found a drill bit close the diameter of the BlinkM dome and carefully drilled a hole. An added bonus was that the super glue fogged the plastic so no extra sanding was required.
The pictures above show the BlinkM set to yellow with and without the diffuser. It’s a bit tough to capture the intensity and color in an image, but you get the idea. I think it could use another couple layers of plastic and perhaps some more creative shaping, but isn’t too bad for a first attempt.
More of Pat’s Projects can be found at his tumblr Noise is Life.
6 thoughts on “The Machine That Goes PING!”
Neat but what are you actually monitoring? Its unclear from the article. Looking at the code – its not necessary to need admin or root if all your doing is icmp.
And it distracts from the quality of the article when you use a cheap dig at Microsoft by using “windoze” instead of “windows”. Its completely unnecessary.
From the header block of ping.py “Note that ICMP messages can only be sent from processes running as root.” which I didn’t notice until I actually tried and failed as non-admin. Do you think my M$ slur might hurt Ballmer’s feelings? I imagine he can just roll around in his billions to feel better. I’ve been in the trenches with that particular product line for 20+ years, I’ll take whatever catharsis I can get. Check the code to see exactly what I’m monitoring, I just came up with a set of rules that seem to work ok, I’ll probably continue to tweak them. YMMV.