Skip to content

Comment on A smart plug to monitor your router and automatically reset power if WiFi fails

Comments

Interesting to see that. It turns out that around a month ago after seeing the Raspberry Pi project that send a tweet to Comcast when internet connection is slow, it gave me the motivation to use my Raspberry Pi 2 to do the following:

A- every 15 minutes check my internet connection: connectivity (reaching Goodle DNS host),

B- if connectivity fail, execute D-2 below, if not see next step below

C- then use SpeedTest download / upload; if download/upload speed are too slow then attempt a second test 30 seconds later

D- if the second attempt fail again then:

1- send an SMS with Twilio to my cell phone to let me know the modem will reboot, and wait 10 seconds

2- issue a "off" command to my Belkin Wemo (cable modem plugged into it), then wait another 30 seconds and issue a "on" command

On top of that I have installed InfluxDB + Grafana on my Pi so I can log the connection latency to Google DNS, and the download/upload speed. Example:

https://imgur.com/gallery/dgeFR

The Belkin Wemo command do use only my local Wifi, so even if the modem is down since my Pi is on the same LAN it can control the Wemo without problem.

It was a fun little project for my Pi. All written in Python. If anyone interested I can probably post the code somewhere.

[updated for formatting]

How do you get to twilio when the internet is down?

please do!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.