Detect whether network is up or down

Very n00b question, I don’t even own a Blinkstick yet.

I’d like to see from across the room whether my network is up or down, since it goes out frequently and other people share my connection. Normally I have to manually reset the modem when this happens. But I need to be alerted first.

Is there a way I could hang a Blinkstick on the front USB port of my Linux computer and have it do something when the network connection is interrupted? I had in mind a simple ping of 8.8.8.8 and if a certain number of pings are missed, or there is some other indication that the network has been down for say three minutes, the LED would blink or show a certain color.

I assume I’d have to write something maybe in python to query the network connection.

Can someone point me in the right direction with this? Maybe just provide a link if the topic has already been discussed? Thanks very much.

Hey Steven,

welcome to the BlinkStick forum.
This is really more a question about basic programming and you already got the right idea of solving it with python.
Regarding network check you can take a look at this:
[Checking network connection - python][1]

For BlinkStick itself take a look at the python examples here:

I hope it leads you to the right direction :wink: [1]: http://stackoverflow.com/questions/3764291/checking-network-connection

@steven_harnish loved your idea so I created a sample script to use BlinkStick as Internet connectivity indicator :wink: Hope this helps!

1 Like

Wow, thanks very much! I’ll check it out.

Is there a place that can point me the way to pushing this code onto my blinkstick? I can cut and paste with the best of them, but I’m not getting/understanding Xamarin, (just soldered everything together today) and im not wanting to bust into Mono. Any direction/guidance would be most helpful :slight_smile: Thanks

Hi Dave,

you cannot “push” this code onto your blinkstick. It is a control code you can use from your linux or windows machine. To use it you have to install python at first. There are many tutorials in the net how to do this.
Xamarin is C#, the script above is Python.

Basic informations how to control Blinkstick programmatically can be found here:
C#:
https://github.com/arvydas/BlinkStickDotNet/wiki

Python: