Don't want to pollute the ESP32 thread so want to discuss real time data streaming using the ESP8266 here. Reason for it is that most people already have an ESP8266 buried in their inverter and likely aren't very keen to swap it for something else because everything needs to be pulled apart.
That said, it seems that the ESP8266 modules I ship seem to not be able to OTA, even though the support is built in. Might be down to the unique way I program them.
Anyway, the idea is rather simple: without further processing stream the serial data received from the STM32 to the first attached client (192.168.4.2).
UDP seems to be the method of choice as it doesn't need to wait for acknowledgements. I have found this:
https://fipsok.de/udp
Looks rather simple
Code: Select all
Udp.beginPacket(unicastIP, PORT);
Udp.printf("Temperatur: %.2f°C", tempC);
Udp.endPacket();
I don't aim for user friendliness here. I'd simply browse some URL (/stream) and all its handler does is enable the UDP streaming in the loop function. There is also a function called yield() and I hope it triggers the watchdog so that the ESP doesn't reset. I'd disable the web server during streaming and to get back to normal mode a power cycle would be needed. (What sucks about this is that you can't even adjust parameters). Hmm, maybe the http can remain enabled, lets test this first.