I migrated my HASSIO from a Pi3 to a Pi4 2 days ago
Works great and faster and all
BUT
Since then, I get this error message when I try to compile something in ESPHome …
" Error: Could not load broken JSON: /data/cache/platformio/packages/framework-arduinoespressif32/.piopm"
The YAML I am trying to upload now is the same as I used before (it’s for ESP32-Cam’s)
Tried it on other ESP32 boards too
I get the same error whet I hit the “update” or “update all” in ESPHome
Actually, when I uninstall ESPHome, reboot the server, reinstall ESPHome, I get a 502 Bad Gateway on ESPHome, that only disappears when I restart the server again
After restart it works but I get the error message that started this topic…
After repeating the same steps over again, it was fixed. I don’t really know what I did differently this, like, 8th time, but here are the exact steps I followed:
1 Uninstall ESPHome
2 Restart server (I did that physically and left the power plug out of the Pi for a good 5 minutes, maybe that helped but I tried that before)
3 After server restart, reinstall ESPHome
4 DON’T START ESPHOME WHEN INSTALLED, First restart server (I did it that way, but this time, via the restart button in the settings)
5 Start ESPHome, should be up and running, ready to compile and write
Good luck if you encounter this issue, hope it will help!
I just had this exact error when I tried to change one of my esphome device from arduino to esp-idf type, and then when compiling things seemed to get stuck. I force reboot the HA and then I got this error.
In my case, I just need to uninstall esphome and re-install it. No need to reboot or restart HA. That fixes the error for me.
I’ve tried the solution a couple of times now, but I didn’t get it solved.
I tried serveral also some variances of rebooting and restarting.
What I could observe is that after install and reboot, the first build process in ESPHome cause a restart of HA. I don’t know why.
After that I get the
InvalidJSONFile: Could not load broken JSON: /data/cache/platformio/packages/tool-esptool/.piopm
error
Any ideas?
Issue was invented after updating to 2023.12.3
I just had the same issue and I am commenting to this topic since it is the top response when I google. Maybe this could be of help for future users with problems.
Note! Remember the path is seen from the ESPHome containers point of view. So if you enter the docker container you can delete the files from in there.