First: RUST is not fudgy, second: Micropython has not all of the capabilities ESP32 has. So for example no chance for proprietary protocols for BluetoothLE, it has only a few api capabilities. So I would never do that cause it is not more complex to write Software with RUST. Why should I use Python on a dedvice? No way. Second is: it is coming with Pyhton interpreter. Costs too much memory in runtime. No, that is no way. RUST or C. Every other language is: crap on ESP32.
The next is: I have not only relays but also more complex applications, sensors and more. So there is no ready to use Board. In case of the relays I have no chance cause the boards are not usable for 230V looking on the european standards. No way. So: Kicad, Board Design, run. That’s it. It’s not that complex.
But at the end: why I should use a MCU with a crappy language construct and Linux for an embedded solution when and if I can program bare metal with a language made for this? It is simple. No Linux needed, no runtimes needed. Not even a bootmanager. Only the written Software compiled for the device.
The fuzzy Part is using timers on MCU. As the embedded Linux variant is not realtime it will be complex to get exact timers running. So bare metal has exactly theese capabilities. Timers with interrupts are simple to use and building up the chance that in case of using them for example PWM can be builded up directly hardware based. Doing that with a Linux would mean: you have this Software based. Means also: MCU will stand still. While the Hardwaree timer is hardware implemented the software timer is not. It is a task on the MCU processing unit. Loosing all capabilities and the freedom of the hardware use is nothing I would even think about. That’s why I prefere RUST or - in history - C.
@thorstenstueker Oh, I don’t doubt you have special needs but this thread is really about @jalih and his home automation.
Anyway, here’s a tutorial on using BluetoothLE on an ESP32 with MicroPython.
And here’s the MicroPython documentation about using BluetoothLE at a lower level.
Below is a beginners guide to Home Assistant.
Sorry @jilah but I don’t think your dashboard is in the same league:
Edit:
First 6 min 20 secs of the video is about getting your Pi ready, if you just want a quick look at Home Assistant first you can skip past that.
Oh, we do also home automation stuffs. Measuring of temperature, air humidity and so on. Most BLE you can do with MicroPython. But the questzion is why? Pyhon is as complex as C or RUST on bare metal. With Micropython you will be in the need to use the same timers if you’ll need one. That results in the same complex code but in Python. I don’t see why this will help in any case. But if somebody wants Python and has no special needs: go for it. It is reliable and working and yes, it is in another league. Also GUI for Displays is no problem with MicroPython. But you may have smaller MCU for automation without the MicroPython support. We have here and that’s why it is no option for us.
Home Assistant is also a hobbyist system, It’s not fit for real work where everything must always work and updates don’t break the system like with HA frequently happens.
RUST or C proghrammed Boards needing no runbtimes. Only install the Software you wrote. Programming bare metal means programming bare metal. Nothing else needed. No Bootloader nothing.
Programming STM or Atmega or other MCU without any kind of OS on it. Why shoulr I use one?
That’s okay. Why it is multithreaded? Using several tasks and having no interrupt system? Your MCU yould provide one. No problem. And Multitasking on an MCU? There are ways without. State machine and interrupts on events. No problem. Fast and that’s it.
I have a scheduler, webserver, gui, and update tasks running and communicating via queues. Nice thing about it is that tasks can sleep most of the time.
Webserver is always in ther need of it? Na. ESP32 can provide that also without problems. Use RTos on ESP32, program with Rust → Solution. Works without a problem with all capabilities of the MCU and not only of the Linux API to the Hardware.
Would you run ESP32 based hardware as a central controller for home automation? I personally like to have my central controller powerful enough to handle databases, allow hardware accelerated data analysis using edge AI, etc. Still, nothing stops me interfacing as many micro controllers my project needs.
Depends on the job that has to be done. As home automation controller it is mostly not an embedded application but a desktop application or a web application running. That I always would do with A Raspberry PI or Banana with SSD and that’s it. We have a special housing for this devices and we have a SPI interface controller board and can use this to control up to 200 different signals (in and out) and also analog signals. So I would say: yes, for Servers with the need we use PI. For one of our customers his climate system provides a web server we builded on esp32 while it was fitting for the stuffs we needed. So I can stay that I am choosing the hardware for the stuffs I need to do with them. I also have tandem solutions for example with esp32 for communication and network providing as an access point and a ATMEGA2650 as microcontroller for the signal processing connected to esp32 with SPI. So I have enough ports free on ESP for mounting a display. There are many possible solutions.