Hi,
I am try to set up esphome to use two pcf8574 devices. I have the model that can be connected one to eachother, If I load on esp32 a scan i2c code with arduino I can see both devices on addresses 0x20 and 0x24 (i changed address on the second one).
I2c bus is wired on 21/22 on esp32.
However I can t manage esphome to see and use both of them,
This is my code
captive_portal:
i2c:
- id: bus_a
sda: 21
scl: 22
scan: True
pcf8574:
- id: 'pcf8574_hub_0'
address: 0x20
pcf8575: false
i2c_id: bus_a
- id: 'pcf8574_hub_1'
address: 0x24
pcf8575: false
i2c_id: bus_a
switch:
- platform: gpio
name: "relay_01"
pin:
pcf8574: pcf8574_hub_0
number: 0
mode:
output: true
inverted: false
- platform: gpio
name: "relay_02"
pin:
pcf8574: pcf8574_hub_0
number: 1
mode:
output: true
inverted: false
.......
and this is the log after load the code
INFO ESPHome 2023.10.6
INFO Reading configuration /config/esphome/tablou-ct.yaml...
INFO Starting log output from 192.168.10.42 using esphome API
INFO Successfully connected to 192.168.10.42
[16:39:13][I][app:102]: ESPHome version 2023.10.6 compiled on Nov 12 2023, 16:27:58
[16:39:13][C][wifi:546]: WiFi:
[16:39:13][C][wifi:382]: Local MAC: A8:42:E3:49:3C:C4
[16:39:13][C][wifi:383]: SSID: [redacted]
[16:39:13][C][wifi:384]: IP Address: 192.168.10.42
[16:39:13][C][wifi:386]: BSSID: [redacted]
[16:39:13][C][wifi:387]: Hostname: 'tablou-ct'
[16:39:13][C][wifi:389]: Signal strength: -69 dB ▂▄▆█
[16:39:13][C][wifi:393]: Channel: 6
[16:39:13][C][wifi:394]: Subnet: 255.255.255.0
[16:39:13][C][wifi:395]: Gateway: 192.168.10.1
[16:39:13][C][wifi:396]: DNS1: 0.0.0.0
[16:39:13][C][wifi:397]: DNS2: 0.0.0.0
[16:39:13][C][logger:416]: Logger:
[16:39:13][C][logger:417]: Level: DEBUG
[16:39:13][C][logger:418]: Log Baud Rate: 115200
[16:39:13][C][logger:420]: Hardware UART: UART0
[16:39:13][C][i2c.arduino:053]: I2C Bus:
[16:39:13][C][i2c.arduino:054]: SDA Pin: GPIO21
[16:39:13][C][i2c.arduino:055]: SCL Pin: GPIO22
[16:39:13][C][i2c.arduino:056]: Frequency: 50000 Hz
[16:39:13][C][i2c.arduino:059]: Recovery: bus successfully recovered
[16:39:13][I][i2c.arduino:069]: Results from i2c bus scan:
[16:39:13][I][i2c.arduino:075]: Found i2c device at address 0x20
[16:39:13][C][pcf8574:021]: PCF8574:
[16:39:13][C][pcf8574:022]: Address: 0x20
[16:39:13][C][pcf8574:023]: Is PCF8575: NO
[16:39:13][C][pcf8574:021]: PCF8574:
[16:39:13][C][pcf8574:022]: Address: 0x24
[16:39:13][C][pcf8574:023]: Is PCF8575: NO
[16:39:13][E][pcf8574:025]: Communication with PCF8574 failed!
[16:39:13][C][switch.gpio:068]: GPIO Switch 'relay_01'
[16:39:13][C][switch.gpio:091]: Restore Mode: always OFF
[16:39:13][C][switch.gpio:031]: Pin: 0 via PCF8574
[16:39:13][C][switch.gpio:068]: GPIO Switch 'relay_02'
[16:39:13][C][switch.gpio:091]: Restore Mode: always OFF
[16:39:13][C][switch.gpio:031]: Pin: 1 via PCF8574
[16:39:13][C][switch.gpio:068]: GPIO Switch 'relay_03'
[16:39:13][C][switch.gpio:091]: Restore Mode: always OFF
[16:39:13][C][switch.gpio:031]: Pin: 2 via PCF8574
[16:39:13][C][switch.gpio:068]: GPIO Switch 'relay_04'
[16:39:13][C][switch.gpio:091]: Restore Mode: always OFF
[16:39:13][C][switch.gpio:031]: Pin: 3 via PCF8574
[16:39:13][C][switch.gpio:068]: GPIO Switch 'relay_05'
[16:39:13][C][switch.gpio:091]: Restore Mode: always OFF
[16:39:13][C][switch.gpio:031]: Pin: 4 via PCF8574
[16:39:14][C][switch.gpio:068]: GPIO Switch 'relay_06'
[16:39:14][C][switch.gpio:091]: Restore Mode: always OFF
[16:39:14][C][switch.gpio:031]: Pin: 5 via PCF8574
[16:39:14][C][switch.gpio:068]: GPIO Switch 'relay_07'
[16:39:14][C][switch.gpio:091]: Restore Mode: always OFF
[16:39:14][C][switch.gpio:031]: Pin: 6 via PCF8574
[16:39:14][C][switch.gpio:068]: GPIO Switch 'relay_08'
[16:39:14][C][switch.gpio:091]: Restore Mode: always OFF
[16:39:14][C][switch.gpio:031]: Pin: 7 via PCF8574
[16:39:14][C][switch.gpio:068]: GPIO Switch 'relay_09'
[16:39:14][C][switch.gpio:091]: Restore Mode: always OFF
[16:39:14][C][switch.gpio:031]: Pin: 0 via PCF8574
[16:39:14][C][captive_portal:088]: Captive Portal:
[16:39:14][C][mdns:115]: mDNS:
[16:39:14][C][mdns:116]: Hostname: tablou-ct
[16:39:14][C][ota:097]: Over-The-Air Updates:
[16:39:14][C][ota:098]: Address: 192.168.10.42:3232
[16:39:14][C][ota:101]: Using Password.
[16:39:14][C][api:139]: API Server:
[16:39:14][C][api:140]: Address: 192.168.10.42:6053
[16:39:14][C][api:144]: Using noise encryption: NO
Seems it can t see both pcf and also get that error communicating with pcf…
Any idea what I am doing wrong ?
Thank you very much