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

--serial_device not working #21

Closed
idegre opened this issue Aug 26, 2020 · 3 comments
Closed

--serial_device not working #21

idegre opened this issue Aug 26, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@idegre
Copy link

idegre commented Aug 26, 2020

when attempting to use the --serial_device parameter it always returns an error.
sorry I don't have the exact error as I changed the code on my pi and didn't get any screenshots or the exact error. I found this when trying to use a usb->serial interface on my pi3 so i wouldn't need to deal with the onboard serial
luckily its an easy fix, but i cant create a PR to save you the trouble
https://github.com/UedaTakeyuki/mh-z19/blob/master/pypi/mh_z19/__main__.py#L56 here it should be mh_z19.set_serialdevice(args.serial_device)

Describe the bug
when attempting to use the --serial_device parameter it always returns an error.
sorry I don't have the exact error as I changed the code on my pi and didn't get any screenshots

To Reproduce

  1. call sudo python3 -m mh_z19 --serial_device /dev/ttyUSB0
  2. see set_serialdevice(args.serial_device) is undefined error

Expected behavior
the command should work

Screenshots
If applicable, add screenshots to help explain your problem.

@UedaTakeyuki
Copy link
Owner

UedaTakeyuki commented Aug 26, 2020

Hi, idegre!

I really appreciated your issue report.
The reported issue is reproduced on my side, so I think I can fix it soon.

@UedaTakeyuki UedaTakeyuki added the bug Something isn't working label Aug 26, 2020
@UedaTakeyuki
Copy link
Owner

Hi, idegre!

I've fixed it, now it works as follows:

pi@raspberrypi:~ $ sudo python -m mh_z19 --serial_device /dev/serial0
{"co2": 535}
pi@raspberrypi:~ $ sudo python -m mh_z19 --version
0.6.3

Please update your mh_z19 module and tell me the result, thx!

@UedaTakeyuki
Copy link
Owner

No feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants