szazo / dht11_python Goto Github PK
View Code? Open in Web Editor NEWPure Python library for reading DHT11 sensor on Raspberry Pi
License: MIT License
Pure Python library for reading DHT11 sensor on Raspberry Pi
License: MIT License
When I execute the given program, I am getting
Temperature: 0 C
Humidity: 1 %
Hello,
thank you for your great work on this projekt but is it possible to make it compatible with windows IoT? I tried to exchange the import form "import RPi.GPIO as GPIO" to "import _wingpio as GPIO" but I only get error 1.
You should make this a pip installable package, rpi-dht11
.
I can make a pull request if you'd be willing to manage the pypi project.
I have installed the package, but the error code 1, which is the ERR_MISSING_DATA code constantly throws. Any ideas?
Installing on Pi Zero V1.1
Setup.py returned error in line 15:
NameError: name 'setuptools' is not defined.
I think this is because you imported 'find_packages' as a separate module (using 'from setuptools import...') but in line 15 you try to call it with setuptools.find_packages(). I deleted 'setuptools.' from this line and it solved the error.
However, it failed later with a 'Permission denied' error. This was solved by running the install command as sudo.
I had the following issue when using the package in a loop:
File "/home/pi/Workspace/miwebsitebot/modulos/dht11/__init__.py", line 34, in read
RPi.GPIO.setup(self.__pin, RPi.GPIO.OUT)
RuntimeError: Please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM)
Solved changing __init__.py. Just add after line 31 the initialization mode. It will result like this:
30 def __init__(self, pin):
31 self.__pin = pin
32 RPi.GPIO.setmode(RPi.GPIO.BCM)
Hi,
I am Naohiko Yamaguchi from Japan.
Perhaps, this program can't return correct temperature data when sub-zero temperature.
Current code for calculate Temperature/Humidity is below.
temperature = the_bytes[2] + float(the_bytes[3]) / 10
humidity = the_bytes[0] + float(the_bytes[1]) / 10
DHT11 will return 1 in MSB of the_bytes[3] when sub-zero temperature.
However, current code is not support this specific.
Otherwise, am I wrong?
pi@raspberrypi:~ $ python dht11.py
Traceback (most recent call last):
File "dht11.py", line 2, in
import dht11
File "/home/pi/dht11.py", line 12, in
instance = dht11.DHT11(pin=14)
AttributeError: 'module' object has no attribute 'DHT11'
This repo lacks a __init__.py
so it cannot be imported as a package if another project includes this as a submodule. Would it be possible to add an empty __init__.py
file to fix this?
Hi szazo,
I'm a beginner programmer and have a raspberry pi3. I'm at 16.
I bought a DHT11 sensor. I wanted to work by its with python, but there wasn't a good source.
Then I find you in a raspberrypi topic.
Thanks a lot because of this module.
Please see my page on github https://github.com/mohsen8156 and share your ideas about my projects.
Thanks. :)
Thanks for your work on this project. Would it be possible to add an open source license so that others can include this into their project legally? An open license such as Apache2 or MIT would be great.
See Github's help page:
https://help.github.com/articles/open-source-licensing/
tl;dr - It mainly consists of picking a license and putting the text in a LICENSE.md file of your repo.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.