『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 4911|回复: 8

[技术探讨] 【求助】nodemucuv2 刷esphome接多个传感器问题

[复制链接]

4

主题

195

帖子

2900

积分

金牌会员

Rank: 6Rank: 6

积分
2900
金钱
2705
HASS币
0
发表于 2019-11-4 21:23:21 | 显示全部楼层 |阅读模式
本帖最后由 kylin_fedora 于 2019-11-4 21:29 编辑

请求各位大侠帮助,小弟在此谢过!
单独使用温湿度传感器没有问题,配置如下:

i2c:
  sda: D2
  scl: D1
  scan: True
sensor:
  - platform: sht3xd
    temperature:
      name: "Test room Temperature"
    humidity:
      name: "Test room Humidity"
    address: 0x44
    update_interval: 60s



日志:
[13:22:24][C][i2c:028]: I2C Bus:
[13:22:24][C][i2c:029]:   SDA Pin: GPIO4
[13:22:24][C][i2c:030]:   SCL Pin: GPIO5
[13:22:24][C][i2c:031]:   Frequency: 50000 Hz
[13:22:24][I][i2c:033]: Scanning i2c bus for active devices...
[13:22:24][I][i2c:040]: Found i2c device at address 0x44
[13:22:24][C][logger:137]: Logger:
[13:22:24][C][logger:138]:   Level: DEBUG
[13:22:24](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:22:24](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:22:24](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:22:24](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:22:45][D][sht3xd:059]: Got temperature=24.53°C humidity=59.86%
[13:22:45][D][sensor:092]: 'Test room Temperature': Sending state 24.52735 °C with 1 decimals of accuracy
[13:22:45][D][sensor:092]: 'Test room Humidity': Sending state 59.85962 % with 1 decimals of accuracy

使用光照传感器+人体感应+温湿度传感器时,温湿度传感器有问题
错误日志是:
sensor:
  - platform: sht3xd
    temperature:
      name: "Main Bathroom Temperature"
    humidity:
      name: "Main Bathroom Humidity"
    address: 0x44
    i2c_id: bus_sht
    update_interval: 60s
  - platform: bh1750
    name: "Main Bathroom lux"
    address: 0x23
    i2c_id: bus_pir
    update_interval: 10s
binary_sensor:
  - platform: gpio
    pin: D6
    name: "Main Bathroom PIR Sensor"
    device_class: motion

i2c:
  - id: bus_sht
    sda: D2
    scl: D1
    scan: True
  - id: bus_pir
    sda: D3
    scl: D4
    scan: True


日志:
[13:28:44][C][i2c:028]: I2C Bus:
[13:28:44][C][i2c:029]:   SDA Pin: GPIO4
[13:28:44][C][i2c:030]:   SCL Pin: GPIO5
[13:28:44][C][i2c:031]:   Frequency: 50000 Hz
[13:28:44][I][i2c:033]: Scanning i2c bus for active devices...
[13:28:44][I][i2c:040]: Found i2c device at address 0x23
[13:28:44][C][i2c:028]: I2C Bus:
[13:28:44][C][i2c:029]:   SDA Pin: GPIO0
[13:28:44][C][i2c:030]:   SCL Pin: GPIO2
[13:28:44][C][i2c:031]:   Frequency: 50000 Hz
[13:28:44][I][i2c:033]: Scanning i2c bus for active devices...
[13:28:44][I][i2c:040]: Found i2c device at address 0x23
[13:28:44][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Main Bathroom PIR Sensor'
[13:28:45][C][gpio.binary_sensor:015]:   Device Class: 'motion'
[13:28:45][C][gpio.binary_sensor:016]:   Pin: GPIO12 (Mode: INPUT)
[13:28:45][C][logger:137]: Logger:
[13:28:45][C][logger:138]:   Level: DEBUG
[13:28:45][C][logger:139]:   Log Baud Rate: 115200
[13:28:45][C][logger:140]:   Hardware UART: UART0
[13:28:45][C][sht3xd:034]: SHT3xD:
[13:28:45][C][sht3xd:035]:   Address: 0x44
[13:28:45][E][sht3xd:037]: Communication with SHT3xD failed!
[13:28:46][C][sht3xd:039]:   Update Interval: 60.0s
[13:28:46][C][sht3xd:041]:   Temperature 'Main Bathroom Temperature'
[13:28:46][C][sht3xd:041]:     Unit of Measurement: '°C'
[13:28:46][C][sht3xd:041]:     Accuracy Decimals: 1
[13:28:46][C][sht3xd:041]:     Icon: 'mdi:thermometer'
[13:28:46][C][sht3xd:042]:   Humidity 'Main Bathroom Humidity'
[13:28:46][C][sht3xd:042]:     Unit of Measurement: '%'
[13:28:46][C][sht3xd:042]:     Accuracy Decimals: 1
[13:28:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:28:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:28:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:28:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:28:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:28:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:28:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:28:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:28:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[13:28:46][D][binary_sensor:033]: 'Main Bathroom PIR Sensor': Sending state OFF
[13:28:48][D][bh1750.sensor:071]: 'Main Bathroom lux': Got illuminance=145.8lx
[13:28:48][D][sensor:092]: 'Main Bathroom lux': Sending state 145.83333 lx with 1 decimals of accuracy
[13:28:56][D][binary_sensor:033]: 'Main Bathroom PIR Sensor': Sending state ON
[13:28:58][D][binary_sensor:033]: 'Main Bathroom PIR Sensor': Sending state OFF
[13:28:58][D][bh1750.sensor:071]: 'Main Bathroom lux': Got illuminance=146.7lx
[13:28:58][D][sensor:092]: 'Main Bathroom lux': Sending state 146.66666 lx with 1 decimals of accuracy




回复

使用道具 举报

4

主题

195

帖子

2900

积分

金牌会员

Rank: 6Rank: 6

积分
2900
金钱
2705
HASS币
0
 楼主| 发表于 2019-11-4 21:42:32 | 显示全部楼层
自己顶下,
回复

使用道具 举报

8

主题

736

帖子

4570

积分

论坛元老

Rank: 8Rank: 8

积分
4570
金钱
3829
HASS币
40
QQ
发表于 2019-11-4 22:20:45 | 显示全部楼层
本帖最后由 Aiden1 于 2019-11-4 22:22 编辑

不知道这个开发板支不支持多个I²C总线(ESP32有两条),我之前想把oled显示屏和bh1750同时接入但是并没有成功,期待大神解答
回复

使用道具 举报

3

主题

321

帖子

2893

积分

论坛积极会员

积分
2893
金钱
2572
HASS币
10
发表于 2019-11-5 05:37:46 | 显示全部楼层
看你两条i2c找到的地址都是0x23
回复

使用道具 举报

4

主题

195

帖子

2900

积分

金牌会员

Rank: 6Rank: 6

积分
2900
金钱
2705
HASS币
0
 楼主| 发表于 2019-11-5 13:45:11 | 显示全部楼层
tcwj2008 发表于 2019-11-5 05:37
看你两条i2c找到的地址都是0x23

谢谢回复!如果两个都是0x23的话是不是不支持多条I2C,还是都要定义为0x23?周末的时候回家再看下
回复

使用道具 举报

1

主题

137

帖子

632

积分

论坛积极会员

积分
632
金钱
495
HASS币
0
发表于 2019-11-5 16:46:03 | 显示全部楼层
ESP8266EX 拥有 1 个 I2C 接⼝口,⽤用于连接微控制器以及外围设备,如传感器等。
回复

使用道具 举报

4

主题

195

帖子

2900

积分

金牌会员

Rank: 6Rank: 6

积分
2900
金钱
2705
HASS币
0
 楼主| 发表于 2019-11-6 13:59:04 | 显示全部楼层
ccmmm 发表于 2019-11-5 16:46
ESP8266EX 拥有 1 个 I2C 接⼝口,⽤用于连接微控制器以及外围设备,如传感器等。 ...

那意思只能连接一个I2C的设备了
回复

使用道具 举报

4

主题

195

帖子

2900

积分

金牌会员

Rank: 6Rank: 6

积分
2900
金钱
2705
HASS币
0
 楼主| 发表于 2019-11-6 14:06:28 | 显示全部楼层
ccmmm 发表于 2019-11-5 16:46
ESP8266EX 拥有 1 个 I2C 接⼝口,⽤用于连接微控制器以及外围设备,如传感器等。 ...

查了下官方手册8266只有一条,但是发现esp32s的手册描述是:I2C (Inter-Integrated Circuit) 总线用于使 ESP32 和多个外部设备进行通信。多个外部设备可以共用一个 I2C 总线。那么ESP32S是不是可以用多个,这个怎么接,麻烦请教下
回复

使用道具 举报

0

主题

12

帖子

149

积分

注册会员

Rank: 2

积分
149
金钱
137
HASS币
0
发表于 2019-11-17 20:43:38 | 显示全部楼层
本帖最后由 寂寂无闻 于 2019-11-17 20:46 编辑

学习中,Nodemucuv2 刷esphome接DHT11,数值读不出来,
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 13:26 , Processed in 0.061107 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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