I am trying to wire a DHT11 temperature/humidity sensor to interface with the enclosure plugin. I am following this walk through https://awesomeopensource.com/project/vitormhenrique/OctoPrint-Enclosure and have run into an issue installing the packages need. This is the terminal inputs which have been used.
cd ~
git clone https:// github.com/adafruit/Adafruit_Python_DHT .git (remove the spaces. put there to remove hyperlink)
cd Adafruit_Python_DHT
sudo apt-get update
sudo apt-get install build-essential python-dev python-openssl
sudo python setup.py install
All scripts run expect "sudo python setup.py install". At this step I receive this error:
Traceback (most recent call last):
File "setup.py", line 1, in
from setuptools import setup, find_packages, Extension
ImportError: No module named setuptools
What did you already try to solve it?
I have tried testing the file path which appears to be valid. I have restarted the process of installing the packages. I have rebooted the system.
Have you tried running in safe mode?
No.
Did running in safe mode solve the problem?
WRITE HERE
Systeminfo Bundle
You can download this in OctoPrint's System Information dialog ... no bundle, no support!)
I followed that tutorial and I am still unable to get values through OctoPrint Enclosure Plugin or terminal. The libraries/packages installed without error. The sensor has a led which is on so the unit is receiving power and ground. In respect to plugin setup, do I specify the physical PIN number or the GPIO PIN number? The plugin dose not specify. I have tried both without success.
Ahh if you were using an DS18B20 it would autodetect them and show under predefined. I will have to try and setup a DHT11 later today. I would highly recommend a DS18B20 - they are a lot more rpi friendly and supported directly in the hardware.
Hi There. I case of a not well working Enclosure Pluginat the moment i found my own solution working with a DHT22 and the TopTemp Plugin. Thank you for this great job .
I just modified AdafruitDHT.py
Edit the following Line:
print('Temp={0:0.1f}* Humidity={1:0.1f}%'.format(temperature, humidity)) to: print ('{0:0.1f}'.format(temperature))
so vou will get a Value only. Working great. You can get the Humidity by doing a renamed copy of AdafruitDHT.py as well with: print ('{0:0.1f}'.format(humidity))
In the Plugin you can call them with:
/home/pi/Adafruit_Python_DHT/examples/AdafruitDHT.py 22 4
eg. /home/pi/Adafruit_Python_DHT/examples/AdafruitDHT**(copy)**.py 22 4
best regards Michel
Just to include, there is a relatively* easy way using "device tree overlays" to include support for both types of sensor at the linux level, which can then be read with cat
I also ran into the Problem with old Libaries, after upgrading to octoPi 1.0.0.0 RC3 and here ist, how I brought my DT22 back to life:
First, IΒ΄ve written a dht_v1.py :
#!/usr/bin/python3
# SPDX-License-Identifier:
#import time
import board
import adafruit_dht
# Initial the dht device, with data pin connected to:
dhtDevice = adafruit_dht.DHT22(board.D3, use_pulseio=False)
# you can pass DHT22 use_pulseio=False if you wouldn't like to use pulseio.
# This may be necessary on a Linux single board computer like the Raspberry Pi,
# but it will not work in CircuitPython.
# dhtDevice = adafruit_dht.DHT22(board.D18, use_pulseio=False)
temperature_c = dhtDevice.temperature
humidity = dhtDevice.humidity
print(
"Temp: {:.1f} *C Humidity: {}% ".format(
temperature_c, humidity
)
)
quit(0)
Now, you can call this Script in Top Temp as a customer script like this: