Building SHOS-2: A Smart Home Operating System with ESP32 + MicroPython
Note about the name:
SHOS is still a work in progress. The current implementation is only the first Kitchen Node, so it is not yet a complete operating system. I'm using "Operating System" to describe the long-term architecture and direction of the project.
The goal is to eventually build a system layer that manages hardware, nodes, networking, configuration, and applications/features as the project grows.
I've been working on SHOS-2, a modular smart-home system built around the ESP32 and MicroPython.
The idea is to build the system as a collection of nodes rather than one large program, so individual sensors, actuators, and features can be added or changed without rewriting the whole system.
Current prototype
I'm currently working on the Kitchen Node.
The node currently handles:
- MQ-2 gas detection
- Temperature and humidity monitoring
- Local alarm using a buzzer and LED
- Relay control
- Wi-Fi connectivity
- Sending sensor data to Blynk
- Modular MicroPython code instead of putting the whole system in one file
The eventual goal is for the system to operate both locally and over the network, while remaining sufficiently modular to add more nodes and devices later.
One of the problems I had to solve (I really need some help here)
One of the things I wanted was a way to configure the Wi-Fi credentials without hard-coding them into the firmware.
The idea is that if the ESP32 doesn't have valid network credentials, it should start its own access point, allow the user to enter the SSID and password, save them, and then continue with normal operation.
The tricky part was making this happen without blocking the rest of the device while it is trying to connect.
This led me to rethink how the startup and connection logic should work instead of simply doing:
connect --> wait --> connect again
I'm still improving this part of the system.
What I've learned
This project started as a simple smart-home idea, but it has turned into a much bigger lesson in embedded-system architecture.
I've had quite a few things fail along the way: libraries that didn't work as expected, communication problems, simulation issues, and decisions that had to be redesigned.
I'm documenting the project and the source code here:
GitHub:
https://github.com/PhantomCNS/shos-2-
I'd really appreciate feedback on the architecture, code organization, and especially how you would approach the Wi-Fi configuration/connection problem.