flyte / mqtt-io

Expose GPIO modules (Raspberry Pi, Beaglebone, PCF8754, PiFace2 etc.) and digital sensors (LM75 etc.) to an MQTT server for remote control and monitoring.
MIT License
465 stars 157 forks source link

hcsr04 config validation issue #266

Open techadrian opened 2 years ago

techadrian commented 2 years ago

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:

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 main() File "/home/mqtt_io/mqtt_io/main.py", line 104, in main mqtt_gpio.run() File "/home/mqtt_io/mqtt_io/server.py", line 1229, in run self._init_sensor_modules() File "/home/mqtt_io/mqtt_io/server.py", line 255, in _init_sensor_modules self.sensor_modules[sens_config["name"]] = _init_module( File "/home/mqtt_io/mqtt_io/server.py", line 122, in _init_module module_config = validate_and_normalise_config(module_config, module_schema) File "/home/mqtt_io/mqtt_io/config/init.py", line 105, in validate_and_normalise_config raise ConfigValidationFailed( mqtt_io.exceptions.ConfigValidationFailed: Config did not validate: burst:

All my other sensors run just fine :(

techadrian commented 2 years ago

Nobody ? Nothing ?

geccko commented 2 years ago

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 main() File "/home/pi/.local/lib/python3.9/site-packages/mqtt_io/main.py", line 80, in main mqtt_gpio.run() File "/home/pi/.local/lib/python3.9/site-packages/mqtt_io/server.py", line 1229, in run self._init_sensor_modules() File "/home/pi/.local/lib/python3.9/site-packages/mqtt_io/server.py", line 255, in _init_sensor_modules self.sensor_modules[sens_config["name"]] = _init_module( File "/home/pi/.local/lib/python3.9/site-packages/mqtt_io/server.py", line 122, in _init_module module_config = validate_and_normalise_config(module_config, module_schema) File "/home/pi/.local/lib/python3.9/site-packages/mqtt_io/config/init.py", line 105, in validate_and_normalise_config raise ConfigValidationFailed( mqtt_io.exceptions.ConfigValidationFailed: Config did not validate: burst:

thanks!

geccko commented 2 years ago

@techadrian did you solved your problem ?

techadrian commented 2 years ago

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 ....

geccko commented 2 years ago

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

techadrian commented 2 years ago

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 :)

geccko commented 2 years ago

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.