Closed InvertedMinor closed 6 years ago
Do you have disabled serial logging?
yes
Try to swap tx and rx. Sometimes it is false labeled.
Do you have connected GND between sonoff and sensor? Is the sensor correct powered? It needs minimal 3.6 Volt Vin and max 5.5 Volt If i see it correct you use the 3.3 Volt power from sonoff. This is under the Vin spec. from the sensor
Thnx, I will try this
I had a MH-Z14 running with the MH-Z19 settings, and it was running nicely for quite a while. Then it sometimes started to have zero readings, with newer firmwares I always only received zero readings.
I patched the firmware to use hardware serial (with serial.swap) instead of softserial, and now it is working flawlessly. But I would love to see this being fixed in a way so that the standard tasmota firmware continues working with MH-Z19 (and possibly MH-Z14a).
Actually, I was using a Wemos D1 instead of Sonoff, and I see you are already using the hardware serial. So it is possible that the low VCC is causing your problem.
Followed above comments: MH-Z19 connected to 5V power supply and measured the actual voltage, Gnd MH-Z19 connected to Sonoff, tried to switch rx/tx, .... but no result (values remain at 0).......
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.
I can confirm you need hardware UART for MHZ14 to work as mentioned in https://github.com/arendst/Tasmota/issues/2237#issuecomment-376097913. You don't have to make you own tasmota build thought. If you pick the pins correctly, the MHZ driver will switch to hardware UART on its own, see this source code comment. https://github.com/arendst/Tasmota/blob/c08561f67c722556655da7b8cbe1482d98aecd90/tasmota/tasmota_xsns_sensor/xsns_15_mhz19.ino#L26
This solution is already mentioned on the MHZ19 sensor page in the Wiring section (https://tasmota.github.io/docs/MH-Z19B/#wiring) so if people read the page carefully, unlike I did, resolving this should be straightforward.
Connected MH-Z19 to Sonoff Basic, the sensor led does flash, but no data is received by the Sonoff. I must be doing something wrong. Any ideas?