PlatformIO Community

Pio remote agent not start

hello,
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/__main__.py", line 102, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/platformio/commands/__init__.py", line 44, in invoke
    return super(PlatformioCLI, self).invoke(ctx)
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/pi/.platformio/penv/lib/python3.7/site-packages/platformio/commands/remote/command.py", 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/agent_service.py", 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/base.py", 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/ssl.py", line 16, in <module>
    from OpenSSL import SSL  # pylint: disable=import-error
  File "/home/pi/.platformio/packages/contrib-pysite/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/home/pi/.platformio/packages/contrib-pysite/OpenSSL/crypto.py", line 12, in <module>
    from cryptography import x509
  File "/home/pi/.platformio/packages/contrib-pysite/cryptography/x509/__init__.py", line 8, in <module>
    from cryptography.x509.base import (
  File "/home/pi/.platformio/packages/contrib-pysite/cryptography/x509/base.py", line 18, in <module>
    from cryptography.x509.extensions import Extension, ExtensionType
  File "/home/pi/.platformio/packages/contrib-pysite/cryptography/x509/extensions.py", line 20, in <module>
    from cryptography.hazmat.primitives import constant_time, serialization
  File "/home/pi/.platformio/packages/contrib-pysite/cryptography/hazmat/primitives/constant_time.py", line 11, in <module>
    from cryptography.hazmat.bindings._constant_time import lib
ImportError: /home/pi/.platformio/packages/contrib-pysite/cryptography/hazmat/bindings/_constant_time.abi3.so: 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
  https://docs.platformio.org/page/faq.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================

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.

Cheers,
Karsten

1 Like

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