ESPHome validation fails "Cannot resolve pin name"

I am trying to configure a MakerHawk ESP8266 WiFi Development Board with 0.91 Inch ESP8266 OLED Display for use with ESPHome. I have flashed ESPHome, and the device shows up in the ESPHome dashboard.

According to the pinout:

  • oled_sda = D2
  • oled_scl = D14

When I try to validate the .yaml configuration file, I get the following error:

INFO Reading configuration...
Failed config

  - [source /config/esphome/kitchen_timer_display.yaml:25]
    sda: D2
    Cannot resolve pin name 'D14' for board nodemcuv2.
    scl: D14 [source /config/esphome/kitchen_timer_display.yaml:26]

Any suggestions, please?

Here is the .yaml config file.

# Substitutions
  devicename: kitchen_timer_display

  name: $devicename
  platform: ESP8266
  board: nodemcuv2

# Enable WiFi
  ssid: !secret wifi_ssid
  password: !secret wifi_pwd

# Enable logging

# Enable Home Assistant API


# Display configuration
  sda: D2
  scl: D14

  - file: "Product Sans Regular.ttf"
    id: product_sans
    size: 20

  - platform: ssd1306_i2c
    model: "SSD1306 128x32"
    reset_pin: D4
    address: 0x3C
    lambda: |-
      it.print(0, 0, id(product_sans), "Hello World!");

I also tried board: nodemcu, since this for Arduino says “In the Arduino IDE, in the Tools > Board menu choose NodeMCU 1.0 (ESP-12E Module)”. That did not have any affect on the validation error.

1 Like

Have you tried it with:

# Display configuration
  sda: GPIO2
  scl: GPIO14

Thanks, @VDRainer. That corrected the validation error.

However, I am now getting errors in the log after upload stating “Found no i2c devices!” and as a result “Communication with SSD1306 failed!”

Log exceprt:

[16:03:31][C][i2c:028]: I2C Bus:
[16:03:31][C][i2c:029]:   SDA Pin: GPIO2
[16:03:31][C][i2c:030]:   SCL Pin: GPIO14
[16:03:31][C][i2c:031]:   Frequency: 50000 Hz
[16:03:31][I][i2c:033]: Scanning i2c bus for active devices...
[16:03:31][I][i2c:049]: Found no i2c devices!
[16:03:31][C][logger:137]: Logger:
[16:03:31][C][logger:138]:   Level: DEBUG
[16:03:31][C][logger:139]:   Log Baud Rate: 115200
[16:03:31][C][logger:140]:   Hardware UART: UART0
[16:03:31][C][ssd1306_i2c:023]: I2C SSD1306
[16:03:31][C][ssd1306_i2c:023]:   Rotations: 0 °
[16:03:31][C][ssd1306_i2c:023]:   Dimensions: 128px x 32px
[16:03:31][C][ssd1306_i2c:024]:   Address: 0x3C
[16:03:31][C][ssd1306_i2c:025]:   Model: SSD1306 128x32
[16:03:31][C][ssd1306_i2c:026]:   Reset Pin: GPIO4 (Mode: OUTPUT)
[16:03:31][C][ssd1306_i2c:027]:   External VCC: NO
[16:03:31][C][ssd1306_i2c:028]:   Update Interval: 1.0s
[16:03:31][E][ssd1306_i2c:031]: Communication with SSD1306 failed!

I realize this is an old topic, but maybe someone like me taking first steps will find this by searching.
In my case it helped to swap SDA and SCL.