Program failed with code 1


i was able before to compile in ESPHome, Now i can’t… from the last time the compile worked, i added the ESPHome integration and change some setting in my router because HA wasn’t able to reach a hostname, so i now use DNSmasq on my er-x with .ubnt.local domain. after that i was able to find it when adding the ESP integration. i installed influxDB and Grafana following this tutorial. i had a voltage of 650V with the default config, so i went to change my gain to a lower one save, validate and then i though about using the OTA update, but just to be sure i click on the litle icon that open the webserver of the ESP32 just to make sure i was uploading to a reachable host. turn out that it failed because it was trying to reach “digi_energy_6c.local” instead of “digi_energy_6c.ubnt.local” i guesses that it was coded like that and i coulnd’t change that so i just change my router domain to .local instead of .ubnt.local. After that i was able to reach the ESP32 with the little light blue button at the right of the screen.

I went to click on upload and it gave me an error code 1. i tried to rechange my domain in router, but wasn’t successful with that. uninstall ESPHome add-on and reinstall, still unsucessful.

here is the log:

Add-on version: 1.18.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 5.13  (amd64 / qemux86-64)
 Home Assistant Core: 2021.6.2
 Home Assistant Supervisor: 2021.06.0
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
[cont-init.d] exited 0.
[cont-init.d] executing... 
[cont-init.d] exited 0.
[cont-init.d] executing... 
[cont-init.d] exited 0.
[cont-init.d] executing... 
[cont-init.d] exited 0.
[cont-init.d] executing... 
[cont-init.d] exited 0.
[cont-init.d] executing... 
[cont-init.d] exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[21:18:44] INFO: Waiting for dashboard to come up...
[21:18:44] INFO: Starting ESPHome dashboard...
INFO Starting dashboard web server on unix socket /var/run/esphome.sock and configuration dir /config/esphome...
[21:18:46] INFO: Starting NGINX...
INFO 304 GET / ( 42.90ms
INFO 101 GET /ace ( 0.68ms
INFO Running command 'esphome --dashboard -q /config/esphome vscode --ace'
INFO 304 GET /edit?configuration=test.yaml ( 4.35ms
INFO 200 POST /edit?configuration=test.yaml ( 2.42ms
INFO 101 GET /compile ( 0.76ms
INFO Running command 'esphome --dashboard /config/esphome/test.yaml compile'
INFO Process exited with return code 1
INFO Reading configuration /config/esphome/test.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/test
Processing test (board: nodemcu-32s; framework: arduino; platform: platformio/[email protected])
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-arduinoespressif32 3.10004.210126 (1.0.4) 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - toolchain-xtensa32 2.50200.97 (5.2.0)
Library Manager: Installing Hash
HTTPClientError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /v3/packages?query=type%3A%22library%22+name%3A%22hash%22 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ffa8c01a630>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')):
  File "/usr/local/lib/python3.7/dist-packages/platformio/builder/", line 177:
  File "/root/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/Script/", line 591:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/root/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/Script/", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/root/.platformio/platforms/espressif32/builder/", line 225:
    target_elf = env.BuildProgram()
  File "/root/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/", line 658:
    return self.method(*nargs, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/platformio/builder/tools/", line 62:
  File "/root/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/", line 658:
    return self.method(*nargs, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/platformio/builder/tools/", line 140:
    project_lib_builder = env.ConfigureProjectLibBuilder()
  File "/root/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/", line 658:
    return self.method(*nargs, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/platformio/builder/tools/", line 1062:
  File "/usr/local/lib/python3.7/dist-packages/platformio/builder/tools/", line 898:
  File "/usr/local/lib/python3.7/dist-packages/platformio/package/manager/", line 49:
    spec, silent=silent, skip_dependencies=skip_dependencies, force=force
  File "/usr/local/lib/python3.7/dist-packages/platformio/package/manager/", line 86:
  File "/usr/local/lib/python3.7/dist-packages/platformio/package/manager/", line 99:
    pkg = self.install_from_registry(spec, search_filters, silent=silent)
  File "/usr/local/lib/python3.7/dist-packages/platformio/package/manager/", line 88:
    packages = self.search_registry_packages(spec, search_filters)
  File "/usr/local/lib/python3.7/dist-packages/platformio/package/manager/", line 135:
    return self.get_registry_client_instance().list_packages(filters=filters)[
  File "/usr/local/lib/python3.7/dist-packages/platformio/clients/", line 131:
    "get", "/v3/packages", params=params, cache_valid="1h"
  File "/usr/local/lib/python3.7/dist-packages/platformio/clients/", line 144:
    response = self.send_request(method, path, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/platformio/", line 73:
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/platformio/clients/", line 131:
    raise HTTPClientError(str(e))
========================= [FAILED] Took 13.26 seconds =========================

It looks like a dns error. It might just be a random thing. Give it another try. If it still fails maybe disable dnsmasq. Also esp don’t work well with a .local address it’s a known issue. Setting and using a static ip is recommended.

already tried to disable everything i added in my router config: dnsmasq, mdns, and domain reboot router and vm that run HA. it’s been close to 24 hours that it hasn’t been working.

i also just recall that i change my dns setting a little bit. before there was something, either Granafa, influxDB, ESPhome integration or ESPhome addon that wasn’t finding the ESP32 on my network with .ubnt.local and i realised that having a primary dns of and secondary dns of would resoul in cloudflaire saying there is no digi_energy_6c.ubnt.local registered and returned a dns error. So i swap my primary dns to and secondary dns to and after that it found the digi_energy_6c. do you think that could have been the problem? i can try put as primary again.

when talking about setting and using static ip, are you talking about the yaml file that i’m trying to compile or the home assistant itself and IOT device? Because everything except phone are using “DHCP reservation” so nothing is changing ip ever (use an ER-X)

I believe it’s a problem on the esp itself. So set it manually in the upload file like so

# Example configuration entry
  ssid: MyHomeNetwork
  password: VerySafePassword

  # Optional manual IP

Have you tried again? Post your sketch and I will see if it complies on my machine.

setting it to static didn’t worked. I also went to the config via visual studio and saw that when i delete a node it didn’t delete it in the config. So i uninstalled ESPHome and after that deleted the folder structure “esphome” in the config, then i installed ESPHome created my first node and went to edit it, but i saw only 1 line : “404: not found” in the box. i think that it should have a default config with the wifi setup in the wizard. also when making change and saving if i click on edit again i see that it did not refresh it it’s still 404 not found. i need to go out of ESPHome addon and back in to see it refresh.

i also notice that in the config i see 2 digi_energy_6c. one is .yaml and one is .yaml.json and

Please post the contents of digi_energy_6c.yaml not a screenshot. See the sticky at the top of the forum for a guide to post code.

sorry, it wan’t for people to show the detail of the code, but just to show that they were different inside. If you want the full detail of those, i’ve put them below


  "storage_version": 1,
  "name": "digi_energy_6c",
  "comment": null,
  "esphome_version": "1.18.0",
  "src_version": 1,
  "arduino_version": "platformio/[email protected]",
  "address": "digi_energy_6c.local",
  "esp_platform": "ESP32",
  "board": "nodemcu-32s",
  "build_path": "/config/esphome/digi_energy_6c",
  "firmware_bin_path": "/data/digi_energy_6c/.pioenvs/digi_energy_6c/firmware.bin",
  "loaded_integrations": [


  name: digi_energy_6c
  platform: ESP32
  board: nodemcu-32s

  ssid: "Andre_IOT"
  password: "secret"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
    ssid: "Digi Energy 6C Fallback Hotspot"
    password: "pX0CWY42RI9Q"


# Enable logging

# Enable Home Assistant API