Unnecessary PlatformIO system data?

While updating one of my ESP8266 devices I saw the following message in the log:

We found 1.16MB of unnecessary PlatformIO system data (temporary files, unnecessary packages, etc.).
Use pio system prune --dry-run to list them or pio system prune to save disk space.

Searching for this message gives links to running command line inputs to solve this.

https://docs.platformio.org/en/latest/core/userguide/system/cmd_prune.html
It however is unclear to me how I can access this command line interface.
I suppose this has to be run locally on the ESP8266 device, but how?
Or can this be done through the HA web interface using the “Clean Build Files” option like this:

ESPHome_CleanBuildFiles

If not, then what is this “Clean Build Files” option meant for?

1 Like

The command line runs on your computer, not the esphome device.

Sorry, but I don’t understand what you mean.
The message is about unnecessary system data on the HA server, and not on the ESP8266 device?
I tried to run the “pio” command through the HA Terminal interface in the browser, but got this reply:

So which command line interface should I use?

The command line interface in the ESPHome container. Use portainer to get there.

Ah, thanks!
Something new for me again: Portainer.
I did some searching about it, and as I now understand it, Portainer is a community addon for HA to manage the installed docker containers through a web interface.
Just to be clear: I am using a Home Assistant Supervised installation on a x86 system.
On the Portainer GitHub page it is stated that:

“Home Assistant DOES NOT SUPPORT running third party containers on Home Assistant OS or Supervised installation types. Ignoring this, will render your system as unsupported!”

So would installing the Portainer addon make my installation unsupported?

And another question: up to now I did not find any example of using Portainer to access a command line interface. Is this done through the Portainer web interface?

No HA add-on makes your device unsupported. That is why it are add-ons

Yes

Hmm…
So does this mean that the Portainer add-on (and also the ESPHome add-on for that matter) is NOT a “third party container”? Otherwise I really do not understand that warning statement on the Portainer GitHub page.

Third party containers = regular docker containers

Add-ons are considered part of the HA OS / HA Supervised eco-system.

You can use the portainer add-on to install regular docker containers on HA OS → that is not supported (but possible)

OK, thanks again Francis. All clear now again :slightly_smiling_face:
I will install the Portainer add-on probably later today and have a look at the possibilities.

You could also use the commandline above and type into it

docker ps|grep esphome
docker exec -it containername bash

The first command will give you containername

3 Likes

Thanks Nick!
That worked :slightly_smiling_face:

Although, at the first try to run the grep command I got a warning that the SSH add-on was running in Protection mode:

HA_Terminal_docker_protectionmode_20211014-2150

But after temporarily disabling this, I could successfully run the prune command in the ESPHome docker container:


So 1.16MB of cached data space reclaimed :slightly_smiling_face:

1 Like

Ah yes!
Re-reading this conversation, I am still curious about what this “Clean Build Files” option in the ESPHome web interface does (see my initial message), since it did not solve the “prune” problem.
I cannot find anything about this on the ESPHome pages.
Anybody?

I am not an expert in platformio, but the clean build removes the whole build tree for that device and recompiles from scratch.

1 Like

Thanks again Nick.
I tried it, and can confirm that, after running the Clean Build Files” action, ESPHome did a compilation from scratch: the compilation took much more time than normally when doing a small update of an ESP8266 device.

Say the same message when I was updating one of my boards.

We found 78.39MB of unnecessary PlatformIO system data (temporary files, unnecessary packages, etc.).
Use `pio system prune --dry-run` to list them or `pio system prune` to save disk space.

But when I issue pio system prune within the esphome container, I got a much lower reclaimed disk space.

Yes, I can confirm this.
Yesterday I got the warning “We found 81.23MB of unnecessary PlatformIO system data”, but when I run the “pio system prune” command today there was only 1.28MB of space reclaimed.
And also, immediately after the ESPHome install that showed this warning yesterday I did several other installs to the same device without getting a warning again.
So apparently most of the unnecessary data was already reclaimed automatically?

Or possibly when we see this warning during an upload, it has automatically reclaimed the disk space, but still suggest us to run it?

I have the same warning message and apparently the Portainer add-on is no longer an option. I guess I shall just have to live with it, although the fix shown in ESPHome logs is kinda useless if we can’t act on it.

I don’t know why you would need portainer. The thread tells you how do enter the container.

The thread may tell me that, but SSHing in to my HA instance does not yield a shell that has any awareness of Docker.