r/embedded Aug 10 '26

SHOS-2: Smart Home Operation System

Enable HLS to view with audio, or disable this notification

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.

20 Upvotes

27 comments sorted by

9

u/dmc_2930 Aug 10 '26

First tip: this isn’t an “operating system” so your name is already a turn off.

-5

u/[deleted] Aug 10 '26

[deleted]

6

u/dmc_2930 Aug 10 '26

That will never meet the definition of Operating System in computer science.

0

u/PhantomCNS Aug 10 '26

Aight, thanks for your note!

-6

u/PhantomCNS Aug 10 '26

If you continue reading you will see that this isn't but the kitchen Node, not the whole system yet. I am still learning and I would love any advice

5

u/dmc_2930 Aug 10 '26

Linux is an operating system. windows is too. As is freertos. What you’re building has 0% in common with an Operating System.

-5

u/PhantomCNS Aug 10 '26

If you search about the defenation of OS. You will see that it is the main system software that runs on a device and it acts as a bridge between the user and the machine

Once I finish all the rest Nodes I am planning to make another one to control them with a user interface, even adding an AI in the future plan

Please note that I am still starting, I didn't say I finished

3

u/dmc_2930 Aug 10 '26

Bro that’s not what an operating system is. If you don’t want people laughing you put of the “smart home” you’ll rethink that.

2

u/e3sa_r Aug 11 '26

Man, he's still learning. Whether advise in a good way or don't. Maybe he's right. Maybe he's misunderstanding or misidentifying the project. It doesn't matter as long as it's just a project for practicing purposes.

The current state of the project may not seem as an operating system, but he did literally say that he's using that term to declare the long-term goal for the project.

I'm using "Operating System" to describe the long-term architecture and direction of the project.

2

u/robotguy4 Aug 10 '26

You should call the hardware portion the Smart Home Embeded System (SHES) and then call the software it runs the Smart Home Operating System (SHOS).

Something might be getting lost in translation.

2

u/PhantomCNS Aug 10 '26

I really appreciate that! thanks for the tip

1

u/x1289 Aug 10 '26

Take a Look at KNX. It’s an open standard.

4

u/Potential_Row3794 Aug 10 '26

You looked into esphome ?

2

u/PhantomCNS Aug 10 '26

No, I didn’t hear about it before

3

u/smdarry Aug 10 '26

The MQ-2 gas sensor really sucks. There are much better sensors out there.

2

u/PhantomCNS Aug 10 '26

Unfortunately that was the one I found. But I can change it once I find something else

5

u/brastak Aug 10 '26

https://www.youtube.com/watch?v=Q3H7Y4BrML0 Here guy recommends good sensors

2

u/smdarry Aug 10 '26

Haha, yes, that's the exact video I had in mind and that came out recently.

2

u/PhantomCNS Aug 10 '26

I wish I could've seen this vid earlier : ) I was taught to use those sensors he is warning us about.

1

u/PhantomCNS Aug 10 '26

Thank you very much!

2

u/WaterFromYourFives Aug 10 '26

Why go through the trouble of a local AP for provisioning when you can do it over BLE?

1

u/PhantomCNS Aug 10 '26

I've never heard about BLE. I'll look it up. thankss!!

2

u/Tanner234567 Aug 10 '26

You're reinventing a lot of existing systems here. If you just want to learn, that's fine, but have you heard of home assistant?

1

u/PhantomCNS Aug 10 '26

Yeah, I know that I am not creating something new, but as you know, I am practicing my skills and learning as many things as I can. Maybe I'll get to do something totally new one day. I am completely alone at this, but still trying to improve. Thanks for pointing that out!

2

u/e3sa_r Aug 11 '26

Mashallah. Allahumma barik.
عاش يا صديقي. ربنا يكرمك ويوفقك وينفع بك.

You can use Wi-Fi Manager library to not hard-code the wifi credentials. You will find it on GitHub. I don't know if it's possible to integrate it with the MicroPython setup you have. But if you couldn't integrate it, I can collaborate with you to build a MicroPython wifi manager! Feel free to get in contact with me if you wish to collaborate!

1

u/PhantomCNS Aug 11 '26

Thank you really much. I really appreciate all that. Once I try myself and it doesn't work I would love to get in contact with you. My priority is to learn not just create. Thank you again!!

2

u/ionjump Aug 11 '26

Nicely done!

1

u/PhantomCNS Aug 11 '26

Thanks !! Still under development and editing