READ FIRST: As you may already know, the Incognito network is scheduled to shut down within the next 30 days so Iâm releasing this write up âas isâ and unfinished. This is something that I have been working on in my personal time to increase my physical security. If anyone is interested in this project feel free to message me on TG @lukemax to follow up.
Disclaimer: This project was not funded by, nor was it endorsed by Incognito. This project was done on my personal time and is being shared for the possible benefit to other privacy minded community members.
In todayâs digitally connected world, ensuring personal security goes beyond just safeguarding our data online. Physical access security is often overlooked but is equally essential in protecting our digital lives. To address this concern, I took on a unique project: building an Ethernet-connected Internet of Things (IoT) device that allows me to remotely shutdown my computers, server, phone, and more. In this post, Iâll guide you through the process of creating your own personal emergency shutdown button, ensuring your physical security is never compromised.
Bill of Materials (BOM)
-
Emergency or Panic Button: This will serve as the core interface for initiating the shutdown process.
-
3D Printed Enclosure: A custom 3D printed enclosure will provide a clean and secure housing for the components.
-
ESP32 Ethernet Module: The versatile ESP32 microcontroller, offering Ethernet connectivity, will be at the heart of our device.
-
DC Power Jack: This component will be essential for power input.
-
AC to DC Power Supply: To convert AC voltage to the required DC voltage for the device.
-
Wiring and Hardware: Various connectors, wires, and screws will be necessary for assembling the device.
-
Piezo Buzzer (optional): For audio notifications, a piezo buzzer can be added, providing an additional layer of feedback.
The majority of components required for this project can be sourced affordably from various online platforms (for example, Aliexpress.com).
Parts being spray painted and air drying
Assembly Steps:
-
3D Printing and Finishing: Start by 3D printing the enclosure and finish it by sanding the surface for a smoother finish. Prime and paint the enclosure in a color of your choice (for mine I chose to paint in flat black with a textured black on top, finishing with a light coating of glow-n-dark paint).
-
Flashing the Code: Use the code found below (with required changes) and flash it onto the ESP32.
-
Installing the Components: Assemble the 3D printed enclosure by placing the ESP32 and DC power jack inside.
-
Wiring: Connect the various components, ensuring proper connections for safe and efficient operation (see added wiring diagram for further information).
-
Attach Button: Attach the emergency button with the provided screws.
Open Source Code:
The heart of this project lies in the open-source code running on the ESP32 microcontroller. The code enables communication with the devices to be shut down and processes the shutdown commands securely. You can find the complete code posted below.
Expand for Code
#include <SPI.h>
#include <Ethernet.h>
#include <Button.h>// WiFi Configuration
const char* ssid = âYOUR_WIFI_SSIDâ;
const char* password = âYOUR_WIFI_PASSWORDâ;// Replace âCOMMAND_Xâ with the desired command to execute on button press
void executePlaceholderFunction() {
// Your code to execute on button press goes here
}// Pin for the button
const int buttonPin = 2; // Change this to the desired pinButton button(buttonPin);
EthernetClient client;
void setup() {
// Initialize the button
button.begin();// Start Ethernet connection
Ethernet.begin(mac); // Replace âmacâ with your Ethernet MAC address, if needed
delay(1000); // Allow time for Ethernet to initialize// Connect to WiFi
Serial.begin(115200);
Serial.print(âConnecting to WiFiâ);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println(âWiFi connected.â);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}void loop() {
// Check for button press
button.read();if (button.wasPressed()) {
// Button was pressed, execute the placeholder function
executePlaceholderFunction();
}// Maintain the Ethernet connection
if (!client.connected()) {
reconnect();
}
}void reconnect() {
// Attempt to reconnect to the server
while (!client.connect(serverIP, serverPort)) {
delay(1000);
}
}
Make sure to change the following before flashing the code:
-
YOUR_WIFI_SSID - Set your WiFi SSID (optional) - This acts as a fallback in case something happens to your ethernet connection.
-
YOUR_WIFI_PASSWORD - Set your WiFi password so the connection will work.
-
buttonPin - Define the button pin being used, in my case pin 2.
-
###
Summary:
By building an Ethernet-connected IoT device to remotely shutdown important devices, you add an extra layer of physical security to your valuable assets. The majority of components required for this project can be sourced affordably from various online platforms. By using the versatile ESP32 microcontroller running open-source code, you create a cost-effective and customizable solution for safeguarding your digital life. As technology and security continue to evolve, I invite you to share your thoughts, suggestions, and improvements on this project. Letâs make our lives more secure together.
F.A.Qâs
Question: Why not use WiFi as the connection method. Donât the ESP32 boards come with that built-in and are cheaper?
Answer
Yes, it is more expensive to purchase ESP32 boards with an ethernet connection. The reasons for using ethernet over WiFi are as follows: higher power consumption, susceptibility to interference, network congestion, and security concerns. Security concerns being the main point. Anyone can create an [illegal] WiFi jammer which would prevent the shutdown signal making it to your devices.
Question: ESP32 boards seem very capable. Is there anything else they can do?
Answer
Yes, of course, these IoT boards are amazing little power efficient devices. Iâm using the (optional) piezo buzzer to provide me with an audio alert if my server goes down (doesnât respond after X amount of ping attempts).
The options are practically endless. If you can imagine it, Iâm sure some has written code for it and is sharing it online. Iâm considering making a text based screen that shows me my server stats at a glance.
Purchase Links:
Panic Button: AliExpress.com
Female Power Jack Screw Mount: AliExpress.com
5v 2a Power Adapter (with matching plug): Depends on Country
Alternative Emergency Stop Button: AliExpress.com
Piezo Buzzer (optional): AliExpress.com
AliExpress shipping can take 15 - 30 days. While it is very slow, it is usually the cheapest option.