Hello everyone! I'm currently working on a project using a DHT11 sensor to measure temperatures on a Raspberry Pi (model 3 B v1.2).
Initially, I tried installing the Adafruit DHT library, but I ran into some issues. I found out that Adafruit recommends using a virtual environment (venv) for installation. The problem is that once I’ve set everything up and the Pi is placed in a hard-to-access location, I won’t be able to activate the virtual environment easily.
When I tried installing the library with --break-system-packages to bypass using venv, I ran into two issues:
The library couldn’t recognize it was on a Raspberry Pi, which I managed to solve.
After fixing that, I received an error saying the DHT sensor wasn’t found (suggesting a wiring check), although the sensor works correctly on an Arduino.
I also tried using a method with pigpio, which did give me a reading from the sensor. However, it has a similar limitation: I would need to activate pigpiod each time, which isn’t practical since I won’t have easy access to the Pi after it’s in place.
Goal:
I want to run a script on the Pi that continuously displays temperature readings from the DHT11 sensor without needing to activate virtual environments or pigpiod. Ideally, I’d like it to start automatically with the Pi and operate independently.
I’m new to all this, so if there’s any additional information needed to help troubleshoot, please let me know!
Initially, I tried installing the Adafruit DHT library, but I ran into some issues. I found out that Adafruit recommends using a virtual environment (venv) for installation. The problem is that once I’ve set everything up and the Pi is placed in a hard-to-access location, I won’t be able to activate the virtual environment easily.
When I tried installing the library with --break-system-packages to bypass using venv, I ran into two issues:
The library couldn’t recognize it was on a Raspberry Pi, which I managed to solve.
After fixing that, I received an error saying the DHT sensor wasn’t found (suggesting a wiring check), although the sensor works correctly on an Arduino.
I also tried using a method with pigpio, which did give me a reading from the sensor. However, it has a similar limitation: I would need to activate pigpiod each time, which isn’t practical since I won’t have easy access to the Pi after it’s in place.
Goal:
I want to run a script on the Pi that continuously displays temperature readings from the DHT11 sensor without needing to activate virtual environments or pigpiod. Ideally, I’d like it to start automatically with the Pi and operate independently.
I’m new to all this, so if there’s any additional information needed to help troubleshoot, please let me know!
Statistics: Posted by logic12500 — Tue Nov 05, 2024 3:33 am — Replies 2 — Views 44