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

strengthen serial communication & reset #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bganne
Copy link

@bganne bganne commented Apr 28, 2021

Hi, thanks for the great work with weewx-meteostick, it works really well.

I only had an issue during initialization: my meteostick was already sending data over serial in human readable format when I started weewx, and weewx-meteostick failed in 2 different ways:

  1. failed to decode some bytes: it looks like during reset, some junk bytes can be read from the serial port. I fixed this issue by adding the 'ignore' parameter to the decode() function used during reset
  2. the reset command does not always work: I fixed the issue by adding an additional newline character before issuing the reset command so that if there were some character already written it is discarded. I am also making sure the output buffer is reset beforehand and I forced it to be flushed afterwards

On top of that, I also switch encode/decode from utf-8 to ascii. Not strictly necessary but I think it is more correct in this case.

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.

1 participant