Enthernet Code
Enthernet Code
DIIDevHeads IoT Integration Server
Created by Enthernet Code on 8/30/2024 in #firmware-and-baremetal
DHT11 Sensor Read Issue with MicroPython on Zephyr (ESP32)
Hello guys based on my project simple temperature monitoring system using MicroPython on a Zephyr RTOS-supported microcontroller, such as the ESP32, and transmit the data over Bluetooth Low Energy (BLE) to a mobile app?. Am currently trying to integrate the DHT11 Sensor with MicroPython on Zephyr reading temperature and humidity data from the DHT11 sensor using MicroPython on Zephyr. But my code fails to read from the DHT11 sensor can anyone help me resolve this
OSError: [Errno 110] ETIMEDOUT
OSError: [Errno 110] ETIMEDOUT
import machine
import dht
import time

sensor = dht.DHT11(machine.Pin(4))

while True:
sensor.measure()
temp = sensor.temperature()
hum = sensor.humidity()
print("Temperature: {}°C, Humidity: {}%".format(temp, hum))
time.sleep(2)
import machine
import dht
import time

sensor = dht.DHT11(machine.Pin(4))

while True:
sensor.measure()
temp = sensor.temperature()
hum = sensor.humidity()
print("Temperature: {}°C, Humidity: {}%".format(temp, hum))
time.sleep(2)
2 replies