Error esphome compile

Hi,
I’ve been working with esphome in several projects but I’ve tried to compile and upload a new nodemcu but with only compiling It gets stuck compiling… and HA restarts.

had Anyone this problem before? and how to fix it?

`Library Manager: Installing Update
Library Manager: Already installed, built-in library
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.7
|   |-- <ESPAsyncTCP-esphome> 1.2.3
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
Compiling /data/esp8266/.pioenvs/esp8266/lib3b6/ESPAsyncWebServer-esphome/SPIFFSEditor.cpp.o
Compiling /data/esp8266/.pioenvs/esp8266/lib3b6/ESPAsyncWebServer-esphome/WebRequest.cpp.o
Compiling /data/esp8266/.pioenvs/esp8266/lib3b6/ESPAsyncWebServer-esphome/WebResponses.cpp.o
Compiling /data/esp8266/.pioenvs/esp8266/lib3b6/ESPAsyncWebServer-esphome/WebServer.cpp.o`

What type of machine is the HA and esphome running? I have seen such an issue occur with devices which have less ram and processing capacity.

Hi,

I use RPI4, with 4GB and ssd.
Everything goes well less this.

BR

Then it should not be a problem as I also run the setup in a similar platform. Please check if the system is having the correct power supply and there is no power supply problems?

Also check how much processor usage is there. if this is high, then the system could stall.

Hi,

i don’t think so, 4Amps with original power supply.

And RAM is on 26%

This is what i have in logs, I think it is something related with DNS… I don’t know

21-04-12 12:47:39 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-9088' coro=<_websocket_forward() done, defined at /usr/src/supervisor/supervisor/api/ingress.py:269> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/api/ingress.py", line 278, in _websocket_forward
    await ws_to.ping()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_ws.py", line 287, in ping
    await self._writer.ping(message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 673, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 650, in _send_frame
    self._write(header + message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 660, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
21-04-12 12:47:40 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-9062' coro=<_websocket_forward() done, defined at /usr/src/supervisor/supervisor/api/ingress.py:269> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/api/ingress.py", line 278, in _websocket_forward
    await ws_to.ping()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_ws.py", line 287, in ping
    await self._writer.ping(message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 673, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 650, in _send_frame
    self._write(header + message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 660, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
21-04-12 12:51:20 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.RUNNING
21-04-12 12:51:20 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete

Can you try compiling a very basic script in esphome? I mean just the basic things like wifi, web server, api, ota

Hi,

This is what I did:

esphome:
  name: level
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "MiFibra-0B4A"
  password: "xxxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Level Fallback Hotspot"
    password: "aPm9IaOFCFXM"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

You said that you have worked with esphome before also, Do you have those scripts in this installation? Can you try to compile any one of them?

I have it in a nodemcu but I restarted from the scratch HA and this configuration was erased in esphome but it works as MQTT.

In that case it could be somethin related with the new setup. i have seen such cases in the community before also. please search for esphome error in community and i think you can find more threads on the issue.

In the meantime i will also do my research and get back.

You could try the dev (development) version of ESPHome. It contains fixes not yet released.

Hi

It gives me the same error with dev, i think it is something related with DNS server because it is what is getting problems when it it compiling…
@sheminasalam I looked for before creating this topic but the error was different.

> INFO Reading configuration /config/esphome/lev.yaml...
> INFO Generating C++ source...
> INFO Core config or version changed, cleaning build files...
> INFO Compiling app...
> INFO Running:  platformio run -d /config/esphome/lev
> Processing lev (board: nodemcuv2; framework: arduino; platform: platformio/[email protected])
> --------------------------------------------------------------------------------
> HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
> PACKAGES: 
>  - framework-arduinoespressif8266 3.20704.0 (2.7.4) 
>  - tool-esptool 1.413.0 (4.13) 
>  - tool-esptoolpy 1.20800.0 (2.8.0) 
>  - toolchain-xtensa 2.40802.200502 (4.8.2)
> Library Manager: Installing ESPAsyncTCP-esphome @ 1.2.3
> Library Manager: ESPAsyncTCP-esphome @ 1.2.3 has been installed!
> Library Manager: Installing ESPAsyncWebServer-esphome @ 1.2.7
> Library Manager: ESPAsyncWebServer-esphome @ 1.2.7 has been installed!
> Library Manager: Installing dependencies...
> Library Manager: Installing AsyncTCP-esphome
> Library Manager: AsyncTCP-esphome @ 1.2.1 has been installed!
> Library Manager: Installing Hash
> Library Manager: Already installed, built-in library
> Library Manager: Installing Update
> Library Manager: Already installed, built-in library
> Dependency Graph
> |-- <ESPAsyncTCP-esphome> 1.2.3
> |   |-- <ESP8266WiFi> 1.0
> |-- <ESP8266WiFi> 1.0
> |-- <ESP8266mDNS> 1.2
> |   |-- <ESP8266WiFi> 1.0
> |-- <ESPAsyncWebServer-esphome> 1.2.7
> |   |-- <ESPAsyncTCP-esphome> 1.2.3
> |   |   |-- <ESP8266WiFi> 1.0
> |   |-- <Hash> 1.0
> |   |-- <ESP8266WiFi> 1.0
> |-- <DNSServer> 1.1.1
> |   |-- <ESP8266WiFi> 1.0
> Compiling /data/lev/.pioenvs/lev/src/esphome/components/api/api_connection.cpp.o
> Compiling /data/lev/.pioenvs/lev/src/esphome/components/api/api_pb2.cpp.o
> Compiling /data/lev/.pioenvs/lev/src/esphome/components/api/api_pb2_service.cpp.o
> Compiling /data/lev/.pioenvs/lev/src/esphome/components/api/api_server.cpp.o

Hi,

Any Idea? I’ve been checking so many things but always get stuck compiling and restart HA.

Thanks,

I don’t think it is really an esphome issue. The errors you are showing have something to do with the HA supervisor. Maybe open an issue?

Hi,
has anybody found a solution? I have exactely the same issue. Compiling stops exactly at the same point:

> Compiling /data/kohlendioxid/.pioenvs/kohlendioxid/src/esphome/components/api/proto.cpp.o

After this error the system breaks down and HA is not reachable. I have to unplug to restart.
I don’t actually know from which moment on this error appears. I compiled with ESP Home several entities without problems.

Make sure that you have at least 500Mb of memory free. I had the same issue and after hours of testing and trying and doing research, the problem was that I didn’t have enough memory free when compiling.

Hi, thnx, I will try

Hi @laca75tn ,

I have more than 100GB free, I use a SSD disk so it is not my case. Any other idea?

Sistema operatiu amfitrió Home Assistant OS 5.13
Canal d’actualització stable
Versió del Supervisor supervisor-2021.04.3
Versió de Docker 19.03.15
Total disc 109.3 GB
Emmagatzematge utilitzat 21.6 GB
Saludable true
Compatible true
Placa rpi4-64
API del Supervisor ok
Versió d’APIs ok
Complements instal·lats Samba share (9.3.1), File editor (5.2.0), Grafana (6.1.3), Home Assistant Google Drive Backup (0.103.1), IDE (2.2.0), MariaDB (2.2.2), Mosquitto broker (5.1.1), Terminal & SSH (9.1.0), Zigbee2mqtt (1.18.1-1), ESPHome (1.17.0), ESPHome (dev) (dev)

Hi @Lars72
That’s exactly what is happening in my case. In esphome issues they said as well it is a cpu+ram issue.

This is an issue with the amount of RAM memory not disk space. You need at least 500MB of free RAM memory at the time that you are compiling your EspHome node.