Error esphome compile

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.

Hi, now I went through all my add-ons and stopped the ones I don’t need to have enough RAM memory. And this was the solution!
So, I recommend to stop all components which are not important for the moment and run the compilation. For example: Grafana, Home Assistant Google… and after compiling in ESPHome you can start them again.

Totally true, I thought I had 2G rasp4 but It looks I have 1G and it is why as you said i don’t have enough ram memory.

I have the exact problem. Also, I don’t think this is a RAM problem. I added the system monitor add-on, and it might just be an overheating problem, RAM seems fine.

So as a workaround, I installed esphome to my macbookair and from the terminal I went to the esphome folder over samba and tried to compile my yaml file there from the command line and it didn’t work. I then copied my yaml esphome project file to a local folder and tried to compile it there and it worked.

This is what the error shows like from the esphome folder at homeassistant:

Compiling .pioenvs/lgtv-controller/lib37d/ESPAsyncTCP-esphome/ESPAsyncTCP.cpp.o
Compiling .pioenvs/lgtv-controller/lib37d/ESPAsyncTCP-esphome/ESPAsyncTCPbuffer.cpp.o
Archiving .pioenvs/lgtv-controller/lib788/libESP8266WiFi.a
xtensa-lx106-elf-ar: .pioenvs/lgtv-controller/lib788/libESP8266WiFi.a: error reading .pioenvs/lgtv-controller/lib788/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o: Is a directory
*** [.pioenvs/lgtv-controller/lib788/libESP8266WiFi.a] Error 1
Compiling .pioenvs/lgtv-controller/lib37d/ESPAsyncTCP-esphome/SyncClient.cpp.o

However this error is much later in the compile. When I compile at homeassistant mine gets stuck at the 4th line as well.

I thought this might also be a problem that’s in the esphome folder in the homeassitant. I copied the homeassistant esphome folder to local and did a compile on it locally but it worked this time, so folder is fine I guess. I will backup the homeassistant esphome folder and create a fresh one and place the project yaml there and try to compile again. Also I was able to succesfully do a compile in homeassistant once while using a handheld blower blowing air to my raspberry pi3b. I ordered an ice tower in hopes to avoid this overheating issue. I will let you know how that works too.

This also might be related to this problem as well:
https://community.home-assistant.io/t/home-assistant-just-stops-working/300865

I believe I solved the compile freeze problem.

It seems to be an overheating issue.
I believe installing an Ice Tower Cooler fixed the issue.
The nice thing was that I was able to use it with the original pi case by trimming a bit of the mounting plastics in the case.
This is what it looks like now after installing it.

It came with a transparent fan with multi-color LEDs, which was a bit noisy and used ~40mA @5V. This fan came already installed on the cooler.
The package also included an additional noiseless fan without LEDs which used ~20mA @5V. I replaced the transparent one with this better fan.

This is how my Pi 3B+ processor temperature looked like before installing the Ice Tower Cooler, averaging at 54 °C.

And this is how it looks like after installing the cooler, averaging at 34°C.

The cooler made a big difference in the temperature, which is about -20°C. You can see the temperature spike on the picture above where I was able to successfully compile after installing the cooler. It seems that compilation creates an additional 8°C. Adding 8 to 54 you get 64, which apparently was enough for the pi to go crazy.