Git Product home page Git Product logo

adafruit_circuitpython_dht's Introduction

Introduction

Documentation Status

Discord

Build Status

Code Style: Black

CircuitPython support for the DHT11 and DHT22 temperature and humidity devices.

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Note

This library uses the pulseio module in CircuitPython. As of CircuitPython 7.0.0, pulseio is no longer available on the smallest CircuitPython builds, such as the Trinket M0, Gemma M0, and Feather M0 Basic boards. You can substitute a more modern sensor, which will work better as well. See the guide Modern Replacements for DHT11 and DHT22 Sensors for suggestions.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-dht

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-dht

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-dht

Usage Example

Hardware Set-up

Designed specifically to work with the Adafruit DHT series sensors:

Note

DHT11 and DHT22 devices both need a pull-resistor on the data signal wire. This resistor is in the range of 1k to 5k

  • Please check the device datasheet for the appropriate value.
  • Be sure that you are running the Buster Operating System.
  • Make sure that your user is part of the gpio group.

Known Issues

  • The library may or may not work in Linux 64-bit platforms.
  • The Raspberry PI Zero does not provide reliable readings.
  • Readings in FeatherS2 does not work as expected.

Note

Using a more modern sensor will avoid these issues. See the guide Modern Replacements for DHT11 and DHT22 Sensors.

Basics

Of course, you must import the library to use it:

import adafruit_dht

The DHT type devices use single data wire, so import the board pin

from board import <pin>

Now, to initialize the DHT11 device:

dht_device = adafruit_dht.DHT11(<pin>)

OR initialize the DHT22 device:

dht_device = adafruit_dht.DHT22(<pin>)

Read temperature and humidity

Now get the temperature and humidity values

temperature = dht_device.temperature
humidity = dht_device.humidity

These properties may raise an exception if a problem occurs. You should use try/raise logic and catch RuntimeError and then retry getting the values after at least 2 seconds. If you try again to get a result within 2 seconds, cached values are returned.

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

adafruit_circuitpython_dht's People

Contributors

brennen avatar dhalbert avatar evaherrada avatar foamyguy avatar jerryneedell avatar jposada202020 avatar kattni avatar ladyada avatar makermelissa avatar michaellass avatar mrmcwethy avatar neradoc avatar semancik avatar siddacious avatar sommersoft avatar tannewt avatar tdicola avatar tekktrik avatar thekitty avatar tylercrumpton avatar xgqfrms avatar yeyeto2788 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_circuitpython_dht's Issues

Unable to read DHT11 sensor

Hello, I am getting the following error when I try to create a DHT11 sensor instance in my Raspberry Pi Zero W with Raspbian Stretch:
image
I checked my circuit wiring and it is ok. I have tried to install (and reinstall) libgpiod as said in this link, rebooted the board, tried to run the code again but it did not work.

FileNotFoundError: (...) /usr/local/lib/python3.8/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein

I am running Ubuntu Server 20.04 LTS 64-bit on a Raspberry Pi 3 B. I have a DHT11 sensor module.

I am following the instructions from https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/python-setup but the code does not work for me.

I have successfully executed these commands beforehand:

sudo apt-get install libgpiod2
sudo pip3 install adafruit-circuitpython-dht

This is my code:

# ky015.py
import time
import board
import adafruit_dht

# Initial the dht device, with data pin connected to:
dhtDevice = adafruit_dht.DHT11(board.D3)

while True:
    try:
        # Print the values to the serial port
        temperature_c = dhtDevice.temperature
        temperature_f = temperature_c * (9 / 5) + 32
        humidity = dhtDevice.humidity
        print(
            "Temp: {:.1f} F / {:.1f} C    Humidity: {}% ".format(
                temperature_f, temperature_c, humidity
            )
        )

    except RuntimeError as error:
        # Errors happen fairly often, DHT's are hard to read, just keep going
        print(error.args[0])

    time.sleep(2.0)

This is the error I get:

ubuntu@ubuntu:~/ky015$ sudo python3 ky015.py
Traceback (most recent call last):
  File "ky015.py", line 6, in <module>
    dhtDevice = adafruit_dht.DHT11(board.D3)
  File "/usr/local/lib/python3.8/dist-packages/adafruit_dht.py", line 263, in __init__
    super().__init__(True, pin, 18000)
  File "/usr/local/lib/python3.8/dist-packages/adafruit_dht.py", line 69, in __init__
    self.pulse_in = PulseIn(self._pin, 81, True)
  File "/usr/local/lib/python3.8/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 65, in __init__
    self._process = subprocess.Popen(cmd)
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein'

I have also followed the instructions for "Setup your Linux Board for using CircuitPython Libraries". The script blinkatest.py completes successfully (Link to code: https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi#blinka-test-3-15). Output:

ubuntu@ubuntu:~/ky015$ sudo python3 blinkatest.py
Hello blinka!
Digital IO ok!
I2C ok!
SPI ok!
done!

The file libgpiod_pulsein does exist. The Python code seems to try and run it with subprocess.Popen. That's strange IMHO since the "lib" prefix does imply that it is a library, not an executable, right? On the other hand, a library should have a suffix of ".so". I am dumbfounded by that file name. By the way, this is ldd output for the file:

ubuntu@ubuntu:/usr/local/lib/python3.8/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio$ ldd libgpiod_pulsein
        not a dynamic executable

This is the stat output:

ubuntu@ubuntu:/usr/local/lib/python3.8/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio$ stat libgpiod_pulsein
  File: libgpiod_pulsein
  Size: 19752           Blocks: 40         IO Block: 4096   regular file
Device: b302h/45826d    Inode: 391704      Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (   50/   staff)
Access: 2020-05-05 10:00:24.194643069 +0000
Modify: 2020-05-05 10:00:10.230685234 +0000
Change: 2020-05-05 10:00:10.990682910 +0000
 Birth: -

I have tried to reinstall the packages, but it did not fix my problem.

DHT22 not working under CP3.0

dht_simpletest yields:

Adafruit CircuitPython 3.0.0-alpha.3-31-g8b6aeb9-dirty on 2018-03-26; Adafruit Feather M0 Express with samd21g18
>>> 
>>> 
>>> import dht_simpletest
('A full buffer was not returned.  Try again.',)
('A full buffer was not returned.  Try again.',)
('A full buffer was not returned.  Try again.',)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "dht_simpletest.py", line 18, in <module>
KeyboardInterrupt: 
>>> 

under CP3.0 alpha
It works ok on 2.2.4.

Solved - DHT11 with raspberry pi 4b - below code with little modification is working

SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries

SPDX-License-Identifier: MIT

import time
#import board
import RPi.GPIO as GPIO
import adafruit_dht

Initial the dht device, with data pin connected to:

#dhtDevice = adafruit_dht.DHT11(board.21)

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.

pin = 21 # this is GPIO21 physical pin no -40
#dhtDevice = adafruit_dht.DHT11(board.yourpin) # this will not work
dhtDevice = adafruit_dht.DHT11(pin)

while True:
try:
# Print the values to the serial port
temperature_c = dhtDevice.temperature
temperature_f = temperature_c * (9 / 5) + 32
humidity = dhtDevice.humidity
print(
"Temp: {:.1f} F / {:.1f} C Humidity: {}% ".format(
temperature_f, temperature_c, humidity
)
)

except RuntimeError as error:
    # Errors happen fairly often, DHT's are hard to read, just keep going
    print(error.args[0])
    time.sleep(2.0)
    continue
except Exception as error:
    dhtDevice.exit()
    raise error

time.sleep(2.0)

----------------------------------------Output -----------------------

pi@raspberrypi:~/IOTstack/Adafruit_CircuitPython_DHT $ sudo python3 dht_simpletest.py
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%

bcm283x pulseio _mq.receive stuck after SIGINT(CTRL-C)

I'm not sure if it's DHT or pulseio fault but sometimes when using CTRL-C(with custom signal handler) program gets stuck on self._mq.receive(block=True, type=type) line in bcm283x/pulseio/PulseIn.py file, ps prints: libgpiod_pulsei <defunct> and sometimes before getting stuck it prints line of numbers e.g.
73, 51, 75, 50, 75, 53, 26, 53, 26, 51, 73, 52, 73, 53, 26, 53, 26, 53, 26, 51, 27, 52, 26, 53, 26, 53, 26, 53, 26, 51, 28, 51, 73, 52, 73, 53, 73, 52, 73, 51, 74, 52, 73, 53, 73, 54, 26, 51, 74, 52, 73, 51, 75, 53, 26, 52, 27, 51, 73, 53, 26, 51, 75, 53.

Python version: Python 3.9.2
OS: Raspbian GNU/Linux 11 (bullseye)
Kernel: Linux 5.15.61-v7+
Architecture: armv7l
Hardware: Raspberry Pi 3 Model B V1.2
DHT22: ASAIR AM2302 SNE1222402511-J

Thread stacktrace:

<RepeatTimer(Thread-1, started 1985381440)>
  File "/usr/lib/python3.9/threading.py", line 912, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/home/iwans/repozytorium_github/sensors-and-screen-controller/dht_bug.py", line 16, in run
    self.function(*self.args, **self.kwargs)
  File "/home/iwans/repozytorium_github/sensors-and-screen-controller/dht_bug.py", line 27, in print_data
    humidity = dht.humidity
  File "/home/iwans/repozytorium_github/.venv/lib/python3.9/site-packages/adafruit_dht.py", line 284, in humidity
    self.measure()
  File "/home/iwans/repozytorium_github/.venv/lib/python3.9/site-packages/adafruit_dht.py", line 219, in measure
    pulses = self._get_pulses_pulseio()
  File "/home/iwans/repozytorium_github/.venv/lib/python3.9/site-packages/adafruit_dht.py", line 148, in _get_pulses_pulseio
    while self.pulse_in:
  File "/home/iwans/repozytorium_github/.venv/lib/python3.9/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 168, in __len__
    message = self._wait_receive_msg()
  File "/home/iwans/repozytorium_github/.venv/lib/python3.9/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 104, in _wait_receive_msg
    message = self._mq.receive(block=True, type=type)

Installed adafruit packages:

Adafruit-Blinka==8.19.0
adafruit-circuitpython-busdevice==5.2.4
adafruit-circuitpython-dht==4.0.0
adafruit-circuitpython-requests==1.13.2
adafruit-circuitpython-typing==1.9.2
Adafruit-PlatformDetect==3.46.0
Adafruit-PureIO==1.1.10
pyftdi==0.54.0
pyserial==3.5
pyusb==1.2.1
rpi-ws281x==4.3.4
RPi.GPIO==0.7.1
sysv-ipc==1.1.0
typing-extensions==4.5.0

Minimal code to replicate problem(stacktrace is from different code run on another thread so I can detect when it hangs and print stacktrace).
Run code, press CTRL-C and after a while(couple seconds) program should hang.

import signal
import time
import board
from adafruit_dht import DHT22

if __name__ == "__main__":
    dht = DHT22(board.D4)
    def sigint_handler(_1, _2):
        pass
    signal.signal(signal.SIGINT, sigint_handler)

    while True:
        try:
            print(f"{dht.humidity=}, {dht.temperature=}")
        except:
            pass
        time.sleep(0.2)

DHT (DHT11) not working on FeatherS2 board

I am unable to read DHT11 sensor on ESP32S2. Following similar procedure from issue 45 I commented out the print statement on the lib.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-rc.0 on 2020-10-16; Metro ESP32S2 with ESP32S2

import dht_simpletest
0 pulses: []
DHT sensor not found, check wiring
0 pulses: []
DHT sensor not found, check wiring
0 pulses: []
DHT sensor not found, check wiring
Traceback (most recent call last):
File "", line 1, in
File "/lib/dht_simpletest.py", line 29, in
KeyboardInterrupt:

Sensor is working and tested in M4 Express.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-rc.2 on 2020-11-12; Adafruit Metro M4 Express with samd51j19

import dht_simpletest
81 pulses: [54, 24, 54, 24, 54, 24, 53, 71, 53, 70, 54, 24, 54, 24, 54, 71, 54, 24, 53, 24, 54, 24, 54, 24, 54, 24, 53, 24, 54, 24, 54, 25, 54, 24, 54, 24, 53, 24, 54, 70, 54, 70, 54, 24, 54, 70, 53, 25, 54, 24, 54, 24, 54, 24, 54, 24, 53, 70, 54, 24, 54, 24, 54, 25, 53, 25, 53, 24, 54, 70, 54, 70, 54, 70, 54, 24, 53, 70, 54, 71, 54]
Temp: 78.8 F / 26.0 C Humidity: 25%
81 pulses: [54, 24, 54, 24, 54, 24, 53, 70, 54, 70, 54, 24, 54, 24, 54, 71, 53, 25, 53, 24, 54, 24, 54, 24, 54, 24, 53, 24, 54, 24, 54, 25, 54, 24, 53, 24, 54, 24, 54, 70, 54, 70, 54, 24, 53, 71, 53, 25, 54, 24, 54, 24, 54, 24, 53, 24, 54, 24, 54, 70, 54, 24, 54, 71, 53, 24, 54, 24, 54, 70, 54, 70, 54, 70, 53, 24, 54, 24, 54, 25, 53]
Temp: 78.8 F / 26.0 C Humidity: 25%
81 pulses: [54, 24, 54, 24, 53, 24, 54, 70, 54, 70, 54, 24, 54, 70, 53, 25, 54, 24, 54, 24, 54, 24, 53, 25, 53, 24, 54, 24, 54, 24, 54, 25, 53, 24, 54, 24, 54, 24, 54, 70, 54, 70, 53, 24, 54, 70, 54, 25, 54, 24, 54, 24, 53, 24, 54, 24, 54, 24, 54, 70, 54, 24, 53, 72, 53, 24, 54, 24, 54, 70, 54, 70, 54, 70, 53, 24, 54, 24, 54, 71, 54]
Temp: 78.8 F / 26.0 C Humidity: 26%
Traceback (most recent call last):
File "", line 1, in
File "/lib/dht_simpletest.py", line 34, in
KeyboardInterrupt:

Offbrand DHT11 Not working

I have an off brand DHT11 module that I got in a variety pack on amazon. I have tried many different configurations and GPIO pins but cannot get it to read.

I keep getting DHT Sensor not found, check wiring

The module has a different pinout order (VCC, Data, GND). I have wired it up properly.

I have tried both 3.3v and 5v

Maybe I am missing a resistor? Although I read the module on a board has a built in resistor.

From other threads I have read it seems like it could be the refresh rate of the data.. I tried changing the 18ms to 01ms as another suggested and it did not fix.

[url=https://ibb.co/VD2XSDy][img]https://i.ibb.co/826F523/2-F25-F8-F5-6-B6-B-4-A7-A-875-E-1-B3-B9-E54-AD47.jpg[/img][/url]

My next approach was to unsolder the sensor itself and wire it up as is with a resistor.

After some time of regular querying (~hours), libgpiod_pulsein starts using 100% CPU and subsequent readings fail

Reported by @darton in #47 (comment) and adafruit/Adafruit_Blinka#210 (comment):

The problem with 100% usage of libgpiod_pulsein CPU on Raspberry Pi with DHT22 still exists.

However, sometimes you have to wait several hours for it to appear and permanently prevent reading data from the DHT22 sensor.

After today's update to the version below, the script runs 8 hours without any problems.

Raspbian GNU/Linux 10 (buster)
Raspberry Pi 3 Model B Plus Rev 1.3
Python 3.7.3
Adafruit-Blinka-5.3.4
Adafruit-PlatformDetect-2.16
Adafruit-PureIO-1.1.5 RPi.GPIO-0.7.0
adafruit-circuitpython-dht-3.5.1
pyftdi-0.51.2 pyserial-3.4 pyusb-1.0.2
rpi-ws281x-4.2.4 sysv-ipc-1.0.1

But after 8 hours, the problem came back.

Unable to set line 4 to input

I'm trying to make a Raspberry Pi 3 REST API that provides temperature and humidity with DHT22. The whole code:

from flask import Flask, jsonify, request
from sds011 import SDS011
from adafruit_dht import DHT22
import board
import os
import time

app = Flask(__name__)
dht = DHT22(board.D4)

def get_dht_data():
    while True:
        try:
            temperature, humidity = dht.temperature, dht.humidity
            print(temperature, humidity)
            if temperature is not None and humidity is not None:
                return temperature, humidity
            else:
                raise
        except:
            time.sleep(0.5)

@app.route('/', methods=['GET'])
def status():
    temperature, humidity = get_dht_data()

    return jsonify({
        'temperature': temperature,
        'humidity': humidity
    })

if __name__ == '__main__':
    app.run(debug=True)

However, when I start server, it shows message

Unable to set line 4 to input

and temperature and humidity is always None. If I don't run flask app but just DHT code, it works.

libgpiod_pulsein is armhf 32-bits, doesn't work on 64-bits OS

I'm running Ubuntu 20.04/Raspberry Pi OS 10 64-bits on my RPi 4B, and the libgpiod_pulsein library shipped with adrafruit_blinka Python package is 32-bits.

$ file ~/.local/lib/python3.8/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein
/home/ubuntu/.local/lib/python3.8/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=356bb870cf3f5a35b0862d12a708b782a9c365f6, not stripped

So basically I had to recompile the library for arm64 architecture, here are the steps:

$ sudo apt install libgpiod-dev git build-essential
$ git clone https://github.com/adafruit/libgpiod_pulsein.git
$ cd libgpiod_pulsein/src
$ make
$ cp libgpiod_pulsein ~/.local/lib/python3.8/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein

PulseIO NotImplemented Error raised

Hey guys!

I have installed blinka plus this library (as editable) in order to make some changes for the issue #32 and as @ladyada suggested on this PR in blinka but now I'm getting this error:

Traceback (most recent call last):
  File "a.py", line 3, in <module>
    import adafruit_dht
  File "/home/yeyeto2788/workspace/dht_implementation/venv/src/adafruit-circuitpython-dht/adafruit_dht.py", line 38, in <module>
    from pulseio import PulseIn
  File "/home/yeyeto2788/workspace/dht_implementation/venv/lib/python3.8/site-packages/pulseio.py", line 34, in <module>
    raise NotImplementedError("pulseio not supported for this board.")
NotImplementedError: pulseio not supported for this board.

In the past I did not experience this issue before but even setting the argument use_pulseio does not get properly passed to it.

Script used:

import time
import board
import adafruit_dht
dhtDevice = adafruit_dht.DHT11(board.PG7, use_pulseio=False)

for try_number in range(1,11):
  print(f"Try number {try_number}")
  try:
    print(f"Got temp of: {dhtDevice.temperature}")
    print(f"And hum of: {dhtDevice.humidity}")
  except RuntimeError as e:
    print(e)
    time.sleep(2)
  else:
    time.sleep(2)
  print("\n")

Debug info:

  • Libraries:

    Adafruit-Blinka==5.9.1
    -e 
    git://github.com/yeyeto2788/Adafruit_CircuitPython_DHT.git@85a8f329346c074f6a0be132077269e62a19b89e#egg=adafruit_c

    NOTE: the dht library is just a fork done today with no changes on it.

  • Python version (Python 3.8.5)

  • Board Orange Pi lite.

problems reading from sparkfun nrf52840 mini

I have been getting the following error with a sparfun nrf52840 mini board


Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.0-128-g347fbb652 on 2019-08-03; SparkFun Pro nRF52840 Mini with nRF52840
>>> 
>>> 
>>> import board
>>> import adafruit_dht
>>> dht=adafruit_dht.DHT22(board.A4)
>>> dht.temperature
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_dht.py", line 227, in temperature
  File "adafruit_dht.py", line 216, in measure
RuntimeError: A full buffer was not returned.  Try again.
>>> 

the same code works OK on a feather_nrf52840_express or a metro_m4_airlift board

De-initializing self.pulse_in

I am trying to use a raspberry pi 4 to capture and store values taken from a DHT22 sensor and I get these errors whenever I try to connect it in properly:

DHT sensor not found, check wiring
#this is when I connect my DH22 sensor
De-initializing self.pulse_in
De-initializing self.pulse_in
Traceback (most recent call last):
  File "/home/pi/humidity.py", line 26, in <module>
    temperature_c = dhtDevice.temperature
  File "/home/pi/.local/lib/python3.9/site-packages/adafruit_dht.py", line 274, in temperature
    self.measure()
  File "/home/pi/.local/lib/python3.9/site-packages/adafruit_dht.py", line 219, in measure
    pulses = self._get_pulses_pulseio()
  File "/home/pi/.local/lib/python3.9/site-packages/adafruit_dht.py", line 141, in _get_pulses_pulseio
    self.pulse_in.clear()
  File "/home/pi/.local/lib/python3.9/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 150, in clear
    self._mq.send("c", True, type=1)
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/humidity.py", line 44, in <module>
    dhtDevice.exit()
  File "/home/pi/.local/lib/python3.9/site-packages/adafruit_dht.py", line 93, in exit
    self.pulse_in.deinit()
  File "/home/pi/.local/lib/python3.9/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 111, in deinit
    procs.remove(self._process)
ValueError: list.remove(x): x not in list

Can anyone make any sense of this?

My code is as follows:

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

import time
import datetime
import board
import adafruit_dht

# Initial the dht device, with data pin connected to:
dhtDevice = adafruit_dht.DHT22(board.D4)

e = datetime.datetime.now()
date = "%s-%s-%s" % (e.day, e.month, e.year)
t = time.localtime()
current_time = time.strftime("%H%M%S", t)
file = open('humidityValues'+ date + '_' + current_time +'.txt', 'w')

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

while True:
    try:
        # Print the values to the serial port
        temperature_c = dhtDevice.temperature
        temperature_f = temperature_c * (9 / 5) + 32
        humidity = dhtDevice.humidity
        t = time.local
        current_time = time.strftime("%H:%M:%S", t)
        temperature_c = dhtDevice.temperature
        temperature_f = temperature_c * (9 / 5) + 32
        humidity = dhtDevice.humidity
        str = "time=" + current_time + "   temp={0:0.1f}ºC   humidity={1:0.1f}%".format(temperature_c, humidity)
        print(str)
        file.write(str + "\n")

    except RuntimeError as error:
        # Errors happen fairly often, DHT's are hard to read, just keep going
        print(error.args[0])
        time.sleep(2.0)
        continue
    except Exception as error:
        dhtDevice.exit()
        #raise error

    time.sleep(2.0)

I tried to remedy the problem with this:

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

import time
import datetime
import board
import adafruit_dht

# Initial the dht device, with data pin connected to:
dhtDevice = adafruit_dht.DHT22(board.D4)

e = datetime.datetime.now()
date = "%s-%s-%s" % (e.day, e.month, e.year)
t = time.localtime()
current_time = time.strftime("%H%M%S", t)
file = open('humidityValues'+ date + '_' + current_time +'.txt', 'w')

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

while True:
    try:
        # Print the values to the serial port
        temperature_c = dhtDevice.temperature
        temperature_f = temperature_c * (9 / 5) + 32
        humidity = dhtDevice.humidity
        t = time.local
        current_time = time.strftime("%H:%M:%S", t)
        temperature_c = dhtDevice.temperature
        temperature_f = temperature_c * (9 / 5) + 32
        humidity = dhtDevice.humidity
        str = "time=" + current_time + "   temp={0:0.1f}ºC   humidity={1:0.1f}%".format(temperature_c, humidity)
        print(str)
        file.write(str + "\n")

    except RuntimeError as error:
        # Errors happen fairly often, DHT's are hard to read, just keep going
        print(error.args[0])
        time.sleep(2.0)
        continue
    except Exception as error:
        dhtDevice.exit()
        #raise error

    time.sleep(2.0)

But, all I get are things like:
Checksum did not validate. Try again.
A full buffer was not returned. Try again.

NOTICE: I am in no way passing the code above off as my own purely.

What GPIO pin to use for Pi zero 2

Hi,

I'm got a DHT11 sensor and am confused about the (board.D2) or whatever "data pin" is here, how do I know what gpio pin to set?

import time
import board
import adafruit_dht

dhtDevice = adafruit_dht.DHT11(board.PG6)

How set GPIO Pin for DHT22 over ENV Variable?

Hello,

i use the example file dht_simpletest.py and replace D18 with D4 for use on Raspberry Pi 3.

But now I would like to set the pin over an enviroment variable. I add this to the script:

import os

DHT_DATA_PIN = int(os.environ.get('GPIO_PIN_DHT22', 4))

But now I have problem to replace the number 4 in this line:

dhtDevice = adafruit_dht.DHT22(board.D4)

This:

dhtDevice = adafruit_dht.DHT22(DHT_DATA_PIN)
# or
dhtDevice = adafruit_dht.DHT22(4)

works local on Raspberry, but not in Docker Container... error: self._pin = Pin(pin.id) AttributeError: 'int' object has no attribute 'id'. So i think i must use it with "board".

Can anyone help or have an idea? :-)

(My complete Code if it helps.)

ValueError: Object has been deinitialized and can no longer be used.

I'm relatively new to circuitpython, only started yesterday so apologies for any mistake I've made here.

Device: Teensy 4.0
DHT22 connected to pin D15
Powered from 3v3
PULL up resistor on data pin, actually the same circuit I've used successfully on other devices, just moved to the teensy 4.0
Coding on a macbook pro using Mu 1.0.3
adafruit_dht library copied to /lib from the latest library download: adafruit-circuitpython-bundle-5.x-mpy-20200417
No other modules in the lib folder

Code:

import board
import time
import adafruit_dht

print('Initialising...')
dht_device = adafruit_dht.DHT22(board.D15)
time.sleep(2)
print(dht_device)

while True:
    temperature = dht_device.temperature
    humidity = dht_device.humidity
    print(str(temperature))
    print(str(humidity))
    time.sleep(2)

Full serial output:

code.py output:
Initialising...
<DHT22 object at 20209020>
Traceback (most recent call last):
File "code.py", line 12, in
File "adafruit_dht.py", line 242, in temperature
File "adafruit_dht.py", line 187, in measure
File "adafruit_dht.py", line 117, in _get_pulses_pulseio
ValueError: Object has been deinitialized and can no longer be used. Create a new object.

DHT22 not working on Raspberry Pi Pico using CircuitPython

Trying to use the DHT22 program on my Raspberry Pi Pico.
I changed the pin to GP1 and let the program autoload into Mu.

I got the following error message:

Traceback (most recent call last):
File "code.py", line 10, in
File "adafruit_dht.py", line 274, in init
File "adafruit_dht.py", line 52, in init
Exception: Bitbanging is not supported when using CircuitPython.

Any help would be appreciated. Thank you in advance!
Greg

Detector fails on Raspi 3b+ (at least)

Many thanks for this Tipp, to use the newer library Adafruit_CircuitPython_DHT. But this one also fails on my raspi 3b+ to detect the correct raspberry variant:

[matzke@rasp3 Adafruit_Blinka-1.3.3-py3.7.egg]$ python Python 3.7.3 (default, Mar 29 2019, 06:12:39) [GCC 8.2.1 20180831] on linux Type "help", "copyright", "credits" or "license" for more information. from adafruit_blinka.agnostic import board_id, detector import sys import adafruit_platformdetect.board as ap_board detector.board.any_raspberry_pi_40_pin False

import platform print(platform.platform()) Linux-5.1.5-1-MANJARO-ARM-aarch64-with-arch

DHT (DHT22) not working on M0 boards

I am unable to read data from a DHT22 sensor on either a feather_m0_express or a fether_m0_rfm9x board -- using the dht_simpletest

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.4.0-beta.1-17-g6ae52ade7-dirty on 2020-06-19; Adafruit Feather M0 Express with samd21g18
>>> import dht_simpletest
A full buffer was not returned. Try again.
A full buffer was not returned. Try again.
DHT sensor not found, check wiring
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "dht_simpletest.py", line 24, in <module>
KeyboardInterrupt: 
>>> 

I am able to use it with a grandcentral_m4_espress

I enabled the commented out print statement in the lib to see the returned pulses.
Clearly something not working....

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.4.0-beta.1-17-g6ae52ade7-dirty on 2020-06-19; Adafruit Feather M0 Express with samd21g18
>>> 
>>> import dht_simpletest
9 pulses: [392, 592, 492, 733, 548, 226, 506, 396, 366]
DHT sensor not found, check wiring
10 pulses: [378, 565, 375, 341, 565, 533, 733, 380, 183, 196]
A full buffer was not returned. Try again.
10 pulses: [378, 565, 375, 340, 565, 533, 732, 380, 183, 196]
A full buffer was not returned. Try again.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "dht_simpletest.py", line 24, in <module>
KeyboardInterrupt: 
>>> 

DHT sensor not found check wiring

image
I have this DHT22 sensor on a board with a 5k resistor between VCC and data line and a capacitor connected to ground. It's connected to my Raspberry Pi 4B. It worked previously with the deprecated adafruit DHT library but I started getting a Unknown platform issue so I tried moving to the circuitpython library and now I'm getting "DHT sensor not found check wiring" when trying to run the simpletest example code. I've also tried running the following lines of code

import board
import adafruit_dht
dhtDevice = adafruit_dht.DHT22(board.D4, use_pulseio=False)
dhtDevice.temperature

and get the same error. I tried switching VCC from 3.3V to 5V and also checked continuity using a multimeter. I've tried both GPIO 4 and GPIO 18 and changing the python file accordingly and still get nothing. I don't know what to do any more.

DHT reading may be "None" if read too soon after boot

We ra into a strange behavior that some DHT code was failing only after a RESET if loaded as code.py (or main.py) it ran OK via REPL. After much head scraping and false starts it looks like a simple reason.

The code was doing a reading from the dot and checking the value against a limit.

humidity = dht.humidity
if humidity > 50. :
    do something

this failed if dht.humidity returns a None.
Normally it will only return a None if it also throws a Runtime error
But not if time.monotonic() is < .5
In that case, it just silently skips the reading
see
https://github.com/adafruit/Adafruit_CircuitPython_DHT/blob/master/adafruit_dht.py#L141

This check is to make sure readings are not too close together. After one successful read, it will just return the last value read.

One fix would just have the diver always delay the first reading until time.monotonic() > .5
This is only an issue for the first .5 sec after boot

Raspberry Pi 5 - Import error - All GPIO related operation

Script Command

import time
import adafruit_dht
import board

dht_device = adafruit_dht.DHT11(board.D4)

temperature_c = dht_device.temperature
temperature_f = temperature_c * (9 / 5) + 32
humidity = dht_device.humidity
print("Temp:{:.1f} C / {:.1f} C    Humidity: {}%".format(temperature_c, temperature_f, humidity))

Operating System

6.1.0-rpi7-rpi-2712 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux

Hardware

Raspberry Pi 5 Model B

Behavior

`ImportError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/user/development/python/dht11/dht11.py", line 2, in
import adafruit_dht
File "/home/user/development/python/dht11/env/lib/python3.11/site-packages/adafruit_dht.py", line 32, in
from digitalio import DigitalInOut, Pull, Direction
File "/home/user/development/python/dht11/env/lib/python3.11/site-packages/digitalio.py", line 27, in
from adafruit_blinka.microcontroller.bcm2712.pin import *
File "/home/user/development/python/dht11/env/lib/python3.11/site-packages/adafruit_blinka/microcontroller/bcm2712/pin.py", line 5, in
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
File "/home/user/development/python/dht11/env/lib/python3.11/site-packages/adafruit_blinka/microcontroller/generic_linux/libgpiod_pin.py", line 8, in
raise ImportError(
ImportError: libgpiod Python bindings not found, please install and try again! See https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/master/libgpiod.sh`

Description

I want to read data from DHT11 sensor.
(https://pimylifeup.com/raspberry-pi-dht11-sensor/)

I've installed everything on the right way, nevertheless I cannot read any data.

I cannot do any operation on GPIO. Neither sensors nor relays.

Additional information

No response

100% CPU usage because of PulseIO

On my Raspberry Pi, I'm seeing 100% CPU usage from PulseIO.

The code mentions that it's using a continuously running process because "Linux is sluggish"

# We don't use a context because linux-based systems are sluggish
# and we're better off having a running process

However, this sensor is only read once every two seconds, so it seems a bit of sluggishness is in many cases preferable to a continuous 100% CPU usage.

Is using a context something that could be reconsidered? Am I missing something that makes this unworkable?

Unable to set line 18 to input

Hello,
I am using a Raspberry Pi 4 with a DHT11 module and used the code given in the example "simple dht test" while changing it to the pin I am using. The first time running the programs works fine. However, after stopping the program and running again I end up with the same issue where it says "Unable to set line 18 to input". Does anyone know how I can prevent this. apologies if anything was vague I am new to this. Thanks

DHT22 report null after a while

BUG DESCRIPTION
Hello *. I have a problem with my DHT22. After some time (hours, days) I get null values from sensor (sometimes both). So I attached 2 sensors to my raspberry pi via GPIO2, 27.

The results are confusing:
If one sensors show null, one other may keep reporting good values!
Reboot of rpi does not help at all.
Hard reset (Power off / on) of rpi always works.
Power reset (3.3-5V off / on) of a sensor only SOMETIMES works.
Data reset (pull cable and replug) of sensor works almost always.
If data reset (on ONE sensor) works, other null sensor will start reporting good values as well!

TO REPRODUCE
Nothing it happens all time, works after reboot for a minute then it starts to get null more and more null. After some hours or so only null values.

EXPECTED BEHAVIOR
Get both values.

DHT-Blinka fail when using libgpiod

I just wanted to test the DHT22 sensor as in https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/python-setup but first test the functionality of Blinka.

Also I just encountered this using digitalio.DigitalInOut:

In [9]: dhtDevice = adafruit_dht.DHT22(pin)

In [10]: dhtDevice.temperature
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-10-bb6e5b54f869> in <module>()
----> 1 dhtDevice.temperature

/usr/local/lib/python3.7/dist-packages/adafruit_dht.py in temperature(self)
    225             data returned from the device (try again)
    226         """
--> 227         self.measure()
    228         return self._temperature
    229 

/usr/local/lib/python3.7/dist-packages/adafruit_dht.py in measure(self)
    179                 pulses = self._get_pulses_pulseio()
    180             else:
--> 181                 pulses = self._get_pulses_bitbang()
    182             #print(len(pulses), "pulses:", [x for x in pulses])
    183 

/usr/local/lib/python3.7/dist-packages/adafruit_dht.py in _get_pulses_bitbang(self)
    135         """
    136         pulses = array.array('H')
--> 137         with DigitalInOut(self._pin) as dhtpin:
    138             # we will bitbang if no pulsein capability
    139             transitions = []

/usr/local/lib/python3.7/dist-packages/digitalio.py in __init__(self, pin)
     82 
     83     def __init__(self, pin):
---> 84         self._pin = Pin(pin.id)
     85         self.direction = Direction.INPUT
     86 

AttributeError: 'DigitalInOut' object has no attribute 'id'

and using the board.PXX I get this:

In [1]: import board

In [2]: import adafruit_dht

In [3]: dhtDevice = adafruit_dht.DHT22(board.PC4)

In [4]: dhtDevice.temperature
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-4-bb6e5b54f869> in <module>()
----> 1 dhtDevice.temperature

/usr/local/lib/python3.7/dist-packages/adafruit_dht.py in temperature(self)
    225             data returned from the device (try again)
    226         """
--> 227         self.measure()
    228         return self._temperature
    229 

/usr/local/lib/python3.7/dist-packages/adafruit_dht.py in measure(self)
    179                 pulses = self._get_pulses_pulseio()
    180             else:
--> 181                 pulses = self._get_pulses_bitbang()
    182             #print(len(pulses), "pulses:", [x for x in pulses])
    183 

/usr/local/lib/python3.7/dist-packages/adafruit_dht.py in _get_pulses_bitbang(self)
    147             dhtval = True   # start with dht pin true because its pulled up
    148             dhtpin.direction = Direction.INPUT
--> 149             dhtpin.pull = Pull.UP
    150             while time.monotonic() - timestamp < 0.25:
    151                 if dhtval != dhtpin.value:

/usr/local/lib/python3.7/dist-packages/digitalio.py in pull(self, pul)
    137             self.__pull = pul
    138             if pul is Pull.UP:
--> 139                 self._pin.init(mode=Pin.IN, pull=Pin.PULL_UP)
    140             elif pul is Pull.DOWN:
    141                 if hasattr(Pin, "PULL_DOWN"):

/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/libgpiod_pin.py in init(self, mode, pull)
     45                 if pull != None:
     46                     if pull == self.PULL_UP:
---> 47                         raise NotImplementedError("Internal pullups not supported in libgpiod, use physical resistor instead!")
     48                     elif pull == self.PULL_DOWN:
     49                         raise NotImplementedError("Internal pulldowns not supported in libgpiod, use physical resistor instead!")

NotImplementedError: Internal pullups not supported in libgpiod, use physical resistor instead!

Is it possible to set a different pull on pin? Let's say I have already connected the physical resistor on the sensor.

More details:

Python 3.7.3 (default, Apr  3 2019, 05:39:12) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> board.detector.chip.id
'SUN8I'
>>> board.detector.board.id
'ORANGE_PI_PLUS_2E'
>>> 

This relates to: adafruit/Adafruit_Blinka#245

Error: libgpiod.so.2: cannot open shared object file: No such file or directory

Hi,

I'm running the example as demonstrated here: https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/python-setup#

I was using the deprecated library (https://github.com/adafruit/Adafruit_Python_DHT) initially with the exact same setup and it is working. So I'm certain the sensor is working.

I have updated my script to import the new library, made some changes as per example but when I'm running the script I get the following error.

I'm fairly new to python, so any help would be welcome to resolve this.

PS. GPIO_PIN_NR is declared as GPIO_PIN_NR = board.D4 because I have connected the data wire of the DHT11 sensor to GPIO pin 4.

Console output:

(.env) pi@raspberrypi:~/dht-sensor-reader $ python3 temp.py
/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein: error while loading shared libraries: libgpiod.so.2: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "temp.py", line 19, in <module>
    dhtSensor = adafruit_dht.DHT11(GPIO_PIN_NR)
  File "/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_dht.py", line 246, in __init__
    super().__init__(True, pin, 18000)
  File "/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_dht.py", line 66, in __init__
    self.pulse_in = PulseIn(self._pin, 81, True)
  File "/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 64, in __init__
    message = self._wait_receive_msg()
  File "/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 80, in _wait_receive_msg
    raise RuntimeError("Timed out waiting for PulseIn message")
RuntimeError: Timed out waiting for PulseIn message

The full script can be found here:
https://gitlab.com/dht-sensor/dht-sensor-reader/blob/feature/adafruit_lib/temp.py
The DHT11 is instantiated at line 19. The values are read at 62,63

Initialization error?

Please take a look at the following snippet (explanation after it):

(venv) pi@raspberrypi:~/mudpi-core $ python
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import adafruit_dht
>>> dht = None
>>> dht
>>> type(dht)
<class 'NoneType'>
>>> dht = adafruit_dht.DHT11(board.D26)
>>> Unable to set line 26 to input

>>> type(dht)
<class 'adafruit_dht.DHT11'>
>>> dht._use_pulseio
True
>>> dht = adafruit_dht.DHT11(board.D26, use_pulseio=False)
>>> dht._use_pulseio
False
>>> dht.temperature
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/mudpi-core/venv/lib/python3.7/site-packages/adafruit_dht.py", line 243, in temperature
    self.measure()
  File "/home/pi/mudpi-core/venv/lib/python3.7/site-packages/adafruit_dht.py", line 199, in measure
    raise RuntimeError("A full buffer was not returned. Try again.")
RuntimeError: A full buffer was not returned. Try again.
>>>

Expected behavior:
Could not instantiate the DHT object as when setting the use_pluseio to False so behavior is the same and instantiation can be handled the same way.

Issue/Doubt:
Shouldn't the library raise an Exception when (by default) use_pulseio is set to True instead of actually instantiate the DHT11 object?

SBC: Raspberry Pi A+
Libraries:

Adafruit-Blinka==6.4.1
adafruit-circuitpython-dht==3.5.5
Adafruit-PlatformDetect==3.4.1
Adafruit-PureIO==1.1.8

Python: 3.7.3

DHT22 returns value acquired at previous reading, not the current value

Board
Raspberry Pi 3 Model B v1.2

Sensor
DHT22

Context
I run a Python script which reads the temperature and humidity from my DHT22 sensor and stores it in a .csv file.
The script is scheduled as a cronjob to run every 5 minutes.

Problem
I noticed that the value returned by the DHT22 is the value it actually acquired when it took his previous reading.
I know the DHT22 has a sampling rate of 0.5 Hz, which means it can only take a new reading every 2 seconds.
I trigger the script myself and wait more than 2 seconds between runs, so this is not the issue.

My proof for this issue is the following scenario:

  1. I take a reading under normal conditions => humidity level is normal.
  2. I breath directly onto the sensor to increase the humidity. (should spike towards 99.9%)
  3. I take a reading immediately after increasing the humidity => humidity level is normal.
  4. I take another reading, 3 seconds after the previous reading => humidity level spiked to 99.9%

I suspect "reading" a value actually:

  • returns the "cached value" from the previous "reading"
  • takes a new reading and stores this in the "cache"

I also found a topic of 2 people with the same issue:
http://forum.freetronics.com.au/viewtopic.php?f=15&t=6078&sid=a09aaf19f3fd51f2e25896949365c5d8

Issue installing package

Hello,
I am new to this. I am doing college project. I am working on project to get temp and humidity. Not sure where to open the issue, so i opened here.

I installed VM, Raspberry pi desktop. I have DHT_11 sensor, raspberry pi 4 board. When i ran

"sudo pip install Adafruit_DHT" Getting error below.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting Adafruit_DHT
Using cached Adafruit_DHT-1.4.0.tar.gz (15 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: Adafruit_DHT
Building wheel for Adafruit_DHT (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
Could not detect if running on the Raspberry Pi or Beaglebone Black. If this failure is unexpected, you can run again with --force-pi or --force-bbb parameter to force using the Raspberry Pi or Beaglebone Black respectively.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for Adafruit_DHT
Running setup.py clean for Adafruit_DHT
Failed to build Adafruit_DHT
ERROR: Could not build wheels for Adafruit_DHT, which is required to install pyproject.toml-based projects

Reading DHT failing: "Checksum did not validate."

I'm running CircuitPython (adafruit/circuitpython@2933451) on a Wemos D1 Mini, using revision da125e7 of the DHT module. When I run this code:

Adafruit CircuitPython 4.0.0-alpha.1-100-gd8c8406f0 on 2018-10-12; ESP module with ESP8266
>>> import board
>>> import dht
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'dht'
>>> import adafruit_dht
>>> d = adafruit_dht.DHT22(board.GPIO4)
>>> d.measure()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_dht.py", line 178, in measure
RuntimeError: Checksum did not validate. Try again.

If I add a print(pulses) around line 178, I see:

array('H', [67, 71, 64, 76, 53, 79, 55, 79, 55, 79, 55, 79, 55, 79,
56, 78, 59, 26, 63, 22, 63, 71, 63, 22, 59, 30, 56, 25, 63, 71, 63,
25, 65, 22, 58, 27, 62, 22, 63, 22, 64, 21, 59, 26, 63, 22, 63, 22,
63, 26, 63, 23, 64, 20, 59, 26, 63, 22, 63, 22, 59, 27, 62, 22, 67,
22, 63, 22, 59, 26, 63, 22, 63, 22, 59, 26, 63, 23, 62, 22, 54])

This works correctly with upstream micropython v1.9.3 (but fails in
v1.9.4 apparently due to micropython/micropython#4233).

PiP3 Install fails: 'HTMLParser' object has no attribute 'unescape'

I tried to install adafruit-circuitpython-dht via pip3, but it seems to import from an HTMLParser that has not the required function?

`
Collecting adafruit-circuitpython-dht
Using cached adafruit_circuitpython_dht-3.7.8-py3-none-any.whl (7.8 kB)
Collecting Adafruit-Blinka
Using cached Adafruit_Blinka-8.18.1-py3-none-any.whl (289 kB)
Collecting Adafruit-PlatformDetect>=3.13.0
Using cached Adafruit_PlatformDetect-3.45.1-py3-none-any.whl (20 kB)
Collecting Adafruit-PureIO>=1.1.7
Using cached Adafruit_PureIO-1.1.10.tar.gz (28 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

python setup.py egg_info did not run successfully.
exit code: 1

[13 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 14, in
File "/usr/lib/python3/dist-packages/setuptools/init.py", line 20, in
from setuptools.dist import Distribution, Feature
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 35, in
from setuptools.depends import Require
File "/usr/lib/python3/dist-packages/setuptools/depends.py", line 7, in
from .py33compat import Bytecode
File "/usr/lib/python3/dist-packages/setuptools/py33compat.py", line 55, in
unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'HTMLParser' object has no attribute 'unescape'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
`

Environment: Kali Linux on Pi Zero W

DHT does not work with root user using Raspberry Zero WH

I am using a clean Raspberry Pi OS install (version: 2021-03-04-raspbian-buster) on a Raspberry Zero WH. You can download the image or you can check the used install instructions here.

I installed the following two packages: sudo pip3 install adafruit-circuitpython-dht && sudo apt-get install libgpiod2

PoC:

import logging
import adafruit_dht
import time
import board
import digitalio

logger = logging.getLogger('HoneyPi.read_dht')
if __name__ == '__main__':
    try:

        SENSOR_PIN = digitalio.Pin(4) # change GPIO pin
        dht = adafruit_dht.DHT22(SENSOR_PIN, use_pulseio=True)

        timer = 0
        while timer <= 10:
            try:
                temperature = dht.temperature
                temperature_f = temperature * (9 / 5) + 32
                humidity = dht.humidity

                print("Temp: {:.1f} F / {:.1f} °C    Humidity: {}% ".format(temperature_f, temperature, humidity))

                break # break while if it worked
            except RuntimeError as error:
                # Errors happen fairly often, DHT's are hard to read, just keep going
                print(error.args[0])
                time.sleep(2.0)
                timer = timer + 2

            if timer > 10: # end reached
                print("Loop finished. Error.")

    except (KeyboardInterrupt, SystemExit):
       pass

    except RuntimeError as error:
        logger.error("RuntimeError in DHT measurement: " + error.args[0])

    except Exception as e:
       logger.exception("Unhandled Exception in DHT measurement")

(full script)

Console:

pi@HoneyPi:~/HoneyPi/rpi-scripts $ sudo -u root python3 read_dht.py
RuntimeError in DHT measurement: Timed out waiting for PulseIn message. Make sure libgpiod is installed.
pi@HoneyPi:~/HoneyPi/rpi-scripts $ sudo -u pi python3 read_dht.py
Temp: 78.3 F / 25.7 °C    Humidity: 66.2% 

Notes:
yes, root user is part of gpio group (sudo usermod -aG gpio root)

I noticed that I am not the only one affected by this issue:

I have been using the Adafruit_DHT library for a long time but because you stopped fixing issues such as this I've migrated to your new library. Unfortunately it turns out that you do not fix issues for Raspi Zero. What I am supposed to use now? Please fix this issue.

README.md - Retry values after 1/2 seconds returns cached values

Hi there!

Thank you for providing this library :)

README.md states that you should try to get the values again ​​after 1/2 second, if a RuntimeError has occurred. However, the measurement function in your library has the delay_between_readings property, which is set to 2 seconds.
So if you try to read again within 2 seconds, the function does not update the temperature / humidity properties and returns cached values.

I don't know if that's exactly what you wanted to communicate, but for me it was not clear and caused some confusion. If you want a new reading after failure, you have to wait at least 2 seconds. That's totally ok, but maybe you update your readme to clarify this behaviour.

Best Regards,
Stefan

DHT22 reports wrong negative temperatures

First off: it sounds like the bug which has been reported here: #9 but it happend to me with the latest version as well.

I have recently migrated from the old Adafruit lib to this one, because I hoped that the bug which occurred in the old lib as well has been fixed in the new one. Unfortunately it seems as if there is an issue with the new lib in my setup as well.

sudo pip3 install adafruit-circuitpython-dht
sudo apt-get install libgpiod2

Unfortunately I am not really familiar which informtation I might need to provide for this bug report nor I have no clue what I could try next.

Therefore: any help is appreciated :)

Side note: the sensor I have in use does not require a pull up resistor - and I assume that this is correct - as said: all values except negative temperatures are pretty much accurate.

OverflowError in adafruit_dht.py line 137: pulses.append(self.pulse_in.popleft())

Originally reported by @darton in #50 (comment)

Exception in thread <function get_dht_data at 0x766998a0>:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "./rpims.py", line 221, in get_dht_data
    temperature = dhtDevice.temperature
  File "/home/pi/.local/lib/python3.7/site-packages/adafruit_dht.py", line 253, in temperature
    self.measure()
  File "/home/pi/.local/lib/python3.7/site-packages/adafruit_dht.py", line 198, in measure
    pulses = self._get_pulses_pulseio()
  File "/home/pi/.local/lib/python3.7/site-packages/adafruit_dht.py", line 137, in _get_pulses_pulseio
    pulses.append(self.pulse_in.popleft())
OverflowError: unsigned short is greater than maximum

@darton: Was this a one-time error or does it occur regularly? Was your script afterwards able to get valid readings?

My current suspicion:

Proposed fix: Check the value received from self.pulse_in.popleft() and return an empty array in case any of the pulse lengths is out of bounds.

Raspberry Pi 4 + DHT11 Sensor no floating point temps

Hello Adafruit Devs,

I would like to report a problem dealing with DHT11 sensor readings using your library. It seems that the decimals for the temperature are missing. I'm only getting temperatures without decimal precision (it is always 0).

Here is the minimal code to reproduce the issue:

import time
import board
import adafruit_dht

sensor = adafruit_dht.DHT11(board.D17)

while True:
    try:
        temperature = sensor.temperature
        humidity = sensor.humidity
        print(f"Temp: {temperature:.2f} °C, Hum: {humidity:.2f} %")
    except RuntimeError as e:
        print(f"Reading from DHT failure: {e.args[0]}")
        time.sleep(2)
        continue
    except Exception as e:
        sensor.exit()
        raise e
    time.sleep(2)

I'm getting this output always:

Temp: 28.00 °C, Hum: 64.00 %
Temp: 27.00 °C, Hum: 64.00 %
Temp: 28.00 °C, Hum: 64.00 %

DHT11 not working properly

Using version 3.5.8 in a loop it almost never gets a reading with the following code:

import time
import board
import adafruit_dht

dhtDevice = adafruit_dht.DHT11(board.PG6)


for try_number in range(1,200):
  print(f"Try number {try_number}")
  try:
    print(f"Got temp of: {dhtDevice.temperature}")
    print(f"And hum of: {dhtDevice.humidity}")
    break
  except RuntimeError as e:
    print(e)
    time.sleep(2.1)
  else:
    time.sleep(2.1)
  print("\n")

The weird part is that using the version 3.5.5 it actually get the readings correctly.

More data:
Python: 3.8.5
SBC: Orange Pi Lite
Installed libraries:

Adafruit-Blinka==6.4.1
adafruit-circuitpython-busdevice==5.0.6
adafruit-circuitpython-dht==3.5.5
adafruit-circuitpython-mcp3xxx==1.4.5
Adafruit-PlatformDetect==3.4.0
Adafruit-PureIO==1.1.8
appdirs==1.4.4
attrs==20.3.0
bcrypt==3.2.0
cached-property==1.5.2
certifi==2019.11.28
cffi==1.14.3
chardet==3.0.4
cryptography==3.2.1
dbus-python==1.2.16
distlib==0.3.1
distro==1.5.0
distro-info===0.23ubuntu1
docker==4.3.1
docker-compose==1.27.4
dockerpty==0.4.1
docopt==0.6.2
filelock==3.0.12
idna==2.8
iotop==0.6
jsonschema==3.2.0
mudpi==0.10.0
paho-mqtt==1.5.1
paramiko==2.7.2
pycparser==2.20
pyftdi==0.52.9
PyGObject==3.36.0
PyNaCl==1.4.0
pyrsistent==0.17.3
pyserial==3.5
python-apt==2.0.0+ubuntu0.20.4.4
python-dotenv==0.15.0
pyusb==1.1.1
PyYAML==5.3.1
redis==3.5.3
requests==2.22.0
requests-unixsocket==0.2.0
six==1.14.0
texttable==1.6.3
unattended-upgrades==0.1
urllib3==1.25.8
virtualenv==20.1.0
websocket-client==0.57.0

Overflow Error After Querying Sensor Every 2 Seconds for ~2 Hours

The sensor is queried via a long running process (run as a systemd service under the user account pi) which crashes every two hours or so. The process gracefully exit and the service can be immediately restarted but it would be nice if the crash could be avoided.

The following is an except from the log of the most recent crash (all previous instances were reported in an identical fashion):

Mar 18 14:02:51 raspberrypi python3[30114]: De-initializing self.pulse_in
Mar 18 14:02:51 raspberrypi python3[30114]: Traceback (most recent call last):
Mar 18 14:02:51 raspberrypi python3[30114]:   File "/home/pi/climate_regulation/vpd_controller/simple_vpd_controller.py", line 166, in <module>
Mar 18 14:02:51 raspberrypi python3[30114]:     raise error
Mar 18 14:02:51 raspberrypi python3[30114]:   File "/home/pi/climate_regulation/vpd_controller/simple_vpd_controller.py", line 137, in <module>
Mar 18 14:02:51 raspberrypi python3[30114]:     raw_temperature = dhtDevice.temperature
Mar 18 14:02:51 raspberrypi python3[30114]:   File "/home/pi/.local/lib/python3.7/site-packages/adafruit_dht.py", line 244, in temperature
Mar 18 14:02:51 raspberrypi python3[30114]:     self.measure()
Mar 18 14:02:51 raspberrypi python3[30114]:   File "/home/pi/.local/lib/python3.7/site-packages/adafruit_dht.py", line 189, in measure
Mar 18 14:02:51 raspberrypi python3[30114]:     pulses = self._get_pulses_pulseio()
Mar 18 14:02:51 raspberrypi python3[30114]:   File "/home/pi/.local/lib/python3.7/site-packages/adafruit_dht.py", line 119, in _get_pulses_pulseio
Mar 18 14:02:51 raspberrypi python3[30114]:     pulses.append(self.pulse_in.popleft())
Mar 18 14:02:51 raspberrypi python3[30114]: OverflowError: unsigned short is greater than maximum

DHT22 not working on Raspberry Pi wh

Hope this is the right place to post this.. I'm a newby trying to setup a DHT 22 with rpwh, i am trying the dht_simpletest.py to see if my DHT 22 is reading ok, but getting this error...any thoughts on what going on.. Thanks

pi@raspberrypi:~ $ sudo python3 dht_simpletest.py
Traceback (most recent call last):
File "dht_simpletest.py", line 9, in
dhtDevice = adafruit_dht.DHT22(board.D4)
File "/usr/local/lib/python3.7/dist-packages/adafruit_dht.py", line 275, in init
super().init(False, pin, 1000, use_pulseio)
File "/usr/local/lib/python3.7/dist-packages/adafruit_dht.py", line 56, in init
self.pulse_in = PulseIn(self._pin, 81, True)
File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 73, in init
message = self._wait_receive_msg(timeout=0.25)
File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 92, in _wait_receive_msg
"Timed out waiting for PulseIn message. Make sure libgpiod is installed."
RuntimeError: Timed out waiting for PulseIn message. Make sure libgpiod is installed.

I checked python3, adafruit_dht.py, and Libgpiod are all installed !!

Would be thankful for any fix suggestions..

Thanks
QS3445

Missing Type Annotations

There are missing type annotations for some functions in this library.

The typing module does not exist on CircuitPython devices so the import needs to be wrapped in try/except to catch the error for missing import. There is an example of how that is done here:

try:
    from typing import List, Tuple
except ImportError:
    pass

Once imported the typing annotations for the argument type(s), and return type(s) can be added to the function signature. Here is an example of a function that has had this done already:

def wrap_text_to_pixels(
    string: str, max_width: int, font=None, indent0: str = "", indent1: str = ""
) -> List[str]:

If you are new to Git or Github we have a guide about contributing to our projects here: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github

There is also a guide that covers our CI utilities and how to run them locally to ensure they will pass in Github Actions here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code In particular the pages: Sharing docs on ReadTheDocs and Check your code with pre-commit contain the tools to install and commands to run locally to run the checks.

If you are attempting to resolve this issue and need help, you can post a comment on this issue and tag both @FoamyGuy and @kattni or reach out to us on Discord: https://adafru.it/discord in the #circuitpython-dev channel.

The following locations are reported by mypy to be missing type annotations:

  • adafruit_dht.py:52
  • adafruit_dht.py:80
  • adafruit_dht.py:279
  • adafruit_dht.py:289

DHT22 report null after a while

BUG DESCRIPTION
Hello *. I have a problem with my DHT22. After some time (hours, days) I get null values from sensor. So I attached 2 sensors to my raspberry pi via GPIO2, 27.

The results are confusing:
If one sensors show null, one other may keep reporting good values!
Reboot of rpi does not help at all.
Hard reset (Power off / on) of rpi always works.
Power reset (3.3-5V off / on) of a sensor only SOMETIMES works.
Data reset (pull cable and replug) of sensor works almost always.
If data reset (on ONE sensor) works, other null sensor will start reporting good values as well!

EXPECTED BEHAVIOR
Get both values.

THE SAME ISSUES
I had found the same issue on github
arendst/Tasmota#5619
Those guiys was make some change in reading algorythm, i was try to make the same changes, but i found that i can't make any changes to
/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein
i'm not sure if i am going right way.
I think those guys find a way out
arendst/Tasmota#7440

DHT22 negative temperatures are not handled correctly.

The DHT22 sensor returs a 16 bit temperature with bits 0-14 containing the magnitude and the MSB indicating the sign. The driver as written incorrectly treat the value as a twos-complement signed integer and gives incorrect results below 0 C .
I put the sensor in a freezer.
the dht_simpletest converts to F so this example shows the error as the temperature crosses 32 F

Temp: 32.9 F Humidity: 23.4% 
Temp: 32.7 F Humidity: 23.5% 
Temp: 32.5 F Humidity: 23.6% 
Temp: 32.4 F Humidity: 23.7% 
Temp: 32.2 F Humidity: 23.8% 
Temp: 32.0 F Humidity: 23.8% 
Temp: 5930.4 F Humidity: 24.0% 
Temp: 5930.4 F Humidity: 24.1% 
Temp: 5930.5 F Humidity: 24.2% 
Temp: 5930.7 F Humidity: 24.3% 
Temp: 5930.9 F Humidity: 24.4% 
Temp: 5931.1 F Humidity: 24.5% 
Temp: 5931.3 F Humidity: 24.5% 
Temp: 5931.4 F Humidity: 24.7% 
Temp: 5931.6 F Humidity: 24.8% 
Temp: 5931.6 F Humidity: 25.1% 
Temp: 5931.8 F Humidity: 25.7% 
Temp: 5931.6 F Humidity: 26.3% 
Temp: 5931.6 F Humidity: 26.9% 
Temp: 5931.6 F Humidity: 27.6% 
Temp: 5931.3 F Humidity: 28.7% 
Temp: 5931.1 F Humidity: 29.2% 
Temp: 5930.9 F Humidity: 29.7% 
Temp: 5930.5 F Humidity: 30.2% 
Temp: 5930.4 F Humidity: 30.9% 
Temp: 32.0 F Humidity: 31.4% 
Temp: 32.5 F Humidity: 32.7% 
Temp: 32.9 F Humidity: 33.3%

Note - the DHT 11 appear to only measure down to 1 C - so there is no problem there.

A full buffer was not returned. Try again.

Hi,
using Raspberry Pi Zero with DHT11 sensor and I am observing this issue:
"A full buffer was not returned. Try again." after running dht_simpletest.py.
I edited values to match DHT11 and P4 (i use)

dhtDevice = adafruit_dht.DHT11(board.D4)

I tested the sensor using the old library and it works (90+ % succ read rate), but using the new library I can barely make one successful request.
Also I tried to increase sleep period to 5 sec with no result.

How should I troubleshoot this?

DHT sensor not found, check wiring

I'm using DHT11 on Rpi 4B and I turn to using Adafruit_CircuitPython_DHT today from Adafruit_Python_DHT. I had changed my code to fit the Adafruit_CircuitPython_DHT, but when I run it I meet this error:

Traceback (most recent call last):
  File "tmpv0.2.py", line 44, in <module>
    main()
  File "tmpv0.2.py", line 23, in main
    temperature = dht_device.temperature
  File "/usr/local/lib/python3.8/dist-packages/adafruit_dht.py", line 253, in temperature
    self.measure()
  File "/usr/local/lib/python3.8/dist-packages/adafruit_dht.py", line 205, in measure
    raise RuntimeError("DHT sensor not found, check wiring")
RuntimeError: DHT sensor not found, check wiring

I am sure the connection is fine, because after this error I run the former code and it work perfectly.

Here is the code that has been change to fit Adafruit_CircuitPython_DHT

import datetime
import time

import adafruit_dht
from board import D4
from luma.core.interface.serial import i2c
from luma.core.render import canvas
from luma.oled.device import sh1106
from PIL import ImageFont


# OLED settings
serial = i2c(port=1, address=0x3C)
device = sh1106(serial)
font = ImageFont.truetype('simyou.ttf', 15)

# DHT11 settings
dht_device = adafruit_dht.DHT11(D4)


def main():
    while True:
        temperature = dht_device.temperature
        humidity = dht_device.humidity
        if humidity is not None and temperature is not None:
            Temperature = "温度: {0:0.1f}°C".format(temperature)
            Humidity = "湿度: {0:0.1f}%".format(humidity)
            print(Temperature, Humidity)
            for i in range(0, 10):
                now = datetime.datetime.now()
                today_time = now.strftime("%H:%M:%S")
                with canvas(device) as draw:
                    draw.text((30, 4), today_time, font=font, fill="white")
                    draw.text((10, 23), Temperature, font=font, fill="white")
                    draw.text((10, 42), Humidity, font=font, fill="white")
                time.sleep(0.2)

        else:
            print('失败')


if __name__ == "__main__":
    try:
        main()
    except KeyboardInterrupt:
        device.cleanup()
        pass

And here is the former code

import datetime
import time

import Adafruit_DHT
from luma.core.interface.serial import i2c
from luma.core.render import canvas
from luma.oled.device import sh1106
from PIL import ImageFont

# OLED settings
serial = i2c(port=1, address=0x3C)
device = sh1106(serial)
font = ImageFont.truetype('simyou.ttf', 15)

# DHT11 settings
sensor = Adafruit_DHT.DHT11
DHT11pin = 4


def main():
    while True:
        humidity, temperature = Adafruit_DHT.read_retry(sensor, DHT11pin)
        if humidity is not None and temperature is not None:
            Temperature = "温度: {0:0.1f}°C".format(temperature)
            Humidity = "湿度: {0:0.1f}%".format(humidity)
            print(Temperature, Humidity)
            for i in range(0, 10):
                now = datetime.datetime.now()
                today_time = now.strftime("%H:%M:%S")
                with canvas(device) as draw:
                    draw.text((30, 4), today_time, font=font, fill="white")
                    draw.text((10, 23), Temperature, font=font, fill="white")
                    draw.text((10, 42), Humidity, font=font, fill="white")
                time.sleep(0.2)

        else:
            print('失败')


if __name__ == "__main__":
    try:
        main()
    except KeyboardInterrupt:
        device.cleanup()
        pass

I am new to python and Rpi, and thanks for any help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.