Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By alex_g
#65449 Hey, I'm glad this post exists and that I have found it!

I've cut my teeth programming the ESP8266 with Lua/NodeMCU. I recently tried out the Arduino IDE, because I wanted access to some of the nice Arduino libs, particularly rc-switch.

I'd be lying if I said I was overwhelmed by the Arduino experience. Most of the examples seem at trivially simple level and almost nothing is mentioned about the event-driven approach which is the ESP idiom. Loads of busy-waiting loops, what's that all about, eh?

As I explored more, I saw that there are some attempts to bring the even-based approach to Arduino, though one really has to look, I don't think there's anything like the nice NodeMCU unofficial FAQ available yet.

Then I realised that maybe a lot of this stuff is not available because no-one has got round to creating it yet, so I'm not negating the (obviously huge) efforts of everybody so far, don't get me wrong. I do think it would be nice to get some canonical guidance on programming the ESP, in C/C++, in an event-driven style though -- I only wish I had more to contribute, I'm only a beginner in this.

I already asked the question once before in the forum (before I found this thread), not much response so far. So, is there some kind of central location where these issues are discussed? I am going to experimant with some of the available systems and libs, but at this stage with my limited time, I'd like to avoid reinventing the wheel as much as possible.

I've seen a framework called QP-nano which looks cool, state-machine based, and also a little library called "Eventually" which bypasses the main Arduino loop and uses even managers. Does anyone know these, and how well they'd map to the requirements of ESP?

I'd also like to know how the watchdog timer plays with Arduino.
I haven't looked at programming with the SDK or even with Sming yet, I guess I should, but only so many hours in a day... ho-hum

Any other ideas suggestions links forums pointers most welcome!
Anything to transform a rank beginner into an "expert", really :P

Cheers!
User avatar
By RIN67630
#74896 One of the main problem with the Arduino libraries is that they just work.
They will work deeply suboptimal, but most people won't even notice.
For example there is still no Arduino-style library to handle time for the built-in RTC of the ESP32.
So the ESP32 is wasting power maintaining a time it already has in hardware...