I think we have all owned one of those internet things that needed the daily reboot or power cycle when it loses the plot. That manky modem, rubbish router or grumpy gateway?
I present to you Plan B. A smart ish relay which has timer, time of day and loss of ping probe as options for power cycling an attached device. It can also send an email so you know what's happened if your interested in such things. Finally it allows you to remotely do a manual power cycle assuming you have network access.
The idea is to make those almost 98% reliable things to become more like 4 or 5 9's
It is made from a board I found on ebay and programmed with a quick Sunday afternoon hack. So heads up the code is none too pretty.
The board has an ESP8266, Relay and DC power supply. An no, I didn't design the board. It was any port in a storm for this project. This "ebay special" PCB didn't come with any instructions or documentation but I'm not bad at reverse engineering so it didn't take long to marry to the software. There is also an optically isolated input which I'm not using but could easily be used to monitor the device power source for example.
Relevant details about the board are in a comment on top of the code for the project. If you look around there are many turnkey boards that will also work with this code.
The relay has both NO and NC contacts. I was looking at the NC so it draws no power in the inactive state. However you can do either as the active state can be specified in the GUI. There is also support for those wee OLED displays should your board be blessed with one (which means it won't use GPIO4 for the relay!).
There is my normal lack of visual style GUI expressing on two IP addresses. One as SoftAP for config and the other as network client.
Ohh yeah, a big hint is that jumper in the photo goes on when you program the wee board. Use a FTDI usb breakout board and make sure it's set to 3.3V output. After programming remove the jumper and re-power the board to run the program.
When in doubt follow the white rabbit. Happy coding
Comments