Hello Friends, Happy Monday!
I spent most of the weekend researching this problem. I found a few posts in this thread that were similar but the solutions in those did not help in this case. I have reviewed posts on other forums such as the Espressif community, Arduino forums, etc. These have suggested similar solutions, none of which had any effects. YAML will be at the end of the post.
Problem Description:
I am using an ESP32-S2-DevKitM-1U (Espressif, not a clone). The ESPHome webapp detects it as an esp32-s2-saola-1
. Everything works fine until an I2C device is connected to it. When I connect the I2C device (LCD Display) the board boots and the display shows the test message but it never connects to HA or ESPHome.
Component Hardware:
2 - external relays configured as GPIO switches
A rotary encoder (push button of the encoder is configured as a binary sensor).
16X2 LCD display with a PCF8574 controller (I2C)
Status_LED Light (added for troubleshooting)
Power Supply:
Variable bench power supply set to 5.0vdc, current limited to 3.0A (shows current consumption of 100mA with all devices connected).
The LCD requires 5.0vdc so it is powered directly from the bench power supply. The sda
and scl
pins are connected directly to the MCU.
Troubleshooting:
I have tried several different configurations in the i2c:
block with no changes. These different options have been tried one at a time and with all of them together.
To test that the displays I’m working with are good I configured a D1 Mini clone (esp8266) with the display, a button (binary sensor) and two Dallas DS18B20 temperature sensors. These work fine and are visible in HA and ESPHome with all components connected.
Additional Thoughts:
In one of the Arduino forums I visited it was suggested the the voltages on the I2C buss could be at fault. Since the LCD requires 5.0vdc to operate I’m assuming the control pins on the PCF8574 are also operating at 5.0vdc. I don’t see any power regulation on that component. The only way I know to change this is to use a level shifter between the pins on the PCF8574 and the MCU. I haven’t done this yet because the 5.0vdc setup is working fine on the D1 Mini I’m using for troubleshooting. Any comments on this?
I have tried to view the logs coming from the MCU via USB while it is failing to connect to WiFi. I really don’t see anything I recognize as useful. This is all that is displayed:
(Windows 11 using the identified COM port).
PS P:\esphome> esphome logs --device COM6 .\test-esph-esp32s2-e4e8.yaml
INFO ESPHome 2024.6.1
INFO Reading configuration .\test-esph-esp32s2-e4e8.yaml...
INFO Detected timezone 'America/Phoenix'
INFO Starting log output from COM6 with baud rate 115200
[08:20:14]ESP-ROM:esp32s2-rc4-20191025
[08:20:14]Build:Oct 25 2019
[08:20:14]rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
[08:20:14]SPIWP:0xee
[08:20:14]mode:DIO, clock div:1
[08:20:14]load:0x3ffe6100,len:0x524
[08:20:14]load:0x4004c000,len:0xa70
[08:20:14]load:0x40050000,len:0x292c
[08:20:14]entry 0x4004c18c
YAML:
binary_sensor:
- platform: gpio #rotary encoder button
pin:
number: 9
mode:
input: True
pullup: True
inverted: True
filters:
- delayed_on: 50ms
id: btn_menu
switch: #relays
- platform: gpio
name: "Zone 1"
pin: 1
id: rly_zone1
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
name: "Zone 2"
pin: 2
id: rly_zone2
restore_mode: RESTORE_DEFAULT_OFF
sensor:
- platform: rotary_encoder
id: rot_enc
pin_a: 7
pin_b: 8
###!!! Debug
# - platform: debug
# free:
# name: "Heap Free"
i2c:
sda: 15
scl: 16
scan: False #added based on community suggestion
frequency: 800kHz #added based on community suggestion
setup_priority: -100 #added based on community suggestion
display:
- platform: lcd_pcf8574
dimensions: 16x2
address: 0x27
setup_priority: -100 #added based on community suggestion
lambda: |-
it.print("Hello World!!");
###
# Debugging details
###
# debug:
# update_interval: 5s
# text_sensor:
# - platform: debug
# device:
# name: "Device Info"
# reset_reason:
# name: "Reset Reason"
Thank you in advance for any comments or suggestions!
-James