-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async serial handling #139
base: main
Are you sure you want to change the base?
Conversation
updated so the default remains the same, with a config option to enable the new processing logic |
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. |
I had a look at the PR and it looks good to me. I included the code in a branch on my fork, and I am testing it successfully. I added some logging on my own branch, but this looks good to me! 👍 |
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