找回密码
 立即注册

微信扫码登录

搜索
查看: 17257|回复: 10

请问大佬,ESP8266接DHT22有问题

[复制链接]

3

主题

16

回帖

95

积分

注册会员

积分
95
金钱
76
HASS币
0
发表于 2020-6-25 00:07:42 | 显示全部楼层 |阅读模式
本帖最后由 18801450050 于 2020-6-25 00:07 编辑

ESPHome代码如下:
esphome:
  name: esp8266_0
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "******"
  password: "*****"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp8266 0 Fallback Hotspot"
    password: "*****"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

sensor:
  - platform: dht
    pin: D0
    temperature:
      name: "Living Room Temperature"
    humidity:
      name: "Living Room Humidity"
    update_interval: 10s
    model: DHT22

但ESPHome 的log里显示
[23:54:32][W][dht:160]: Requesting data from DHT failed!
[23:54:32][W][dht:060]: Invalid readings! Please check your wiring (pull-up resistor, pin number).
[23:54:32][D][sensor:092]: 'Living Room Temperature': Sending state nan °C with 1 decimals of accuracy
[23:54:32][D][sensor:092]: 'Living Room Humidity': Sending state nan % with 0 decimals of accuracy
收不到正确的数据是怎么回事呀
引脚换了好多个也不行


DHT22

DHT22

ESP8266 NodeMCU

ESP8266 NodeMCU
回复

使用道具 举报

3

主题

16

回帖

95

积分

注册会员

积分
95
金钱
76
HASS币
0
 楼主| 发表于 2020-7-12 12:25:01 | 显示全部楼层
wardwangyz 发表于 2020-7-7 12:46
遇到了 同样的问题

我还没解决这个问题 我搁置了
回复

使用道具 举报

3

主题

16

回帖

95

积分

注册会员

积分
95
金钱
76
HASS币
0
 楼主| 发表于 2020-7-12 17:37:57 | 显示全部楼层
wardwangyz 发表于 2020-7-12 15:05
换了 11 可以了 应该是22是总线型

11的精度太差了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-9-17 03:03 , Processed in 0.753066 second(s), 9 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表