VictronMPPT-ESPHOME icon indicating copy to clipboard operation
VictronMPPT-ESPHOME copied to clipboard

Async serial handling

Open wozz opened this issue 2 years ago • 5 comments

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 avatar Nov 21 '23 11:11 wozz

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

wozz avatar Nov 21 '23 11:11 wozz

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

yoannchaudet avatar Jan 06 '24 22:01 yoannchaudet

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.

randyoo avatar Jul 22 '24 14:07 randyoo