Tuesday, August 30, 2022

Lilygo TTGO ESP32 board draws a graph of power from Enphase solar

Little "Arduino" projects around here often require a display and connection to the internet. ESP32 based boards are an obvious choice but which one? There are lots about but often the documentation is difficult to use and may be only available in Chinese.

I've found a board that has the features I need and has excellent documentation. Mine come from AliExpress stores and sell for about $15.

My latest project draws a nice graph of our solar generation and power consumption.


No credit is due to me, I'm just using the excellent work of others. My code is here.

Briefly, it pulls JSON data from the web server in the Enphase solar controller and keeps two arrays of past values which it plots.

The Arduino IDE version 2 is getting really good and I notice it now has a debugger but it only works with a few ARM based boards. I have ordered an Arduino Zero to try it out.

I had some errors in my maths (which is pretty terrible) and it takes a long time to debug if you have to print to serial, build and download, run to see what it says. The debugger allows setting breakpoints and inspecting variables.

One thing I find odd about the Arduino IDE is that it builds every time, even if I haven't edited a file. If I build to check syntax and then click Run it builds again. Surely they are using make or CMake which would compare the built binary's modification date with the source code and only compile the files that have changed?

No comments:

Post a Comment