UedaTakeyuki / mh-z19

Read CO2 concentration from mh-z19 sensor on the Raspberry Pi & handle it. Detect Raspberry Pi model automatically and read the value from an appropriate serial device.
MIT License
182 stars 37 forks source link

Output always empty array #44

Closed DeckardCain2014 closed 2 years ago

DeckardCain2014 commented 2 years ago

Hi, I've cloned the most recent repo version and connected everything as shown in the Readme. However, it seems no value is received. This is my output and my connections:

sudo python -m mh_z19
{}

photo_2022-03-02_15-01-50

UedaTakeyuki commented 2 years ago

Hi DeckardCain2014,

Allways returning blank array without any error message nor stacktrace

It indicates that the sensor module didn't respond. Might be some hardware or cabling problem.

DeckardCain2014 commented 2 years ago

Hi, thanks for getting back to me. Can you tell me what to check furthermore?

Am Do., 3. März 2022 um 00:07 Uhr schrieb Dr. Takeyuki Ueda < @.***>:

Hi DeckardCain2014,

Allways returning blank array without any error message nor stacktrace

It indicates that the sensor module didn't respond . Might be some hardware or cabling problem.

— Reply to this email directly, view it on GitHub https://github.com/UedaTakeyuki/mh-z19/issues/44#issuecomment-1057481171, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRIV2KWK75FWGYEPMMK7PTU57YC7ANCNFSM5PXRYSOQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

-- Mit freundlichen Grüßen

Jan Fiedler

UedaTakeyuki commented 2 years ago

I'm afraid I can't provide suitable advice. In general, cabling loosenes, electrify, and so on.

DeckardCain2014 commented 2 years ago

Ok thanks

to-roth commented 2 years ago

Hi everyone, I had the same problem. In my case I forgot to enable the serial port hardware on my pi. Therefore always make sure that in your /boot/config.txt you have the following line:

enable_uart=1

or enable your serial port hardware just like described in the wiki (sudo raspi-config)

hawtkey commented 1 year ago

Hi, I had this error and found it to be that the Pi (3b+) uses UART for bluetooth and that can interfere with the co2 module. you can probably figure out a way to use a different channel if you need, but I disabled bluetooth since I don't use it:

simply add dtoverlay=disable-bt to the end of /boot/config.txt and reboot.

resting-dove commented 1 year ago

I had this error as well and after too much time I realised my pin connection was wrong. When i connected RxD <-> TxD and TxD <-> RxD (physical pins 8 and 10) as mentioned in https://github.com/UedaTakeyuki/mh-z19/issues/22#issue-688525199 I received measurements using serial as well.