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

Use different serial port #12

Closed
Actpohomoc opened this issue Jul 27, 2019 · 6 comments
Closed

Use different serial port #12

Actpohomoc opened this issue Jul 27, 2019 · 6 comments

Comments

@Actpohomoc
Copy link

I have used already built-in serial connection for RFID reader. Is there way to use USB serial device to get information from CO2 sensor?
Or implement software serial like we have it on Arduino.

@UedaTakeyuki
Copy link
Owner

UedaTakeyuki commented Jul 27, 2019

Hi Actpohomoc,

Thank you for your interesting and helpful suggestive question!
I.M.H.O. in the aspect of the software, the main difference in RPi UART and USB serial is just a tty device name (and some other parameters). What tty device do you see for the USB serial? Also, do you see the appropriate serial parameter?

In the wiring aspect, you should connect USB serial and MH-Z19 as follows:

USB Serial MH-Z19

  • 5V --- Vcc
  • GND --- GND
  • TX --- RX
  • RC --- TX

@TBR-BRD
Copy link

TBR-BRD commented Jul 29, 2019

Hello, i have the same problem. ls -l /dev/serial/by-id => lrwxrwxrwx 1 root root 13 Jul 29 18:56 usb-FTDI_FT232R_USB_UART_A50285BI-if00-port0 -> ../../ttyUSB0
Which config must be edit to use this USB UART module to read the data?
It is really important!
Thank you

@UedaTakeyuki
Copy link
Owner

UedaTakeyuki commented Aug 1, 2019

HI TBR-BRD,

How was the result of using /dev/ttyUSB0?

By the way, I recommend you the general way to find USB serial:

  1. Without USB serial, look ls /dev
  2. Connect USB serial, then look ls /dev again, find an added one must be the device file of USB serial.

Please tell me the result!

Sorry for my late reply due to my travel.

@UedaTakeyuki
Copy link
Owner

UedaTakeyuki commented Aug 11, 2019

Hi TBR-BRD, Actpohomoc

I've added --serial_device option for specifying a specific serial device.
Please try it with the latest version of the library as follows:

sudo python -m mh_z19 --serial_device /dev/ttyUSB0

I'm appreciated your feedback!
Thanks, and sorry for my late reaction due to my summer vacation. Now, I've returned home.

@TBR-BRD
Copy link

TBR-BRD commented Aug 12, 2019 via email

@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
None yet
Projects
None yet
Development

No branches or pull requests

3 participants