Docker for Hassio

Home Assistant (HA) is one of the best one of the best smart home systems. Now the best way to run it is to use OS Hassio, where all the components are run inside the dockers. It’s weird, but there’s no mention of Platformio on HA forum and there’s no mention of Hassio here (except my owns).

My Arduino Nano is connected to my Raspbery Pi 3 B+ via USB. I want to program (and may be debug) it from my Desktop PC with OS Windows.
Please help me with two questions:

  1. Is the use of Platformio a good solution? There is also AVRDude but it cannot to use USB (as I understanded) and I don’t want have additional cable.
  2. Is there anyone has ready scripts for boild Docker under Hassio, that I would not reinvent the bicycle from scratch?

Just use PIO Remote. Start PIO Remote agent on the RPi side and program Arduino Nano board from any PC or browser.

There is no instruction in the manual how to start PIO Remote inside docker, it is not trivial… Now platformio-core crashes, see below.


Ok, I’ll create on RPi a new folder /addon/hello_world and three files inside:

  • config.json
  • Dockerfile


  "name": "Hello world",
  "version": "0.1",
  "slug": "hello_world",
  "description": "My first real add-on!",
  "startup": "before",
  "boot": "auto",
  "options": {},
  "schema": {},
  "ports": {}




# Install requirements for add-on. Platformio needs 2.7
RUN apk add --no-cache python

# Example from
RUN apk add --update \
    python \
    python-dev \
    py-pip \
    build-base \
  && pip install virtualenv \
  && rm -rf /var/cache/apk/*


COPY . /data

RUN virtualenv -p python2 /data/.platformio/penv \
  && chmod +x /data/.platformio/penv/bin/activate \
  && /data/.platformio/penv/bin/activate \
  && pip install -U platformio

# Copy data for add-on
RUN chmod a+x /

CMD [ "/" ]

echo Hello world started!
python --version

echo ">pio remote --help"
pio remote --help

echo ">platformio remote agent start"
platformio remote agent start

echo Hello world finished!


From the documentation Remote Development — PlatformIO latest documentation it is not clear how I should authorize RPi, but in reality it does not matter now. Both commands, platformio remote agent start and pio account login give the same error.

Result of

Hello world started!
Python 2.7.15
>pio remote --help
If you like PlatformIO, please:
- follow us on Twitter to stay up-to-date on the latest project news >
- star it on GitHub >
- try PlatformIO IDE for IoT development >
- support us with PlatformIO Plus >
Usage: pio remote [OPTIONS] COMMAND [ARGS]...
  -a, --agent TEXT
  -h, --help        Show this message and exit.
  agent   Start new agent or list active
  device  Monitor remote device or list existing
  run     Process project environments remotely
  test    Remote Unit Testing
  update  Update installed Platforms, Packages and Libraries
>platformio remote agent start
CorePackageManager: Installing tool-pioplus @ >=1.3.1,<2
tool-pioplus @ 1.4.2 has been successfully installed!
CorePackageManager: Installing contrib-pysite @ >=0.2.0,<2
contrib-pysite @ 0.3.2 has been successfully installed!
Error: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/platformio/", line 120, in main
    cli(None, None, None)
  File "/usr/lib/python2.7/site-packages/click/", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click/", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/click/", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/click/", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/click/", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/click/", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/click/", line 508, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/platformio/commands/", line 52, in remote_agent_start
  File "/usr/lib/python2.7/site-packages/platformio/managers/", line 114, in pioplus_call
    code =[pioplus_path] + args, **kwargs)
  File "/usr/lib/python2.7/", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
An unexpected error occurred. Further steps:
* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command
* Try to find answer in FAQ Troubleshooting section
* Report this problem to the developers
Hello world finished!

Could you try Ubuntu or Archlinux distro?

I have no doubt that in a more traditional way, everything will work. Only a docker is not an operating system, it’s a different technology, much better suited for IoT:

  • added a physical device
  • added a docker under it in two clicks, and the software will be automatically installed and updated, without affecting the operating system.

I can try a bunch of different dockers but my system still remains clean as before the first modification attempt.

From the unhandled exception, the essence of the error is unclear, on what the script has stumbled. Now it is a bug. And in the future in my opinion such a good thing as Platformio must necessarily have a customized own docker, it will radically improve simplicity and stability.

Please file a feature request here, having Docker image for PIO Remote is a good idea. For other cases, it does not make any sense.

I asked to change Linux image which will be used for dockerization. You can use any Linux distro. We build PIO Plus Core for Linux using Archlinux. It should work in pair with Docker.