Electronics > Microcontrollers

Quick ESP32 project - Arduino, ESP IDF, Micropython, Tasmota?

(1/5) > >>

Warhawk:
Hello everyone,
I've been around embedded programming professionally as well as for hobby. My hobby projects use typically 8-bit microcontrollers (MSP430, ATmega, PIC..). I prefer vanilla C, registers access, and simplicity.

However, I would like to do a little project for home automation. The device shall decode a serial bus from Buderus heating system and report parameters to my home assistant server that uses MQTT. For the transport layer, I could use ZigBee but WiFi seem to be easier. I like the ESP32 device.

I came to the conclusion that writing vanilla C code for the said application would be enormous effort. I would never finish this project. For this reason, I am looking at other options.


* Tasmota in ESP32 + small MCU (that I know well) for decoding the bus. I would then just stream JSONs over UART to ESP32 and let it do its job.
* Micropython in ESP32 - there are some examples online that seem to be easy
* Arduino - I've been always hesitant to use arduino. It is something that professionals avoid. However, I must admit that I blinked an LED with ESP32 in 5 minutes. Still, it feels like a toy.
Here are my prirorities:
1. Frustration free
2. Stable end-application (Tasmota?)

This device should run 24/7. When it fails it is not the end of the world. It is not controlling anything. However, I hate when I need to babysit electronics.

Thank you for any tips and other suggestions.

Best regards, Jiri

globoy:
I can't speak to Tasmota but either Arduino or Micropython running on the ESP32 would be fine for this task.

If you know python then Micropython would probably be a quick way to get this done and you wouldn't have to code for another micro-controller.

Arduino would probably be more code but for the exact reason people sometimes discount it would be less code than a straight C Espressif IDF project.  Aside from the intentionally simplistic IDE (since it's aimed at a very broad audience) it has two characteristics that help project like this.  There are libraries with simple API's that wrap fairly complex systems such as WiFi and mqtt.  You can get onto wifi and communicate with literally only a few lines of code.  And if you want the entire Espressif IDF API is available as well (under the covers, so-to-speak).  I've written multi-CPU programs for ESP32 using Arduino with all sorts of features including semaphores and access to IDF libraries.

There's nothing inherently un-stable about either environment, given your code is reliable.  I've never shipped a product that's built using the Arduino IDE but I have had systems I've built for other purposes that run 24/7 for years at a time.  One thing to contemplate no matter what your solution are WiFi disconnections and having your code know to re-connect since you aren't in control of the other end of any WiFi connection or the servers you might be talking with.

Seems to me that all computer work is frustrating at times :-)  I find biting off a little at a time and slowing building an app like this works reasonably well.  Good luck with your project!

Warhawk:

--- Quote from: globoy on December 01, 2022, 05:35:56 pm ---I can't speak to Tasmota but either Arduino or Micropython running on the ESP32 would be fine for this task.

If you know python then Micropython would probably be a quick way to get this done and you wouldn't have to code for another micro-controller.

Arduino would probably be more code but for the exact reason people sometimes discount it would be less code than a straight C Espressif IDF project.  Aside from the intentionally simplistic IDE (since it's aimed at a very broad audience) it has two characteristics that help project like this.  There are libraries with simple API's that wrap fairly complex systems such as WiFi and mqtt.  You can get onto wifi and communicate with literally only a few lines of code.  And if you want the entire Espressif IDF API is available as well (under the covers, so-to-speak).  I've written multi-CPU programs for ESP32 using Arduino with all sorts of features including semaphores and access to IDF libraries.

There's nothing inherently un-stable about either environment, given your code is reliable.  I've never shipped a product that's built using the Arduino IDE but I have had systems I've built for other purposes that run 24/7 for years at a time.  One thing to contemplate no matter what your solution are WiFi disconnections and having your code know to re-connect since you aren't in control of the other end of any WiFi connection or the servers you might be talking with.

Seems to me that all computer work is frustrating at times :-)  I find biting off a little at a time and slowing building an app like this works reasonably well.  Good luck with your project!

--- End quote ---

Thank you, this is extremely valuable feedback. A friend of mine also mentioned that MicroPython could be the right thing to start with. I saw the C Espressif IDE but honestly, I am not willing to bother with it. I admit that I have limited Python knowledge but I am willing to learn something new. 

Lindley:
As you want something quick and ready to run, have a look at this site which covers mainly Arduino, but also some MicroPython MQTT.
https://randomnerdtutorials.com/

paulca:
Not sure about micropython, but I did make a serial RS485 device monitor.

https://www.eevblog.com/forum/projects/nodemcu-esp8266-rs485-epever-solar-monitor-diy/

Bizarrely, this is still sitting in the garage and I don't think it has ever, ever been switched off, it is connected to solar power of course and it's never missed an update, never gave a rubbish value either. The only minor issue I had was an ESP8266 out in the garage in a tiny plastic box does not do well with Wifi reception, buts that's not its fault.

Annoyingly, it has yet to under go the MQTT upgrade the rest of my stuff got.  So it still uses a bridge script which republishes it as individual MQTT topics.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod