Stonewood
(Ksteenhoudt)
November 5, 2023, 8:26pm
1
I programmed with ESPHome an ESP32 to display some Home Assistant sensor values on a 16x2 LCD module without using I2C adapter.
It works fine after ESPhome install and compile. But when I reboot the ESP32 module the display does not show values.
Although in the lESP32 log I see the the values are read and updated.
If I install the code again (wifi) it start displaying the values again.
esphome:
name: esp32
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "******"
ota:
password: "*****"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp32 Fallback Hotspot"
password: "********"
captive_portal:
sensor:
- platform: dht
pin: 33
temperature:
name: TemperatureESP32
id: temp
humidity:
name: "HumidityESP32"
id: humidity
update_interval: 60s
- platform: homeassistant
id: elek_up
entity_id: sensor.dsmr_reading_electricity_currently_returned
- platform: homeassistant
id: elek_down
entity_id: sensor.dsmr_reading_electricity_currently_delivered
display:
- platform: lcd_gpio
dimensions: 16x2
data_pins:
- 18
- 17
- 16
- 21
enable_pin: 23
rs_pin: 19
lambda: |-
it.printf("%.1fC %.1f%%", id(temp).state, id(humidity).state);
it.printf(1 , 1, "%.3fkW %.3fkW", id(elek_up).state, id(elek_down).state);
zoogara
(Daryl)
November 6, 2023, 6:13am
2
Capture and post the startup logs for a reboot.
JurekCh1968
(Jurek Chlebowski)
February 8, 2025, 8:40pm
3
I am experiencing exactly same issue. My startup log is as follows:
[21:36:05][C][wifi:428]: Local MAC: EC:64:C9:7C:F0:BC
[21:36:05][C][wifi:433]: SSID: [redacted]
[21:36:05][C][wifi:436]: IP Address: 192.168.1.12
[21:36:05][C][wifi:440]: BSSID: [redacted]
[21:36:05][C][wifi:441]: Hostname: 'esp32-co2--voc-sensor'
[21:36:05][C][wifi:443]: Signal strength: -61 dB ▂▄▆█
[21:36:05][C][wifi:447]: Channel: 11
[21:36:05][C][wifi:448]: Subnet: XXX.XXX.XX.XX
[21:36:05][C][wifi:449]: Gateway: XXX.XXX.X.X
[21:36:05][C][wifi:450]: DNS1: XXX.XXX.XX.X
[21:36:05][C][wifi:451]: DNS2: 0.0.0.0
[21:36:05][D][wifi:626]: Disabling AP...
[21:36:05][C][api:026]: Setting up Home Assistant API server...
[21:36:05][I][app:062]: setup() finished successfully!
[21:36:05][W][component:170]: Component wifi cleared Warning flag
[21:36:05][W][component:157]: Component api set Warning flag: unspecified
[21:36:05][I][app:100]: ESPHome version 2024.12.4 compiled on Feb 8 2025, 17:10:11
[21:36:05][C][wifi:600]: WiFi:
[21:36:05][C][wifi:428]: Local MAC: XXXXXXXXXXXXXX
[21:36:05][C][wifi:433]: SSID: [redacted]
[21:36:05][C][wifi:436]: IP Address: XXX.XXX.XX.X
[21:36:05][C][wifi:440]: BSSID: [redacted]
[21:36:05][C][wifi:441]: Hostname: 'esp32-co2--voc-sensor'
[21:36:05][C][wifi:443]: Signal strength: -61 dB ▂▄▆█
[21:36:05][C][wifi:447]: Channel: 11
[21:36:05][C][wifi:448]: Subnet: XXX.XXX.XX.XX
[21:36:05][C][wifi:449]: Gateway: XXX.XXX.XX.X
[21:36:05][C][wifi:450]: DNS1: XXX.XXX.XX.X
[21:36:05][C][wifi:451]: DNS2: 0.0.0.0
[21:36:05][C][logger:185]: Logger:
[21:36:05][C][logger:186]: Level: DEBUG
[21:36:05][C][logger:188]: Log Baud Rate: 115200
[21:36:05][C][logger:189]: Hardware UART: UART0
[21:36:05][C][i2c.arduino:071]: I2C Bus:
[21:36:05][C][i2c.arduino:072]: SDA Pin: GPIO21
[21:36:05][C][i2c.arduino:073]: SCL Pin: GPIO22
[21:36:05][C][i2c.arduino:074]: Frequency: 50000 Hz
[21:36:05][C][i2c.arduino:086]: Recovery: bus successfully recovered
[21:36:05][I][i2c.arduino:096]: Results from i2c bus scan:
[21:36:05][I][i2c.arduino:102]: Found i2c device at address 0x62
[21:36:05][C][scd4x:094]: scd4x:
[21:36:05][C][scd4x:095]: Address: 0x62
[21:36:05][C][scd4x:112]: Automatic self calibration: ON
[21:36:05][C][scd4x:121]: Ambient pressure compensation disabled
[21:36:05][C][scd4x:122]: Altitude compensation: 0m
[21:36:05][C][scd4x:127]: Measurement mode: periodic (5s)
[21:36:05][C][scd4x:139]: Temperature offset: 4.00 °C
[21:36:05][C][scd4x:140]: Update Interval: 60.0s
[21:36:05][C][scd4x:141]: CO2 'SCD41 CO2'
[21:36:05][C][scd4x:141]: Device Class: 'carbon_dioxide'
[21:36:05][C][scd4x:141]: State Class: 'measurement'
[21:36:05][C][scd4x:141]: Unit of Measurement: 'ppm'
[21:36:05][C][scd4x:141]: Accuracy Decimals: 0
[21:36:05][C][scd4x:141]: Icon: 'mdi:molecule-co2'
[21:36:05][C][scd4x:142]: Temperature 'SCD41 Temperature'
[21:36:05][C][scd4x:142]: Device Class: 'temperature'
[21:36:05][C][scd4x:142]: State Class: 'measurement'
[21:36:05][C][scd4x:142]: Unit of Measurement: '°C'
[21:36:05][C][scd4x:142]: Accuracy Decimals: 2
[21:36:05][C][scd4x:142]: Icon: 'mdi:thermometer'
[21:36:05][C][scd4x:143]: Humidity 'SCD41 Humidity'
[21:36:05][C][scd4x:143]: Device Class: 'humidity'
[21:36:05][C][scd4x:143]: State Class: 'measurement'
[21:36:05][C][scd4x:143]: Unit of Measurement: '%'
[21:36:05][C][scd4x:143]: Accuracy Decimals: 2
[21:36:05][C][scd4x:143]: Icon: 'mdi:water-percent'
[21:36:05][C][lcd_gpio:027]: **GPIO LCD Display:**
**[21:36:05][C][lcd_gpio:028]: Columns: 16, Rows: 2**
**[21:36:05][C][lcd_gpio:029]: RS Pin: GPIO19**
**[21:36:05][C][lcd_gpio:031]: Enable Pin: GPIO23**
**[21:36:05][C][lcd_gpio:033]: Data Pin 0: GPIO18**
**[21:36:05][C][lcd_gpio:034]: Data Pin 1: GPIO17**
**[21:36:05][C][lcd_gpio:035]: Data Pin 2: GPIO16**
**[21:36:05][C][lcd_gpio:036]: Data Pin 3: GPIO15**
**[21:36:05][C][lcd_gpio:043]: Update Interval: 1.0s**
[21:36:05][D][api:103]: Accepted 192.168.1.84
[21:36:05][W][component:170]: Component api cleared Warning flag
[21:36:05][W][component:237]: Component api took a long time for an operation (51 ms).
[21:36:05][W][component:238]: Components should block for at most 30 ms.
[21:36:05][C][captive_portal:089]: Captive Portal:
[21:36:05][C][mdns:116]: mDNS:
[21:36:05][C][mdns:117]: Hostname: esp32-co2--voc-sensor
[21:36:05][D][api.connection:1446]: Home Assistant 2025.2.1 XXX.XXX.XX.X: Connected successfully
[21:36:05][C][esphome.ota:073]: Over-The-Air updates:
[21:36:05][C][esphome.ota:074]: Address: esp32-co2--voc-sensor.local:3232
[21:36:05][C][esphome.ota:075]: Version: 2
[21:36:05][C][esphome.ota:078]: Password configured
[21:36:05][C][safe_mode:018]: Safe Mode:
[21:36:05][C][safe_mode:020]: Boot considered successful after 60 seconds
[21:36:05][C][safe_mode:021]: Invoke after 10 boot attempts
[21:36:05][C][safe_mode:023]: Remain in safe mode for 300 seconds
[21:36:05][C][api:140]: API Server:
[21:36:05][C][api:141]: Address: esp32-co2--voc-sensor.local:6053
[21:36:05][C][api:143]: Using noise encryption: YES
Any hint would be appreciated…
TIA. J
jsuanet
(Jos)
February 9, 2025, 9:27am
4
How are you rebooting the ESP? Maybe a full power cycle solves the problem.
JurekCh1968
(Jurek Chlebowski)
February 11, 2025, 5:56pm
5
Basically the lcd stops working after the power cycle. I need to re-flash it and then it works.
I have the same setup (ESP32 + display_gpio) and similar problem. My display does not show any text. However, this happens randomly. Like 50% of times. It does not matter if I use soft or hard reset button or cut the power. Tried many wannabe solutions (excluded software and hardware parts, changed display, …) but nothing changes.
I am willing to post log file. However, it is normal. No errors whatsoever.
Any hints?