Closed dannerph closed 2 years ago
Closed by #6 if I'm not mistaken
kind of: To give the process handle back to the main loop, if instead of while woud be required here: https://github.com/jplitza/esphome_components/blob/master/components/obis/obis.cpp#L29
However, I tested it and "while" is working a lot more stable (I guess some other loops might take too long so that there might be a buffer overflow on uart read - not checked in detail)
In the current implementation, it only return the loop if a full lines is read. in case of an error (no '\n') it might never return, which might lead to a Wifi crash on the esp8266 (the ESP32 is running wifi on the second core as far as I know)
According to the documentation, "readBytesUntil()" is a blocking call. In order to push the responsiveness to the maximum (e.g., for multiple meters, web server enabled, ...), it should be replaced. Its logic could be kept the same.
I will have a look on this issue in the upcoming days.