PlatformIO on Raspbian RPI4B - Stuck Loading

Hello,

Sorry if this is known stuff but I wasn’t able to find a solution for my problem.

I want build a dev environment for Arduino-like developments on a Raspberry PI 4B but I don’t manage to make it work. I could install VS Code and I install from there PlatformIO, but when starting it’s stuck with a “Loading…” message in the Home window.

I notice two error messages, one that says that the ARM architecture is not supported and I also get an error in a Python module (I can put here the exact error if it would help).

I saw some messages about deleting the environment folder inside .platformio, but it doesn’t help.

My first question is: Should it work on my setup? I don’t even know if RPI and latest Raspbian 32 bits is supported.

Any clue?

FYI. I managed to install PIO on my RPI 4B using Ubuntu 19.10 64 bit, but Ubuntu is quite slow and has some issues with RPI (i.e. problems with USB if having 4GB of RAM, among others), so I’d like to see if its useable on Raspbian.

Thanks,
Pedro

Could you post these exact error messages?

Hello.
This is what I see:

Error: 
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 956, in invoke return ctx.invoke(self.callback, **ctx.params) 
File "/home/pi/.platformio/penv/lib/python3.7/site-packages...

I don’t know if this is of any relevance…
pi@raspberrypi:~/.platformio/penv/bin $ python3 pio home
Traceback (most recent call last):
File “pio”, line 5, in
from platformio.main import main
ModuleNotFoundError: No module named ‘platformio’

I added the …/penv/bin to the path and then I could run “pio home”, but I got the same error than before, that was adding some more lines, one suggesting to run “pip install -U platformio”, which I did.
Now if I run “pio home” from the VS Code terminal, then it opens the PIO Home in a browser, not inside VS Code.
I’m quite lost… I’d really appreciate if someone makes me see the light…
Thanks,
Pedro

Hm that’s weird. You can also choose to manually install a PIO core via PIP (sudo -H pip3 install platformio) and then set the VSCode extension to “not use built-in core” (there’s a checkmark in the extension settings). Can you try that? Also note that the latest VSCode version is known to have some problems, so 1.39 is advised (PIO, VSC can't build, no tasks found)

Thanks, I’ll give a try.

Just a question that could be silly… as I can run the same versions of VSC and PIO on Ubuntu 19.10 in my Raspberry 4, and there the default browser is Firefox… could have the default browser an effect on what is happening to me?

BR/P

Well… I think I solved it, but in a funky way…

I couldn’t find the setting you mentioned about not using the built-in core, but another setting caught my attention: the default port. By default is ‘0’ and this makes PIO to automatically look for the port, BUT STARTING ON 8010, WHEN THE PORT I GOT ON MY SETUP WAS 8008!!!

So, setting the port manually to 8008, makes that the Home comes up.

Let’s see if the rest also works, but I hope this helps others.

Best,
P

After some more testing I found out two issues:

  • I need to manually run “pio home” from the terminal so it works and the Home page shows up. I wonder why it’s not starting automatically.
  • It’s pretty unstable, from time to time I need to start it again

Any more comment would be welcome!

re: automatic startup, is the disable checkbox ticked by any chance?

image

I’ve also queried the port range here as the default for PIO Home is 8008, so one would think it would be in the range searched… maybe Ivan transposed the 1 and the 0, and it’s supposed to be 8001..8100.

The option for the bult in core is a bit further down… and as you can see, I’m using the development version, which is not the default, hence the blue bar at the side of the setting.

image

Also, when you were trying to run it like pi@raspberrypi:~/.platformio/penv/bin $ python3 pio home above, if you didn’t activate the v(irtual)env first, that is probably why you were having trouble. Something like ~/.platformio/penv/bin/activate (don’t have my linux box up atm so can’t tell you the exact path) before hand should set the paths and python version, etc up properly, and then pio on it’s own should also work.

Thanks, I’ll try all the above later.

About the port, maybe it was just a false impression I got, and it worked because of having launched it manually before.

The moments I had it working I found it quite useable, so I hope I can get it stable, as it’s really a great platform!

Pedro

1 Like

So, as I was unsure what I did before, I decided to start from scratch with a clean system…

Right now I’m just as at the beginning, and when trying to start home I get the error below.

Before trying to install the PIO Core and start it from command line, I’ll do some research, in case there’s something I’m missing in the setup (Paths, Dependencies…), but if you have any advice on this moment, I’d appreciate guidance.

Thanks.

The error I get right now:
pi@raspberrypi:~ $ pio home
+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 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/home/command.py”, line 52, in cli
from autobahn.twisted.resource import WebSocketResource
File “/home/pi/.platformio/packages/contrib-pysite/autobahn/twisted/init.py”, line 58, in
from autobahn.twisted.wamp import ApplicationSession
File “/home/pi/.platformio/packages/contrib-pysite/autobahn/twisted/wamp.py”, line 50, in
from autobahn.wamp import protocol, auth
File “/home/pi/.platformio/packages/contrib-pysite/autobahn/wamp/auth.py”, line 43, in
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
File “/home/pi/.platformio/packages/contrib-pysite/cryptography/hazmat/primitives/kdf/pbkdf2.py”, line 12, in
from cryptography.hazmat.primitives import constant_time
File “/home/pi/.platformio/packages/contrib-pysite/cryptography/hazmat/primitives/constant_time.py”, line 11, in
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:

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

could it be that the library _constant_time.abi3.so coming with PIO IDE is not the right one for Raspbian (ARM 32 bits) ?

I answer myself… I checked with the file command and it informs it’s ARM 32

Well… I got it working using the PIO Core installed by command line. But the setup from the IDE seems to be buggy.

The setup has been quite funky but so far, so good.

1 Like

I managed to get it working. But also with errors. It compiles though…

But defenitively not to be run in ARM architecture. Is better to use it in any Intel or normal Linux, works much better and stable

1 Like

Well… I wanted to make myself a portable workbench and I must say that it does its job nicely!
image

2 Likes

Wow @pfuentes69 I love this little useful build! It’s like a custom laptop you can move around easily. Plus I see a variable power supply.

For my application, I want to run headless pio on rpi4 with no VsCode installed. I plan to remote develop on my desktop and then compile and upload the code from pi directly to a Teensy 4.0. Is it possible to run pio Command-Line without VsCode? Thanks in advance.

Yes!

Either install the PlatformIO CLI, or if you have already installed the IDE, make the commands available as per the docs.

Then compile and upload etc, on the cli. (I started with CLI and still do most work using it. But I have VSCode installed now.)

HTH

Cheers,
Norm.