-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DHT22 Adafruit_DHT problem #357
Comments
I guess you get the same error as above, when mqtt tries to install packages... are you in a virtual environment? did you forget to source it? Or is something broken on your PI? The error tells you, that you install a package systemwide in an environment (venv?) and it warns you, if you really want to do this. After that, mqtt is also not able to install packages. So i guess, the error is somewhere in the python setup and not mqtt related. What distro/version have you installed on your new rpi? May you try with an older release? |
same issue here on a raspberry pi using docker. I'm using a docker compose file: name: mqttio
services:
mqtt-gpio:
tty: true
stdin_open: true
volumes:
- /etc/mqttio/mqttio-config.yaml:/config.yml
privileged: true
image: flyte/mqtt-gpio:armv7l my config.yml looks like this: mqtt:
host: 192.168.178.95
topic_prefix: pflanzen/sensoren # change this as you see fit, I like [room]/[device]
status_payload_running: available
status_payload_stopped: unavailable
status_payload_dead: unavailable
sensor_modules:
- name: dht22_sensor
module: dht22
type: dht22
pin: 2 # this may change if you add additional sensors or don't use pin 4 from above
sensor_inputs:
- name: pflanzen_temperature
module: dht22_sensor
digits: 2
interval: 5
type: temperature
- name: pflanzen_humidity
module: dht22_sensor
digits: 2
interval: 5
type: humidity
|
|
I am setting up mqtt-io on a new RPi. Previously this has been very simple and works well. Thank you! I'm hoping someone might be able to offer a solution for my current issue.
Previously, I followed instructions and downloaded the repo, then from the repo folder I ran:
python -m pip install .
The latest version suggests usingpip3 install mqtt-io
instead. However, this gives an error:I settled on using the below which seems to work around the install issues:
The install seems to work until I add a DHT22 sensor (working fine on earlier installs) when I see the following:
2024-03-13 03:24:17 mqtt_io.main [ERROR ] MqttIo crashed!
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/modules/init.py", line 51, in install_missing_module_requirements
install_missing_requirements(pkgs_required)
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/modules/init.py", line 22, in install_missing_requirements
check_call([sys.executable, "-m", "pip", "install"] + pkgs_required)
File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', '-m', 'pip', 'install', 'Adafruit_DHT']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/main.py", line 107, in main
mqtt_gpio.run()
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/server.py", line 1450, in run
self._init_sensor_modules()
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/server.py", line 284, in _init_sensor_modules
self.sensor_modules[sens_config["name"]] = _init_module(
^^^^^^^^^^^^^
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/server.py", line 127, in _init_module
install_missing_module_requirements(module)
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/modules/init.py", line 53, in install_missing_module_requirements
raise CannotInstallModuleRequirements(
mqtt_io.exceptions.CannotInstallModuleRequirements: Unable to install packages for module <module 'mqtt_io.modules.sensor.dht22' from '/home/pi/.local/lib/python3.11/site-packages/mqtt_io/modules/sensor/dht22.py'> (['Adafruit_DHT']): Command '['/usr/bin/python', '-m', 'pip', 'install', 'Adafruit_DHT']' returned non-zero exit status 1.
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/modules/init.py", line 51, in install_missing_module_requirements
install_missing_requirements(pkgs_required)
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/modules/init.py", line 22, in install_missing_requirements
check_call([sys.executable, "-m", "pip", "install"] + pkgs_required)
File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', '-m', 'pip', 'install', 'Adafruit_DHT']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/main.py", line 115, in
main()
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/main.py", line 107, in main
mqtt_gpio.run()
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/server.py", line 1450, in run
self._init_sensor_modules()
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/server.py", line 284, in _init_sensor_modules
self.sensor_modules[sens_config["name"]] = _init_module(
^^^^^^^^^^^^^
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/server.py", line 127, in _init_module
install_missing_module_requirements(module)
File "/home/pi/.local/lib/python3.11/site-packages/mqtt_io/modules/init.py", line 53, in install_missing_module_requirements
raise CannotInstallModuleRequirements(
mqtt_io.exceptions.CannotInstallModuleRequirements: Unable to install packages for module <module 'mqtt_io.modules.sensor.dht22' from '/home/pi/.local/lib/python3.11/site-packages/mqtt_io/modules/sensor/dht22.py'> (['Adafruit_DHT']): Command '['/usr/bin/python', '-m', 'pip', 'install', 'Adafruit_DHT']' returned non-zero exit status 1.
The text was updated successfully, but these errors were encountered: