Just setup a pi-hole for DNS filtering. I subscribed to a bunch of block lists and then subsequently prevented Christine from loading a site on her work laptop. Seeing as how the network admin is not always home to take care of issues like this, I wanted a way for anyone in the house to disable filtering for ~5 min. There are many, many, many IoT button tutorials out there, with lots of different hardware, so this post will cover light details, please use it for inspiration.
If you haven’t done any work with the ESP-01S modules – these are the tiny 2 GPIO pin ESP8266 boards that have 8-pins, deep sleep mode, and can run off a 3.6V Lithium 18650 for months. I highly suggest getting a “code burner” board from the Jungle Site. This just makes de-bug and programming with Arduino IDE quality of life 1000% better.
The code required is going to change, and I’m not maintaining C# for this one, but it works like so: You need to connect to your WiFi, it needs to send a web GET request to your pi-hole, and then it needs to go into deep sleep. Something like: “http.begin(wifiClient, “http://your_pie_ip:80/admin/api.php?disable=300&auth=”);” and then “ESP.deepSleep(0);” This means the device is always powered and runs the code on startup.
The button is tied to the reset pin like this. I had to find a NO (Normally Open) e-stop button to get this to work. There are tutorials out there on how to switch this for a NC (Normally Closed) e-stop in case a transistor is easier / cheaper to get. I whipped up a 3D enclosure to hold all of this and posted it over on Printables.com. Lots of other models there if this one doesn’t satisfy your needs. Printed the bottom in clear PETG.
- 3D Printed Enclosure
- ESP-01 Code Burner
- ESP-01S or regular ESP8266 module
- E-Stop button (Normally Open)
- Lithium Battery Charger Module
- 18650 battery + holder
- Wire + 10K Ohm resistor