hcsr04 config validation issue
Been trying to use a ultrasonic sensor hcsr04. I have build the docker container on my rpi3 with the latest code from develop branch today (07-05-2022). I have conencted the sensor and use your exact configuation example from here : https://hub.docker.com/r/flyte/mqtt-gpio eq :
sensor_modules:
- name: hcsr04_sensor module: hcsr04 pin_echo: 27 pin_trigger: 17 burst: 10 # number of measurements for output of distance value in [cm]
When running the container I receive this error :
Traceback (most recent call last):
File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/mqtt_io/mqtt_io/main.py", line 112, in
- unknown field pin_echo:
- unknown field pin_trigger:
- unknown field
All my other sensors run just fine :(
Nobody ? Nothing ?
Hello,
I have the same problem with hcsr04. Do you have a solution??
self.io.setup(pin, direction, pull_up_down=pullup, initial=initial_int)
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/pi/.local/lib/python3.9/site-packages/mqtt_io/main.py", line 85, in
- unknown field pin_echo:
- unknown field pin_trigger:
- unknown field
thanks!
@techadrian did you solved your problem ?
Hello @geccko , No. Nobody responded for several months and I do not have the python skills to find a way out of this. I decided to move to another project since flyte/mqtt-io looks dead. Also this project has other big issues for me, like the fact that after two-three days or running , the relay states and relay commands take over 1 minute to execute/read (I am using a docker container to run this app ) so I need to restart the app every night. Also....hw resource consumption is terrible on my rpi3b ....
Hello @techadrian,
I'm testing other project which I modified for my needs and I'm testing the ultrasonic sensor with good results. Which project are you using? please let me know.
Thanks
Hello @geccko ,
In order to simplify things, I started modfying https://github.com/alaub81/rpi_sensor_scripts , created a bash script that will execute those python scripts to get the data and pass it to home assisntant, also containarised the whole thing using docker. I kinda started with https://github.com/alaub81/rpi_sensor_scripts but now I see it is slowly evolving into a new solution :)
Hello @techadrian,
I'm testing https://github.com/DCL777/sensors2mqtt, created a new archive for the hcsr04 ultrasonic sensor and pass it to home assistant. It's seems that works perfectly for my needs. It's easy to add new sensors. Let me know if you need the modified file to use the hcsr04 sensor.
I would like to use mqtt-io but I do not have the python skills to find where is the problem with the hcsr04 sensor.