SP111 used to compile up until now

INFO Reading configuration /config/esphome/Rack.yaml...
WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
INFO Detected timezone 'Europe/Brussels'
WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
INFO Generating C++ source...
INFO Compiling app...
Processing rack (board: esp8285; framework: arduino; platform: platformio/espressif8266 @ 2.6.3)
--------------------------------------------------------------------------------
Platform Manager: Installing platformio/espressif8266 @ 2.6.3
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Platform Manager: espressif8266 @ 2.6.3 has been installed!
The platform 'platformio/espressif8266 @ 2.6.3' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.
Tool Manager: Installing platformio/toolchain-xtensa @ ~2.40802.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: toolchain-xtensa @ 2.40802.200502 has been installed!
Tool Manager: Installing platformio/framework-arduinoespressif8266 @ ~2.20501.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: framework-arduinoespressif8266 @ 2.20501.190515 has been installed!
Tool Manager: Installing platformio/tool-esptool @ <2
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-esptool @ 1.413.0 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.30000.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%
Tool Manager: tool-esptoolpy @ 1.30000.201119 has been installed!
Tool Manager: Installing platformio/tool-scons @ ~4.40200.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%
Tool Manager: framework-arduinoespressif8266 @ 2.20501.190515 has been installed!
Tool Manager: Installing platformio/tool-esptool @ <2
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-esptool @ 1.413.0 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.30000.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%
Tool Manager: tool-esptoolpy @ 1.30000.201119 has been installed!
Tool Manager: Installing platformio/tool-scons @ ~4.40200.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%
Tool Manager: tool-scons @ 4.40200.0 has been installed!
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncWebServer-esphome> 2.0.0
|   |-- <ESPAsyncTCP-esphome> 1.2.3
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ArduinoJson-esphomelib> 5.13.3
|-- <ESP8266WiFi> 1.0
|-- <ArduinoJson-esphomelib> 5.13.3
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <noise-c> 0.1.4
|   |-- <libsodium> 1.10018.1
Compiling /data/rack/.pioenvs/rack/src/esphome/components/adc/adc_sensor.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/api/api_connection.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/api/api_frame_helper.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/api/api_pb2.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/api/api_pb2_service.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/api/api_server.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/api/list_entities.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/api/proto.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/api/subscribe_state.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/api/user_services.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/api/util.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/binary_sensor/automation.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/binary_sensor/binary_sensor.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/binary_sensor/filter.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/esp8266/core.cpp.o
Compiling /data/rack/.pioenvs/rack/src/esphome/components/esp8266/gpio.cpp.o
src/esphome/components/esp8266/core.cpp:11:20: error: expected initializer before 'yield'
 void IRAM_ATTR HOT yield() { ::yield(); }
                    ^
src/esphome/components/esp8266/core.cpp:12:24: error: expected initializer before 'millis'
 uint32_t IRAM_ATTR HOT millis() { return ::millis(); }
                        ^
src/esphome/components/esp8266/core.cpp:13:20: error: expected initializer before 'delay'
 void IRAM_ATTR HOT delay(uint32_t ms) { ::delay(ms); }
                    ^
src/esphome/components/esp8266/core.cpp:14:24: error: expected initializer before 'micros'
 uint32_t IRAM_ATTR HOT micros() { return ::micros(); }
                        ^
src/esphome/components/esp8266/core.cpp:15:20: error: expected initializer before 'delayMicroseconds'
 void IRAM_ATTR HOT delayMicroseconds(uint32_t us) { ::delayMicroseconds(us); }
                    ^
src/esphome/components/esp8266/core.cpp:23:20: error: expected initializer before 'arch_feed_wdt'
 void IRAM_ATTR HOT arch_feed_wdt() {
                    ^
*** [/data/rack/.pioenvs/rack/src/esphome/components/esp8266/core.cpp.o] Error 1
src/esphome/components/esp8266/gpio.cpp: In member function 'virtual void esphome::esp8266::ESP8266GPIOPin::attach_interrupt(void (*)(void*), void*, esphome::gpio::InterruptType) const':
src/esphome/components/esp8266/gpio.cpp:43:51: error: 'attachInterruptArg' was not declared in this scope
   attachInterruptArg(pin_, func, arg, arduino_mode);
                                                   ^
src/esphome/components/esp8266/gpio.cpp: At global scope:
src/esphome/components/esp8266/gpio.cpp:88:16: error: expected initializer before 'ISRInternalGPIOPin'
 bool IRAM_ATTR ISRInternalGPIOPin::digital_read() {
                ^
src/esphome/components/esp8266/gpio.cpp:92:16: error: expected initializer before 'ISRInternalGPIOPin'
 void IRAM_ATTR ISRInternalGPIOPin::digital_write(bool value) {
                ^
src/esphome/components/esp8266/gpio.cpp:96:16: error: expected initializer before 'ISRInternalGPIOPin'
 void IRAM_ATTR ISRInternalGPIOPin::clear_interrupt() {
                ^
*** [/data/rack/.pioenvs/rack/src/esphome/components/esp8266/gpio.cpp.o] Error 1
========================= [FAILED] Took 89.82 seconds =========================

Try doing a make clean and trying again.

Tried, even tried installing the beta, but no luck.

Changed configuration now it compiles

 arduino_version: 2.7.2
  #arduino_version: 2.5.1

For those who want a working configuration for SP111

substitutions:
  devicename: "rack"
  upper_devicename: "Gosund SP111"
  # Higher value gives lower watt readout
  current_res: "0.00237"
  # Lower value gives lower voltage readout
  voltage_div: "720"
  wifi_ssid: !secret iot_wifi_ssid
  wifi_pass: !secret iot_wifi_password
  fallback_pass: !secret fallback_wifi_password
  api_pass: !secret esp_api_password
  ota_pass: !secret esp_ota_password
  webserver_username: !secret webserver_username
  webserver_password: !secret webserver_password
  
esphome:
  name: $devicename
  platform: ESP8266
  arduino_version: 2.7.2
  #arduino_version: 2.5.1
  board: esp8285

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  password: "${api_pass}"

# Enable over the air updates
ota:
  password: "${ota_pass}"

wifi:
  ssid: "${wifi_ssid}"
  password: "${wifi_pass}"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${devicename} Fallback Hotspot"
    password: "${fallback_pass}"

# see: https://esphome.io/components/time.html
time:
  - platform: homeassistant
    id: homeassistant_time

# Enable Web server
web_server:
  port: 80
  auth:
    username: ${webserver_username}
    password: ${webserver_password}
    
text_sensor:
  - platform: version
    name: "${devicename} - Version"
    icon: mdi:cube-outline

binary_sensor:
  - platform: status
    name: "${devicename} - Status"
    device_class: connectivity

  # toggle relay on/off
  - platform: gpio
    pin:
      number: GPIO13
      mode: INPUT_PULLUP
      inverted: True
    id: "${devicename}_button_state"
    on_press:
      - switch.toggle: button_switch

sensor:
  - platform: wifi_signal
    name: "${devicename} - Wifi Signal"
    update_interval: 60s
    icon: mdi:wifi

  - platform: uptime
    name: "${devicename} - Uptime"
    update_interval: 60s
    icon: mdi:clock-outline

  - platform: total_daily_energy
    name: "${devicename} - Todays Usage"
    power_id: "power_wattage"
    filters:
      # Multiplication factor from W to kW is 0.001
      - multiply: 0.001
    unit_of_measurement: kWh
    icon: mdi:calendar-clock

  - platform: adc
    pin: VCC
    name: "${devicename} - VCC Volt"
    icon: mdi:flash-outline

  - platform: hlw8012
    sel_pin:
      number: GPIO12
      inverted: True
    cf_pin: GPIO05
    cf1_pin: GPIO04
    change_mode_every: 4
    current_resistor: ${current_res}
    voltage_divider: ${voltage_div}
    update_interval: 3s

    current:
      name: "${devicename} - Ampere"
      unit_of_measurement: A
      accuracy_decimals: 3
      icon: mdi:current-ac

    voltage:
      name: "${devicename} - Volt"
      unit_of_measurement: V
      accuracy_decimals: 1
      icon: mdi:flash-outline

    power:
      name: "${devicename} - Watt"
      unit_of_measurement: W
      id: "power_wattage"
      icon: mdi:gauge

status_led:
  pin:
    number: GPIO00
    inverted: True
  id: led_red

output:
  - platform: gpio
    pin: GPIO02
    inverted: True
    id: led_blue

switch:
  - platform: template
    name: "${devicename} - Switch"
    icon: mdi:power
    optimistic: true
    id: button_switch
    turn_on_action:
      - switch.turn_on: relay
    turn_off_action:
      - switch.turn_off: relay
  - platform: gpio
    pin: GPIO15
    id: relay
    on_turn_on:
      - output.turn_on: led_blue
    on_turn_off:
      - output.turn_off: led_blue

edit: chosen 2.7.2 because that worked with my other chips, … there’s no other particular reason. Just checked not defining a version also works. So maybe it’s better just to remove arduino_version all together.

1 Like

Unless you have a reason to pin arduino_version just leave it out.

1 Like

Thank you! I believe I had this from some sample core or another, a few of my devices had it pinned (to an ancient 2.4.4) and I got this error after updating ESPHome. Removed the pin and now I’m happily compiling again :slight_smile:

1 Like