KinDR007 / VictronMPPT-ESPHOME

Victron Mppt charger ve.direct to esphome node
MIT License
297 stars 64 forks source link

Async serial handling #139

Open wozz opened 10 months ago

wozz commented 10 months ago

This change updates the loop to yield between processing fields from the UART bus and publishing data to home assistant. This is recommended by esphome to avoid blocking longer than 20ms at a time.

However, it appears that some devices cannot keep up with the serial processing when it's done this way. Checksum verification is added to drop frames that may overrun the buffer.

fixes #132

wozz commented 10 months ago

updated so the default remains the same, with a config option to enable the new processing logic

yoannchaudet commented 8 months ago

This looks promising ❤️ !

I tested it on an ESP32 and it's dropping a lot of frames. Wondering if my connection is bad or not. It's also a little too slow still.

image
randyoo commented 2 months ago

I tested this branch, but it seems to make no difference in my log spam "Component esphome.coroutine took a long time for an operation (77 ms)." It recurs at the interval of victron: throttle, so I was optimistic that it might helpful.