Closed geccko closed 1 year ago
Nobody? Please I need help with this.
This is the working configuration I use
sensor_modules:
- name: hcsr04_sensor
module: hcsr04
sensor_inputs:
- name: distance
module: hcsr04_sensor
interval: 300
digits: 2
pin_echo: 17
pin_trigger: 13
burst: 3
Hi @baryonicnonsense,
I tried your configuration but show me the followint error:
Traceback (most recent call last):
File "/home/pi/mqtt-io/mqtt_io/server.py", line 561, in poll_sensor
value = await get_sensor_value()
File "/home/pi/.local/lib/python3.9/site-packages/backoff/_async.py", line 133, in retry
ret = await target(*args, **kwargs)
File "/home/pi/.local/lib/python3.9/site-packages/backoff/_async.py", line 66, in retry
ret = await target(*args, **kwargs)
File "/home/pi/mqtt-io/mqtt_io/server.py", line 556, in get_sensor_value
return await sensor_module.async_get_value(sens_conf)
File "/home/pi/mqtt-io/mqtt_io/modules/sensor/__init__.py", line 57, in async_get_value
return await loop.run_in_executor(ThreadPoolExecutor(), self.get_value, sens_conf)
File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/pi/mqtt-io/mqtt_io/modules/sensor/hcsr04.py", line 131, in get_value
return self.sensors[sens_conf["name"]].measure_range()
File "/home/pi/mqtt-io/mqtt_io/modules/sensor/hcsr04.py", line 100, in measure_range
raise RuntimeError(
RuntimeError: Unable to measure range on HC-SR04 sensor 'distance'
My config is ::
sensor_modules:
sensor_inputs:
That looks like an issue with the sensor itself. I'd double check that everything is wired up correctly, the echo and trigger pins are properly set, and that the distance you are attempting to measure is within the capabilities of the sensor.
Hi @baryonicnonsense,
It's working perfectly! It was a misconfiguration with the pins of the raspberry!
Thanks!
Describe the bug It always shows me the same error indicating that the configuration is incorrect. I've checked many times and can't find the fault.
Expected behavior mqtt-io connect to the sensor hcsr04 and send values to mqtt server
Error messages and traceback
Config
Hardware
System:
Additional context I have tried reinstalling versions 2.2.6 and 2.2.7 with the same results.