Closed MariusLaurinaitis closed 5 years ago
UPDATE: Espurna: MHZ19 @ SwSerial(13,15) MHZ19_RX_PIN -> 13 MHZ19_TX_PIN -> 15
I did not compil the new one, just: I swapped the wires only (I'll switch to RX and TX) and worked. But maybe you need to specify a PIN so that it does not mix others?
MHZ19 rx -> Wemos pin 15 MH19 TX -> Wemos pin 13
Sorry, do you mean GPIO 13 must be connected to the MHZ19 TX?
Yes: GPIO 13 must be connected to the MHZ19 TX Thats work for me
Well, that's right, in the definition 13 is RX (from the device point of view) and must be connected to sensor TX.
Hi! I have the same problem - Error reading data from MH-Z19. Power source for MH-Z19 - external 5V.
Is there any way to debug MHZ19?
did you swapped RX and TX?
Of course, many times. Gpio 13,15 (rx,tx and vice versa) Gpio 1,3 No success
Old one MH-Z19 (1st generation)
I'm not much into these sensors and I don't know what changes were there between different generations... @IvanUA, do you have a working code for your sensor?
Hi. Now I'm not sure about working condition of my MHZ19 (couldn't get it work directly through USB-UART). I'll will take a try with another one. Thank you.
@MariusLaurinaitis, I have some problems when compiling for having support for MHZ19 -> https://github.com/xoseperez/espurna/issues/1063
Any idea?
Thanks!
did you swapped RX and TX?
P.S. UPDATE: Espurna: MHZ19 @ SwSerial(13,15) MHZ19_RX_PIN -> 13 MHZ19_TX_PIN -> 15
I did not compil the new one, just: I swapped the wires only (I'll switch to RX and TX) and worked. But maybe you need to specify a PIN so that it does not mix others?
MHZ19 rx -> Wemos pin 15 MH19 TX -> Wemos pin 13
I tried it as well, but the same library error. I have a new installation, following all the steps of the guideline...
Which libraries are you using?
Thanks!
I tried 1.13.1 with all libraries
same here :-(
@MariusLaurinaitis It worked finally. Wrong reference on the libraries.
@IvanUA Does it work for you? I have the same:
[236659] [SENSOR] Error reading data from MHZ19 @ SwSerial(14,15) (error: 5) [242669] [SENSOR] Error reading data from MHZ19 @ SwSerial(14,15) (error: 5)
I have changed the pins, but with the same result.
Any idea? How do you know it is a first generation product?
I will try in the evening
try skipping the checksum check in MHZ19Sensor.h around line 181.
if ((buffer[0] == 0xFF) && (buffer[1] == 0x86)) {
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
This issue will be auto-closed because there hasn't been any activity for two months. Feel free to open a new one if you still experience this problem.
I believe that I faced same problem with checksum calculation.
In calculation loop, there is next line:
for (unsigned char i = 1; i < MHZ19_REQUEST_LEN-1; i++) {
This definition will let sum from 1 till 7 (MHZ19_REQUEST_LEN - 1).
According to datasheet (page 9) there should be sum from 1 till 8.
After replacing MHZ19_REQUEST_LEN with MHZ19_RESPONSE_LEN , calculations became valid.
@berezovskyi-oleksandr I have applied your suggested change but I still have the same issue. Tried multiple pins as well.
Hello Xose,, I have same problem witth MHZ19 , maybe here's the same problem with the serial? Does it work for you? Thanks