Errors on Esphome Updates

Good Day,

I have a problem lately when upgrading my EspHome devices, I get these errors, what do I need to change?

My system is up to date in all respocts, I cant update those two components in esphome.

The other message is that esptool.py is deprecated, maybe they could be related.

Here is the top part of the yaml, similar for both:

esphome:
  name: sinsink
  friendly_name: sinsink

esp32:
  board: nodemcu-32s
  framework:
    type: arduino




# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

ota:
  - platform: esphome
    password: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "sinsink Fallback Hotspot"
    password: "xxxxxxxxxxxx"
web_server:
  port: 80
captive_portal:

Regards
Caswell

It is not. It is depreciated but still works for now.

What hardware are you trying to compile on?

A Raspberry Pi?

If so you likely do not have enough system resources.

Try this

esphome:
  name: sinsink
  friendly_name: sinsink
  compile_process_limit: 1  # <--- Add this

Put more memory in your system? What hardware are you using and what type of installation? :thinking:

Did you already check the system monitor when compiling? You might find your limiting factor easily this way :raised_hands:

I am using a virtual machine, I host my HA on a virtual box virtual machine, the components are getting info via modbus from a sunsynk inverter.

The line fixed it, but I seem to have bricked my esphome sprinklers, not related though … :slight_smile:

The you need to give your VM more cores and RAM.

The sprinkler transformer was toast, after the sprinkler component update all the sprinklers turned ON at the same time (the UI shows them as OFF) when it restarts exceeding the transformer rating, I had to buy a new transformer and split the sprinklers via a separate N/O N/C relay to prevent them from drawing too much current. The problem of sprinkler relays turning ON when the component restarts persists though, I just found a way to minimise the current.

Is there a way to run an automation after the update of an esphome component, what can I add in the yaml, I want to run an automation to toggle the sprenklers ON and OFF after an update or a restart of the system, this ensures that they are all OFF. Not sure why suddenly my sprinkler relays turn ON (but show OFF on the UI) after restart of the component.

esphome:
  name: sprinklerz_system
  #platform: ESP8266
  #board: nodemcuv2
  includes:
    - shift_register_switch.h
  libraries:
    - [email protected]
esp8266:
  board: nodemcuv2

external_components:
  - source:
      type: git
      url: https://github.com/robertklep/esphome-custom-component
    components: [custom, custom_component]
switch:
  - platform: custom
    lambda: |-
      const int data_pin = D5;
      const int clock_pin = D6;
      const int latch_pin = D7;
      auto shift_register = new ShiftRegister74HC595(data_pin, clock_pin, latch_pin, 2);
      for (int i = 0; i < 16; i++) {
        shift_register->set(i, true);
      }
      
      std::vector<switch_::Switch *> switches;
      for(int i = 0; i < 16; i++) {
          auto zone_switch = new ShiftRegisterSwitch(i);
          App.register_component(zone_switch);
          switches.push_back(zone_switch);
      }
      return switches;
    switches:
      -  name: "Sprinkler Zone 1"
         inverted: yes
      -  name: "Sprinkler Zone 2"
         inverted: yes
      -  name: "Sprinkler Zone 3"
         inverted: yes
      -  name: "Sprinkler Zone 4"
         inverted: yes
      -  name: "Sprinkler Zone 5"
         inverted: yes
      -  name: "Sprinkler Zone 6"
         inverted: yes
      -  name: "Sprinkler Zone 7"
         inverted: yes
      -  name: "Sprinkler Zone 8"
         inverted: yes
      -  name: "Sprinkler Zone 9"
         inverted: yes
      -  name: "Sprinkler Zone 10"
         inverted: yes
      -  name: "Sprinkler Zone 11"
         inverted: yes
      -  name: "Sprinkler Zone 12"
         inverted: yes
      -  name: "Sprinkler Zone 13"
         inverted: yes
      -  name: "Sprinkler Zone 14"
         inverted: yes
      -  name: "Sprinkler Zone 15"
         inverted: yes
      -  name: "Sprinkler Zone 16"
         inverted: yes         

# Enable logging
logger:

# Enable Home Assistant API
api:


status_led:
    pin: 16
    
text_sensor:
  - platform: version
    name: esphome_sprinkler_system_esphome_version    

ota:
  - platform: esphome 
    password: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

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

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

captive_portal:

You can automate something with the on_boot action`.

https://esphome.io/components/esphome/

This looks like a case of less than optimal hardware design. You are using a shift register to control your relays. The relays turn on when the output is low (zero). The initial state of most shift registers on reset is zero (all outputs low). This means all relays will be ON and all sprinklers will also be on.

If you can’t or don’t want to change the HW, you can work around the problem using SW. They will still turn on on reset, but you can turn them off as soon as the software is ready. That might be good enough.

With limited resources as we see…

TL;DR esphome compile process gets killed to guarantee system stability because of limit

From the almighty esphome docs :open_book:

early_pin_init (Optional, boolean): Specifies whether pins should be initialised as early as possible to known values. Recommended value is false where switches are involved, as these will toggle when updating the firmware or when restarting the device. Defaults to true.

So you don’t need to fry other things in the future :rocket:

Good Morning ,

@tom_l

The problem of the esphome component not updating is back, only happens for my modbus connected component, here is the error log, and below is part of the yaml:


##########################yaml###################


esphome:
  name: sincity
  friendly_name: sincity
  compile_process_limit: 1

esp32:
  board: nodemcu-32s
  framework:
    type: arduino




# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "%%%%%%%%%%%%%%%%%%%%%%%%%%"

ota:
  - platform: esphome
    password: "%%%%%%%%%%%%%%%%%%%%%%%%%%%"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "sincity Fallback Hotspot"
    password: "%%%%%%%%%%%"
web_server:
  port: 80
captive_portal:

The rest of the yaml cant fit
      
    ```

Different problem. Delete the add-on with the clear data option. Re-install the add-on. You won’t lose anything.

Thank you, that worked, all components can update now.

2 Likes