First ESPHome project (ESP32-S2 feather board) stuck on initial configuration install

@nickrout @Mikefila This seems like helpful information (Support for Adafruit Feather ESP32-S2 TFT board · Issue #742 · platformio/platform-espressif32 · GitHub), but I’m not sure how to format the config to match the suggested platformio settings.

How would you format this to configure this board for use in ESPHome?

[env:feather_esp32s2_tft]
platform = https://github.com/platformio/platform-espressif32.git
board = feather_esp32s2_tft
framework = arduino

Here’s what I’ve got:

esphome:
  name: humidor
  platformio_options:
    board_build.variant: feather_esp32s2_tft
    platform: https://github.com/platformio/platform-espressif32.git

esp32:
  board: feather_esp32s2_tft
  framework:
    type: arduino
1 Like

I read the other thread that, the a above variation will work when it is added for now I think oyu need the first message and not the second.

platform = 
	https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
platform_packages = 
	framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#master
board = feather_esp32s2_tft
framework = arduino

so maybe

esphome:
  name: humidor
  platformio_options:
    board_build.variant: feather_esp32s2_tft
    platform: https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
      platform_packages: framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#master

Thank you.

Using this

esphome:
  name: humidor
  platformio_options:
    board_build.variant: feather_esp32s2_tft
    platform: https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
      platform_packages: framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#master

esp32:
  board: feather_esp32s2_tft
  framework:
    type: arduino

I got this error:

I don’t know where the documentation is for platform options is, maybe take away the indent. The other thing would be to dig through the similar issues to see how it’s formatted.

@Mikefila OK, this board is now officially supported in PlatformIO ( Adafruit Feather ESP32-S2 TFT — PlatformIO latest documentation).

I’ve tried many variations of this:

esphome:
  name: humidor
  board: adafruit_feather_esp32s2_tft
  platform: esp32
  platformio_options:
    platform: espressif32
    board: adafruit_feather_esp32s2_tft
    board_build.mcu: esp32s2
    framework: espidf

esp32:
  board: adafruit_feather_esp32s2_tft
  variant: esp32s2
  framework:
    type: esp-idf
    version: recommended

But, I keep getting this when I try to install the configuration to the board:

I’ve scoured the forums here, but came up empty. Now that it’s a PlatformIO officially supported board, I figured the configuration would be pretty straightforward. Any ideas?

But has esphome caught up with platformio?

Not yet, but the board is in the PlatformIO registry you referenced in one of your previous replies.

I thought that was all that was required…besides knowing how to configure the settings.

I am not sure if you are still looking in to this or got it to work but as I used this community to help make it work for me just wanted to reply that I have been able to get the Feather ESP32-S2 working with ESPHome and I’ll share what my config was like, I have ESPHome running on a Unraid in a docker on a amd64 architecture so that gets over the issue with some architectures not supporting compiling with esp-idf framework. This example uses the adafruit SHT40 breakout to sense temp/humidity

  name: feathersht40

esp32:
  board: featheresp32-s2
  variant: esp32s2
  framework:
    type: esp-idf
    version: recommended

# Enable logging
logger:

# Enable Home Assistant API
api:

i2c:
  sda: 03
  scl: 04
  scan: true
  id: stemma

sensor:
  - platform: sht4x
    temperature:
      name: "Test Feather Temperature"
    humidity:
      name: "Test Feather Humidity"
    address: 0x44
    update_interval: 15min
ota:
  password: "xxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  manual_ip:
    static_ip: xxx.xxx.xxx.xxx
    gateway: xxx.xxx.xxx.1
    subnet: 255.255.255.0
    dns1: xxx.xxx.xxx.123
    

The one thing I have yet to figure out is, I believe the sensor readings are wrong due to needing to set the i2c power pin to low, at least this was the case for Circuitpython to get accurate readings. Not sure yet how to do that correctly in ESPHome

Edit: while the power is still not 100% right, having compared to another feather with the same sensor running on circuitpython the measurements are accurate. I only say the power isn’t right becuase on the feather running CP the led on the sensor is lit up brightly, while on the esphome programmed one it is quite faint which used to be an issue in earlier CP versions if you didn’t set the pin to low.

1 Like

@pioneersky I adapted your config and got it to validate. Thank you! Now I need to figure out how to install it to the ESP32

@nickrout I’m still running into the arch64 issues. Going back a ways, you mentioned installing ESPHome on my desktop/laptop. Were you referencing these instructions ( Installing ESPHome Manually — ESPHome) or is there a GUI-based version to install to a Windows machine?

Have never installed it on Windows. But if you do you should have the UI. I assume the command ”esphome dashboard”

This Getting Started with the ESPHome Command Line — ESPHome indicates the dashboard isn’t available on Windows.

To be sure though, if HA is installed on an RPi (arch64), but I’m accessing the ESPHome HA add-on via Edge on my Windows machine (x64), and the ESP32 is plugged in via USB, shouldn’t that work? Or, is the problem that the ESPHome HA add-on is on arch64 hardware? In other words, do both ESPHome and the machine the ESP32 is plugged into both have to NOT be arch64?

IIRC the problem was with compiling, which is on the aarch64 machine.

You don’t need the UI anyway.

Thank you. Yes, my HA is on an RPi 3B+ which, as I understand, is an arch64 machine.

Disclaimer: I’m honestly not trying to complain, just understand (because I must still be missing something obvious). So, here goes…

According to this (Home Assistant Analytics (home-assistant.io)), almost half of all HA installations are on Raspberry Pi’s running on 64-bit architecture (arch64). HA maintains ESPHome (as one of the services paid for by Nabu Casa subscriptions), but I cannot use an arch64 machine to compile ESPHome code. Do I have all that right?

The issue is the tools that ESPhome has to use with these esp32-s2’s. currently only esp-idf framework works, which from what I understand does not work on aarch64 systems. The vast majority of current esp32 and esp8266 boards are compatible with the arduino framework. So the limitation is more due to Espressif and Arduino developers at this point than ESPHome. You would not have this issue with the Adafruit HUZZAH32 – ESP32 Feather Board : ID 3405 : $19.95 : Adafruit Industries, Unique & fun DIY electronics and kits for example or other generic esp32’s.

In my journey I also installed it on Windows and @nickrout is definitely right that you don’t need the web interface. I recommend creating the .yaml file in notepad++ and then compile in the command line. It is less scary than it seems!

2 Likes

Also with help from the ESPHome Discord got some help on the i2c power issue fixed, if you have a rev B board add this to your yaml:

switch:
  - platform: gpio
    id: power_on
    restore_mode: ALWAYS_OFF
    pin: 7

for a rev C board you would do:

switch:
  - platform: gpio
    id: power_on
    restore_mode: ALWAYS_ON
    pin: 7

Ah, that’s the piece that was not clear to me (despite my research). Thanks for explaining. I hope “they” sort it out soon since these S2 boards seem to be more ideal for many IoT low power applications.

In the meantime, I did install ESPHome (including the 100 MB Python installation) and through the CLI was successful with getting my board on my network and seen by HA, but now I’m trying to get the BME-280 configuration correct since the three sensors are reporting ‘Unknown.’

I think I have a Rev C board since I bought it in April, but I’ve tried both of your code snippets. In both cases, compiling errors out with about 10 ‘undefined reference’ notifications before exiting the compiler and reporting ‘FAILED.’

So this depends on how much you copied my config exactly, I am just using the Feather ESP32-S2 not the TFT. Having looked at the pinout diagrams on the Adafruit for the Feateher ESP32-S2 TFT the pins for mine would likely not line up for yours. So when setting up i2C you see how on the diagram the GPIO pins for SDA and SCL are 42 & 41 respectively, so when setting up i2c you need to do:

i2c:
  sda: 42
  scl: 41

additionally having looked at the TFT learning document it looks like the i2c power switch only applies to the TFT display if I’m reading that correctly which needs to be pulled high. So I’m thinking that for your board you would do:

switch:
  - platform: gpio
    id: power_on
    restore_mode: ALWAYS_ON
    pin: 21

I was checking and even though platformio seems to support the TFT board, when I try to create a configuration calling the board it says there is no board found with adafruit_feather_esp32s2_tft, so it may not be supported by ESPHome yet.

I pretty much copied it exactly, except I noticed that name was required for a GPIO switch. I did come across the pinout for your board, but didn’t realize it would be spec’d out different by just adding the TFT display.

Anyways, I made those I2C and GPIO switch changes, but received the same (or very similar) compilation errors. So, I commented out the GPIO switch block and pushed that. It compiled and flashed successfully, but now I’m getting something about ‘Can’t connect to ESPHome API,’ so I cannot tell if the board is happy with the I2C config, but HA still reports ‘Unavailable’ for the three entities, so I assume not.

←[32mINFO Starting log output from 10.0.0.38 using esphome API←[0m
←[33mWARNING Can't connect to ESPHome API for 10.0.0.38: Error connecting to ('10.0.0.38', 6053): [WinError 121] The semaphore timeout period has expired←[0m
←[32mINFO Trying to reconnect to 10.0.0.38 in the background←[0m

EDIT: Also, I don’t know if it counts for much, but I added the “-tft” to this block in ESPHome and it did validate.

esp32:
  board: featheresp32-s2-tft
  variant: esp32s2
  framework:
    type: esp-idf
    version: recommended

Does it say it’s connecting to your wifi network correctly? I seem to remember seeing that when my wifi settings/network settings were off. I have manual_ip settings that may not line up with your network, like the dns server not sure how much of that you modified. You can remove the manual_ip setting entirely if you like, I have it there for OTA updates but at this point you’re just trying to get it to work nevermind ota updates.

I had already scrapped that manual IP block. It’s definitely connected to my network. I can see it on my network, ESPHome indicates ONLINE, and I am able to flash via OTA.

I deleted the device from integrations and restarted HA thinking it would auto-discover it and maybe reset something with the API, but HA didn’t discover anything even though ESPHome still indicates ONLINE.