I’m having some trouble writing code to an ESP8226 D1 Mini clone and my search has drawn a blank. I have written the initial flash to the 3 devices I have using ESPHome web tool, and I can visit at least one of them over wifi now (this took a long time waiting to happen though) but whenever I try to write the default yaml from ESPHome in HA i get the following error:-
INFO ESPHome 2024.9.1
INFO Reading configuration /config/esphome/esphome-web-ccab54.yaml…
INFO Generating C++ source…
INFO Compiling app…
Processing esphome-web-ccab54 (board: esp01_1m; framework: arduino; platform: platformio/[email protected])
Tool Manager: Could not parse manifest > Expecting value: line 1 column 1 (char 0)
WARNING Could not parse manifest > Expecting value: line 1 column 1 (char 0)
InvalidJSONFile: Could not load broken JSON: /data/cache/platformio/packages/tool-esptool/.piopm
I read a post somewhere suggesting deleting some cache files but couldn’t figure out how to navigate there (I checked in terminal and couldnn’t find the directory). Is there an easy fox for this? It happens however I connect to the device e.g. over wifi, connected to PC, connected to HA server (rpi 4b 2gb). Any help would be greatly appreciated.
It’s the HA generated default code with no modifications. I did try changing the board type to D1_mini but it made no difference. I also tried adding the host and password in the wifi section but had same issue.
Code as requested…
substitutions:
name: esphome-web-ccab54
friendly_name: Room_Temp_DS
esphome:
name: ${name}
friendly_name: ${friendly_name}
min_version: 2024.6.0
name_add_mac_suffix: false
project:
name: esphome.web
version: dev
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
- platform: esphome
# Allow provisioning Wi-Fi via serial
improv_serial:
wifi:
# Set up a wifi access point
ap: {}
# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:
dashboard_import:
package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main
import_full_config: true
# To have a "next url" for improv serial
web_server:
I’ve tried cutting my code down to the bare minimum to see if that helps. Sadly it doesn’t.
New code…
esphome:
name: esphome-web-ccab54
friendly_name: Room_Temp_DS
platform: ESP8266
board: d1_mini
wifi:
# Set up a wifi access point
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable logging
logger:
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
- platform: esphome
# Allow provisioning Wi-Fi via serial
improv_serial:
# To have a "next url" for improv serial
web_server:
By removing the webserver line and flashing I managed to removed the “visit” button from the ESPhome card for that device, and re-adding the line put it back. Similarly I can turn dissable logging by removing lines so I assume something is changing on the device but I still get the error.
Here is the log, if it helps:-
INFO ESPHome 2024.9.1 INFO Reading configuration /config/esphome/esphome-web-ccab54.yaml...
INFO Starting log output from 192.168.68.105 using esphome API
INFO Successfully connected to esphome-web-ccab54 @ 192.168.68.105 in 0.004s
INFO Successful handshake with esphome-web-ccab54 @ 192.168.68.105 in 0.011s
[11:23:31][I][app:100]: ESPHome version 2024.7.3 compiled on Aug 4 2024, 21:14:25
[11:23:31][I][app:102]: Project esphome.web version 24.8.3
[11:23:31][C][wifi:599]: WiFi:
[11:23:31][C][wifi:427]: Local MAC: 18:FE:34:CC:AB:54
[11:23:31][C][wifi:432]: SSID: 'Croft Hall 0'[redacted]
[11:23:31][C][wifi:435]: IP Address: 192.168.68.105
[11:23:31][C][wifi:438]: BSSID: F2:48:B8:E4:2F:B4[redacted]
[11:23:31][C][wifi:440]: Hostname: 'esphome-web-ccab54'
[11:23:31][C][wifi:442]: Signal strength: -44 dB ▂▄▆█
[11:23:31][C][wifi:446]: Channel: 7
[11:23:31][C][wifi:447]: Subnet: 255.255.252.0
[11:23:31][C][wifi:448]: Gateway: 192.168.68.1
[11:23:31][C][wifi:449]: DNS1: 192.168.1.254
[11:23:31][C][wifi:450]: DNS2: 192.168.68.1
[11:23:31][C][logger:185]: Logger:
[11:23:31][C][logger:186]: Level: DEBUG
[11:23:31][C][logger:188]: Log Baud Rate: 115200
[11:23:31][C][logger:189]: Hardware UART: UART0
[11:23:31][C][captive_portal:088]: Captive Portal:
[11:23:31][C][web_server:173]: Web Server:
[11:23:31][C][web_server:174]: Address: esphome-web.local:80
[11:23:31][C][mdns:116]: mDNS:
[11:23:31][C][mdns:117]: Hostname: esphome-web-ccab54
[11:23:31][C][esphome.ota:073]: Over-The-Air updates:
[11:23:31][C][esphome.ota:074]: Address: esphome-web.local:8266
[11:23:31][C][esphome.ota:075]: Version: 2
[11:23:31][C][safe_mode:018]: Safe Mode:
[11:23:31][C][safe_mode:019]: Boot considered successful after 60 seconds [11:23:31][C][safe_mode:021]: Invoke after 10 boot attempts
[11:23:31][C][safe_mode:022]: Remain in safe mode for 300 seconds
[11:23:31][C][api:139]: API Server:
[11:23:31][C][api:140]: Address: esphome-web.local:6053
[11:23:31][C][api:144]: Using noise encryption: NO
[11:23:31][C][improv_serial:032]: Improv Serial:
Thinking there may be a hidden character in the yaml that was messing with it I downloaded the file and opened in text editor but there is nothing there, it just keeps giving the error.
So far I see - it fails on compilation of code, too far to actual code upload to device.
Do You use ESPHome add-on for HA ?
Suggest to reinstall it from scratch, have no other ideas.