Skip to content
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

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft

Async serial handling #139

wants to merge 24 commits into from

Conversation

wozz
Copy link
Contributor

@wozz wozz commented Nov 21, 2023

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
Copy link
Contributor Author

wozz commented Nov 21, 2023

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

@yoannchaudet
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blocking Esphome
2 participants