PlatformIO Community

Pio remote agent not start

i use the platformio remote about 2 mounth,today i upgrade to latest version but now i can’t do nothing.
if try to launch “pio remote agent start” on my raspberry(where is connected the arduino)it return:

pi@raspberrypi:~ $ platformio remote agent start
Error: Traceback (most recent call last):
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/platformio/", line 102, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/", line 717, in main
    rv = self.invoke(ctx)
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/platformio/commands/", line 44, in invoke
    return super(PlatformioCLI, self).invoke(ctx)
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/platformio/commands/remote/", line 65, in remote_agent_start
    from platformio.commands.remote.client.agent_service import RemoteAgentService
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/platformio/commands/remote/client/", line 25, in <module>
    from platformio.commands.remote.client.base import RemoteClientBase
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/platformio/commands/remote/client/", line 30, in <module>
    from platformio.commands.remote.factory.ssl import SSLContextFactory
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/platformio/commands/remote/factory/", line 16, in <module>
    from OpenSSL import SSL  # pylint: disable=import-error
  File "/home/pi/.platformio/packages/contrib-pysite/OpenSSL/", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/home/pi/.platformio/packages/contrib-pysite/OpenSSL/", line 12, in <module>
    from cryptography import x509
  File "/home/pi/.platformio/packages/contrib-pysite/cryptography/x509/", line 8, in <module>
    from cryptography.x509.base import (
  File "/home/pi/.platformio/packages/contrib-pysite/cryptography/x509/", line 18, in <module>
    from cryptography.x509.extensions import Extension, ExtensionType
  File "/home/pi/.platformio/packages/contrib-pysite/cryptography/x509/", line 20, in <module>
    from cryptography.hazmat.primitives import constant_time, serialization
  File "/home/pi/.platformio/packages/contrib-pysite/cryptography/hazmat/primitives/", line 11, in <module>
    from cryptography.hazmat.bindings._constant_time import lib
ImportError: /home/pi/.platformio/packages/contrib-pysite/cryptography/hazmat/bindings/ cannot open shared object file: 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


what can i do?

I had the same problem. I finally solved it by doing the following:

# python3.8 -m venv pio # create a new python virtual environment with name pio
# . pio/bin/activate # activate the new environment
# pip install pyopenssl
# pip install cffi
# pip install cryptography
# pip install platformio
# platformio remote agent start

You might still require some system packages (e.g. libffi, libffi-dev, libssl-dev)

There are also some other issues with the remote commands. Some are solved with python 3.8, others remain. For example, “platformio remote device monitor” will cause exceptions.


1 Like

It should be fixed in the latest PIO Core version. Please re-run pio upgrade.