Open spitfire opened 1 year ago
You didn't include the logs. If you haven't modified the main.cpp
file, then try a clean build.
@ssieb which logs should I include? How do I start a clean build?
The compile logs, wherever you're seeing that error message. In the menu, there's an option to clean the build files.
Tried cleaning build files, the issue persists. Here's the log output for installation:
INFO Reading configuration /config/esphome/foxess-inverter.yaml...
WARNING GPIO4 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Generating C++ source...
ERROR Could not find auto generated code begin in file, either delete the main sketch file or insert the comment again.
@ssieb Any idea what that is? my other ESPHome devices seem to be updating fine, so it's probably a matter of some component used in this one.
I have 2 devices doing this now.
@spitfire do you use the custom component in any other devices? Can you attach the main.cpp
here if you can find it? I think the data directory is accessible from the HA base OS.
@huenemeca are you using any custom components in those devices? Same request as well for the main.cpp
file.
@spitfire do you use the custom component in any other devices? Can you attach the
main.cpp
here if you can find it? I think the data directory is accessible from the HA base OS. @huenemeca are you using any custom components in those devices? Same request as well for themain.cpp
file.
All that I have in that project is the yaml file with content pasted in bug description along with the header (.h) file (from https://github.com/assembly12/Foxess-T-series-ESPHome-Home-Assistant/blob/main/foxess_t_series.h) next to it, there is no .cpp file in there (the only C++ code is in the yaml, which I'm attaching here: foxess-inverter.yaml.zip). This project used to compile with ESPHome 2023.4.*
You have to get it from the build directory.
It doesn't even create one. After I've cleaned last build files (as suggested earlier) it doesn't create a new one. All other projects' files are there:
homeassistant01# pwd
/usr/share/hassio/addons/data/5c53de3b_esphome
homeassistant01# ls -l
total 4
drwxr-xr-x 1 root root 20 Apr 26 16:10 cache
drwxr-xr-x 1 root root 38 May 25 13:13 esp32-gabinet
drwxr-xr-x 1 root root 38 May 25 13:13 esp32-kotlownia
-rw------- 1 root root 2 May 29 03:24 options.json
drwxr-xr-x 1 root root 38 May 25 13:14 poziomwody-test
drwxr-xr-x 1 root root 38 May 25 13:14 t-can485-foxess
drwxr-xr-x 1 root root 38 May 29 09:41 ttgo01
drwxr-xr-x 1 root root 38 May 25 13:14 ttgo-dongle01
drwxr-xr-x 1 root root 38 May 29 09:42 ttgo-tdisplay-s3-01
drwxr-xr-x 1 root root 38 Apr 27 13:29 wodomierz
I guess it fails when generating source.
Anything else I can check?
I am also getting this error with this very simple config:
substitutions:
device_name: porch-light
esphome:
name: porch-light
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 10.0.0.208
gateway: 10.0.0.1
subnet: 255.255.255.0
dns1: 10.0.0.60
dns2: 8.8.8.8
#fast_connect: true
ap:
ssid: "Porch-Light Fallback Hotspot"
password: !secret wifi_password
# Enable logging
logger:
# default is DEBUG
#level: VERBOSE
# Enable Home Assistant API
api:
ota:
web_server:
switch:
- platform: restart
name: "Porch Light Restart"
- name: "Porch Light"
platform: gpio
pin: GPIO4
id: relay
#restore_mode: ALWAYS_OFF
sensor:
- platform: uptime
name: "Porch Light Uptime"
update_interval: 60s
- platform: wifi_signal
name: "Porch Light WiFi Signal"
update_interval: 60s
binary_sensor:
- platform: gpio
name: Porch Light Switch
pin: GPIO5
on_press:
then:
- switch.turn_on: relay
on_release:
then:
- switch.turn_off: relay
I've deleted all additional files besides the yaml in an effort to diagnose, and clean build as well, no change.
EDIT: Renaming Hostname in the UI allowed me to compile and flash, but cannot rename back to the old name afterwards.
Still doesn't work, and hasn't been for 3 months now. Anything else I can try?
I also got this error. Any fixes or causes? It seams that the generation crashes.
> INFO ESPHome 2023.10.0
> INFO Reading configuration /config/esphome/inside-garage.yaml...
> INFO Generating C++ source...
> ERROR Could not find auto generated code begin in file, either delete the main sketch file or insert the comment again.
While cleaning the build files didn't help renaming hostname in ESPHome did ¯_(ツ)_/¯
Now I also got this error, but I was able to fix it without changing the hostname. I think my problem started with switching different versions of ESP-IDF.
Cleaning the build files has left some remains inside the build directory. Deleting the whole subdirectory of the device inside the build directory did the magic - my device now compiles fine again.
e.g.:
build path: esphome/.esphome/build
device name: foxess-inverter
-> delete directory (and everything inside): esphome/.esphome/build/foxess-inverter
The problem
I'm getting:
ERROR Could not find auto generated code begin in file, either delete the main sketch file or insert the comment again.
I used to be able to compile it with versions <= 2023.4.0, but now it is failing.Which version of ESPHome has the issue?
2023.4.1
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2023.4.6
What platform are you using?
ESP32
Board
esp32dev
Component causing the issue
No response
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
The referenced/included .h file can be found at https://github.com/assembly12/Foxess-T-series-ESPHome-Home-Assistant/blob/main/foxess_t_series.h and also has not been changed.