Unable to install basic config

Hi - I’m very new to this. I installed ESPHome in my HA instance on my Rasp Pi 4 but don’t seem to be able to install even the most basic config. I have the board connected to my Windows PC. When I try to do the install it initially says

Failed to initialize. Try resetting your device or holding the BOOT button while selecting your serial port until it starts preparing the installation.

So then I retry while holding down the button and then I get:

INFO Reading configuration /config/esphome/lounge-node.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing lounge-node (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 3.3.2)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
Library Manager: Installing FS
Warning! Could not find the package with 'FS' requirements for your system 'linux_aarch64'
Library Manager: Installing Update
Warning! Could not find the package with 'Update' requirements for your system 'linux_aarch64'
Library Manager: Installing ESPmDNS
Warning! Could not find the package with 'ESPmDNS' requirements for your system 'linux_aarch64'
Dependency Graph
|-- <AsyncTCP-esphome> 1.2.2
|-- <WiFi> 1.2.7
|-- <ESPAsyncWebServer-esphome> 2.1.0
|   |-- <AsyncTCP-esphome> 1.2.2
|-- <DNSServer> 1.1.0
Compiling /data/lounge-node/.pioenvs/lounge-node/src/esphome/components/captive_portal/captive_portal.cpp.o
Compiling /data/lounge-node/.pioenvs/lounge-node/src/esphome/components/esp32/gpio_arduino.cpp.o
Compiling /data/lounge-node/.pioenvs/lounge-node/src/esphome/components/md5/md5.cpp.o
Compiling /data/lounge-node/.pioenvs/lounge-node/src/esphome/components/mdns/mdns_component.cpp.o
In file included from /data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-gpio.h:27:0,
                 from src/esphome/components/esp32/gpio_arduino.cpp:5:
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:52:28: fatal error: esp32-hal-uart.h: No such file or directory

************************************************************************
* Looking for esp32-hal-uart.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp32-hal-uart.h"
* Web  > https://platformio.org/lib/search?query=header:esp32-hal-uart.h
*
************************************************************************

compilation terminated.
*** [/data/lounge-node/.pioenvs/lounge-node/src/esphome/components/esp32/gpio_arduino.cpp.o] Error 1
In file included from /data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:35:0,
                 from /piolibs/ESPAsyncWebServer-esphome/src/ESPAsyncWebServer.h:24,
                 from src/esphome/components/web_server_base/web_server_base.h:9,
                 from src/esphome/components/captive_portal/captive_portal.h:10,
                 from src/esphome/components/captive_portal/captive_portal.cpp:3:
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:52:28: fatal error: esp32-hal-uart.h: No such file or directory

************************************************************************
* Looking for esp32-hal-uart.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp32-hal-uart.h"
* Web  > https://platformio.org/lib/search?query=header:esp32-hal-uart.h
*
************************************************************************

compilation terminated.
*** [/data/lounge-node/.pioenvs/lounge-node/src/esphome/components/captive_portal/captive_portal.cpp.o] Error 1
========================== [FAILED] Took 6.88 seconds ==========================

I really have no idea how to proceed here so any help would be much appreciated!

how did you install the ESPHome plugin in ha ? as it looks to run into issues to find all dependencies ? or your HA PI doesn’t have internet access ?
The ESP should be plugged for first flash on computer running ESPHome so on the PI, not your computer :wink:

Just installed from the Supervisor Add-on store. Hmmm - on checking the ESPHome log I’m guessing that the fact that it just stalls at Starting NGINX is a problem…?

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: ESPHome
 ESPHome add-on for intelligently managing all your ESP8266/ESP32 devices
-----------------------------------------------------------
 Add-on version: 2021.11.4
 You are running the latest version of this add-on.
 System: Home Assistant OS 6.6  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2021.8.8
 Home Assistant Supervisor: 2021.10.8
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 20-nginx.sh: executing... 
[cont-init.d] 20-nginx.sh: exited 0.
[cont-init.d] 30-dirs.sh: executing... 
[cont-init.d] 30-dirs.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[21:42:07] INFO: Waiting for dashboard to come up...
[21:42:07] INFO: Starting ESPHome dashboard...
2021-12-11 21:42:09,194 INFO Starting dashboard web server on unix socket /var/run/esphome.sock and configuration dir /config/esphome...
[21:42:09] INFO: Starting NGINX...

This looks good, (it’s the last line you expect from the add-on log) it just “says” things are up and the esphome dashboard is running.

Try a “clean build” in the esphome dashboard to force redownloading all dependencies and to start a build “from scratch”.

Depending on your browser you might be able to use web serial for the first wired flash (now " install") of the esp :bulb:
So essentially it’t plugged in to the computer you are using then and not the the “server” which is running the esphome dashboard :point_left:

AFAIK flashing your ESP directly from your webbrowser will only work if your connection to the HA frontend is SSL secured (HTTPS://, not HTTP://).

If this is not the case for you, you should download the compiled .bin file (Install → Manual download) and flash it using the dedicated ESPHome flasher tool. This tool is available for all major systems:

To record the node, I use Rpi running HA and ESPhome using a USB cable and I’ve never had a problem.

Note: not every USB cable will work fine

Or by setting the unsafely-treat-insecure-origin-as-secure flag for your ha ip/hostname in a chromium based browser to make it work with http.

3 Likes

It should have at least data wires :stuck_out_tongue:

1 Like

I understand that it’s fun, but even USB that also has data wires may not work well.

Oh, great info. Wasn’t aware of that. Thanks!

1 Like

Thanks for all the help everyone. I’ve tried again with the device connected directly to my Pi and I don’t need to hold down the button this way but I still get the same error.

INFO Reading configuration /config/esphome/lounge-node.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing lounge-node (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 3.3.2)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
Library Manager: Installing FS
Warning! Could not find the package with 'FS' requirements for your system 'linux_aarch64'
Library Manager: Installing Update
Warning! Could not find the package with 'Update' requirements for your system 'linux_aarch64'
Library Manager: Installing ESPmDNS
Warning! Could not find the package with 'ESPmDNS' requirements for your system 'linux_aarch64'
Dependency Graph
|-- <AsyncTCP-esphome> 1.2.2
|-- <WiFi> 1.2.7
|-- <ESPAsyncWebServer-esphome> 2.1.0
|   |-- <AsyncTCP-esphome> 1.2.2
|-- <DNSServer> 1.1.0
Compiling /data/lounge-node/.pioenvs/lounge-node/src/esphome/components/captive_portal/captive_portal.cpp.o
Compiling /data/lounge-node/.pioenvs/lounge-node/src/esphome/components/esp32/gpio_arduino.cpp.o
Compiling /data/lounge-node/.pioenvs/lounge-node/src/esphome/components/mdns/mdns_esp32_arduino.cpp.o
Compiling /data/lounge-node/.pioenvs/lounge-node/src/esphome/components/network/util.cpp.o
In file included from /data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-gpio.h:27:0,
                 from src/esphome/components/esp32/gpio_arduino.cpp:5:
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:52:28: fatal error: esp32-hal-uart.h: No such file or directory

************************************************************************
* Looking for esp32-hal-uart.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp32-hal-uart.h"
* Web  > https://platformio.org/lib/search?query=header:esp32-hal-uart.h
*
************************************************************************

compilation terminated.
*** [/data/lounge-node/.pioenvs/lounge-node/src/esphome/components/esp32/gpio_arduino.cpp.o] Error 1
src/esphome/components/mdns/mdns_esp32_arduino.cpp:5:21: fatal error: ESPmDNS.h: No such file or directory

*****************************************************************
* Looking for ESPmDNS.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ESPmDNS.h"
* Web  > https://platformio.org/lib/search?query=header:ESPmDNS.h
*
*****************************************************************

compilation terminated.
*** [/data/lounge-node/.pioenvs/lounge-node/src/esphome/components/mdns/mdns_esp32_arduino.cpp.o] Error 1
In file included from /data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:35:0,
                 from /piolibs/ESPAsyncWebServer-esphome/src/ESPAsyncWebServer.h:24,
                 from src/esphome/components/web_server_base/web_server_base.h:9,
                 from src/esphome/components/captive_portal/captive_portal.h:10,
                 from src/esphome/components/captive_portal/captive_portal.cpp:3:
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:52:28: fatal error: esp32-hal-uart.h: No such file or directory

************************************************************************
* Looking for esp32-hal-uart.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp32-hal-uart.h"
* Web  > https://platformio.org/lib/search?query=header:esp32-hal-uart.h
*
************************************************************************

compilation terminated.
*** [/data/lounge-node/.pioenvs/lounge-node/src/esphome/components/captive_portal/captive_portal.cpp.o] Error 1
In file included from src/esphome/components/network/util.cpp:5:0:
src/esphome/components/wifi/wifi_component.h:13:22: fatal error: WiFiType.h: No such file or directory

******************************************************************
* Looking for WiFiType.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WiFiType.h"
* Web  > https://platformio.org/lib/search?query=header:WiFiType.h
*
******************************************************************

compilation terminated.
*** [/data/lounge-node/.pioenvs/lounge-node/src/esphome/components/network/util.cpp.o] Error 1
========================= [FAILED] Took 28.77 seconds =========================

Something is not right here with my Pi being able to access the internet? I have the same problem when trying to do a manual install.

I have successfully used this cable to install ESPHome via ESP Webtools so I know the cable works.

This has nothing to do with the flashing process. Your compilation fails.
And this log is completely different from the one you posted above.

A very large part of the log is identical though? I have no real idea what’s going on here sorry so apologies if I use the wrong terminology - it’s like it can’t find a heap of files but I don’t know where it should be getting those from. Does it pull them from the internet or should they be part of the local install and my install hasn’t worked properly?

All the needed files are pulled from the internet. Do you have some firewall that is blocking?

Can you post the sketch you are trying to compile.

esphome:
  name: lounge-node
  platform: ESP32
  board: esp32dev

# Enable logging
# logger:

# Enable Home Assistant API
api:

ota:
  password: "53c470e66b085f2805ed6e0d85ee053e"

wifi:
  ssid: "MySSID"
  password: "myWiFiPassword"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Lounge-Node Fallback Hotspot"
    password: "fbQvLlamltA3"

captive_portal:

Could you look to see if any of the build files are there. This way we can see if it’s downloading any files. In your config folder you will find an esphome folder. Navigate to src/esphome. You should see 2 folders and they should also be filed with folders and files. Is there anything there?


ESPHome

And there are files in those folders, not just an empty folder structure? This is a brand new install yes, you have no working nodes? If that is correct just uninstall esphome, then delete the whole esphome folder.

Navigate to supervisor–>system tab–>reboot host. If you’re not on a home assistant os system restart the supervisor, then reinstall.

Yes there are files in those folders. This is pretty weird. I’ll run through the uninstall and re-install later today hopefully. Thanks for your assistance.