Hello,
So newb question but I’m not able to read any data from my MH-Z19B sensor. Below is the log after deactivating and reactivating the sensor on the input page. It states to “Review the log lines following Input Activation to investigate why this happened.” but after the Activation line it just says “ERROR - mycodo.controllers.controller_input_ea4c154a - Mycodo is attempting to acquire measurement(s) from an Input that has already critically errored. Review the log lines following Input Activation to investigate why this happened.” So is there a different log I’m supposed to look at?
2022-06-16 12:58:18,295 - INFO - mycodo.controllers.controller_input_ea4c154a - Deactivated in 33.8 ms
2022-06-16 12:58:45,136 - ERROR - mycodo.controllers.controller_input_ea4c154a - initialize_variables() Exception: Write timeout
Traceback (most recent call last):
File “/var/mycodo-root/mycodo/controllers/base_controller.py”, line 74, in run
self.initialize_variables()
File “/var/mycodo-root/mycodo/controllers/controller_input.py”, line 317, in initialize_variables
self.measure_input = input_loaded.InputModule(self.input_dev)
File “/home/gg/Mycodo/mycodo/inputs/mh_z19b.py”, line 130, in init
self.initialize_input()
File “/home/gg/Mycodo/mycodo/inputs/mh_z19b.py”, line 151, in initialize_input
self.abcoff()
File “/home/gg/Mycodo/mycodo/inputs/mh_z19b.py”, line 199, in abcoff
self.ser.write(bytearray([0xff, 0x01, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86]))
File “/var/mycodo-root/env/lib/python3.9/site-packages/serial/serialposix.py”, line 636, in write
raise SerialTimeoutException(‘Write timeout’)
serial.serialutil.SerialTimeoutException: Write timeout
2022-06-16 12:58:45,146 - INFO - mycodo.controllers.controller_input_ea4c154a - Activated in 6320.0 ms
2022-06-16 12:58:45,148 - ERROR - mycodo.controllers.controller_input_ea4c154a - Mycodo is attempting to acquire measurement(s) from an Input that has already critically errored. Review the log lines following Input Activation to investigate why this happened.
2022-06-16 12:58:55,012 - ERROR - mycodo.controllers.controller_input_ea4c154a - Mycodo is attempting to acquire measurement(s) from an Input that has already critically errored. Review the log lines following Input Activation to investigate why this happened.
2022-06-16 12:59:09,967 - ERROR - mycodo.controllers.controller_input_ea4c154a - Mycodo is attempting to acquire measurement(s) from an Input that has already critically errored. Review the log lines following Input Activation to investigate why this happened.
2022-06-16 12:59:25,028 - ERROR - mycodo.controllers.controller_input_ea4c154a - Mycodo is attempting to acquire measurement(s) from an Input that has already critically errored. Review the log lines following Input Activation to investigate why this happened.
The MH-Z19B is connected directly to the Pi as follows:
Red (VIN) connected to 5V on Pi
Black (GND) connected to GND on Pi
Blue (RX) connected to TXD on Pi
Green (TX) connected to RXD on Pi
From what I could gather from a different post (MH-Z19B Wiring Sanity Check), because I’m connecting the sensor directly to 5V it’s not supposed to show as UART? And if so how do I change that?