I recently purchased an AirGradient DIY Pro Kit Pre-Soldered and experiencing a problem where the OLED displays a white screen with ESPHome. It worked for a few days, displaying all the sensor data then started displaying only the white screen.
Configuration:
AirGradient v3.7 (seems I should have received 4.2)
Home Assistant 2023.8.2
ESPHome: 2023.7.1
Testing:
Direct flashing through browser
- Use AirGradient ‘flash firmware’ button
- OLED display looks good
- Connects to wifi and updates AirGradient dashboard
Arduino
- Install Example: DIY_PRO_V3_7
- OLED and wifi work as expected
Home Assistant with ESPHome
- White OLED screen displayed
- Tried multiple ttf fonts and size from various sites
- Test with downloaded and online fonts
- Remove all sensor code
Here is the yaml code I’m using after removing all the sensors, it’s very stripped and should display something on the OLED screen.
substitutions:
devicename: "airgradient-pro"
upper_devicename: "Airgradient Pro"
esphome:
name: "${devicename}"
platform: ESP8266
board: d1_mini
# Enable logging
logger:
api:
encryption:
key: "1234567890"
ota:
password: "1234567890"
wifi:
networks:
- ssid: !secret wifi_ssid
password: !secret wifi_password
reboot_timeout: 15min
domain: .homenet.local
ap:
ssid: "Airgradient Fallback Hotspot"
password: "1234567890"
switch:
- platform: safe_mode
name: "Flash Mode (Safe Mode)"
captive_portal:
i2c:
sda: D2
scl: D1
uart:
- rx_pin: D5
tx_pin: D6
baud_rate: 9600
id: uart_1
- rx_pin: D4
tx_pin: D3
baud_rate: 9600
id: uart_2
font:
- file: "fonts/OpenSans-Regular.ttf"
id: opensans
size: 16
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
reset_pin: D0
address: 0x3C
lambda: |-
it.print(0, 0, id(opensans), "Hello World!");
Any ideas or suggestions would be most appreciated.