That’s odd I don’t get that error. Does your user belong to the dialout groups? The pi user is in the dialout group by default in the Raspbian images
pi@raspberrypi:~ $ groups
pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi
Install or compile?
I get some warnings during compile too, I get some with the “make” routine and standard ARM toolchain too, but Ive never really studied the content, I did read it a couple of times when we started this but the info didn’t stick.
It could be because the usb device is mounted within a VM which isn’t quite the same as a physical machine.
Install. I don’t get any errors during compile.
Edit - in fact I do, the same errors occur during compile too, except the warnings are only visible if it’s run in verbose mode. - sudo pio run -t upload -v
Must admit, I was a sceptic about using Platformio, but having tried it I’m impressed.
I’m not sold on it, most of the negativity comes from having it thrust upon me at very regular intervals and having to explain why I’m not using it.
It is overkill for use on the Pi (and it currently doesn’t work which doesn’t help) the deb package and minicom works well and it’s maintained via apt-get, I have no need for more clutter. As I ve said before the serial monitor is nicer than minicom, but I wouldn’t install it just for a serial console.
Beware of using sudo with PIO. If you inadvertently use it for the compile command, it will write the temp files as root and not be able to delete them next time you compile as non-root. I have no doubt sudo make will probably do the same, but as I’m not using any sudo commands whilst compiling/flashing and viewing the serial output it’s a mistake less likely to happen for me.
I just found Miniterm is installed as part of the standard Raspbian image. So there is no reason for me to install Minicom (which I dislike). I can just install the ARM toolchain alone and use Miniterm.
I can just set up an alias to include the settings and path like I have for Minicom and issue a single word command to open the Miniterm serial console at the right baud and path, Fantastic!
Ohh! That’s not good! So make won’t work after using PIO either? Unless you use sudo too. That cannot be right, it installs it’s toolchain in the users home folder, not in the root filesystem, it shouldn’t then expect you to use sudo. Did you install with sudo or not?
[edit] Do you have a .platformio folder in your users home directory? Is there one at the root users home directory too?
[edit2] If you have more than one .platformio folder, can you tell which is being used? latest file times or rename one of them to see it is causes an issue.
[edit3] If you look at Glyns first post in this thread he doesn’t use sudo either (and his middle name is platformio), but I suppose he may be a root level user.
[edit4] In the PlatformIO: Compile & upload firmware. Blog post 1/3 thread, there is a variety of sudo and non-sudo commands but no explanation as to which or why. I think some clarification may be in order here.
Yes, but it only contains a Platformio json config file - no other data
Yes, but that folder contains Platformio’s libraries, toolchains, etc.
Maybe. That’s one for Glyn to answer!
EDIT - there is a way to install Platformio local to a user, but pip is needed (the package management system for Python). I didn’t really want to install pip, as it’s yet more baggage I probably wouldn’t use again!!
I have both since I ran the compile with sudo by accident the other day and that’s how I came to learn about the issue with root owned temp files as I only made the error once and then couldn’t use non-sudo as I was used to.
pi@raspberrypi:~ $ ls -la .platformio
total 24
drwxr-xr-x 5 pi pi 4096 Mar 26 19:08 .
drwxr-xr-x 35 pi pi 4096 Mar 28 20:02 ..
-rw-r--r-- 1 pi pi 186 Mar 26 19:08 appstate.json
drwxr-xr-x 2 pi pi 4096 Mar 23 17:00 lib
drwxr-xr-x 8 pi pi 4096 Mar 26 19:04 packages
drwxr-xr-x 3 pi pi 4096 Mar 26 18:57 platforms
pi@raspberrypi:~ $ sudo ls -la /root/.platformio
total 24
drwxr-xr-x 5 root root 4096 Mar 23 16:58 .
drwx------ 6 root root 4096 Mar 23 16:51 ..
-rw-r--r-- 1 root root 139 Mar 23 16:58 appstate.json
drwxr-xr-x 2 root root 4096 Mar 23 16:58 lib
drwxr-xr-x 8 root root 4096 Mar 23 16:57 packages
drwxr-xr-x 3 root root 4096 Mar 23 16:51 platforms
I too installed with sudo for the installer, I only asked to see if there was a difference.
If you delete the temp files in .pioenvs will it then compile without sudo?
PIP is also included as standard on the Raspbian image, but PIO installed it again, or so it told me, I don’t actually know if the message was accurate, but I recall I was annoyed whilst watching it apparently install PIP when I knew it was already there.
I use a lot of Python so PIP is generally something I use.
I think you have a non-sudo PIO, but once you use sudo you are stuck unless you remove or chown the files.
You souldn’t need sudo to flash the stm32 as it’s mounted to the users media folder so you shouldn’t need sudo at all for the run or upload commands.
For acces to the serial port to negate using sudo with miniterm try adding your user to the dialout group with
sudo usermod -a -G dialout $USER
you might need to log out and in, or start anew shell to get the new group permissions. Check it with groups .
My main project files are not root.
But, after deleting .pioenvs and running platformio without sudo, it again downloaded the toolchain, libraries and support files to my user root (so like you - I now have a set in root users home directory & a set in user home directory!!) it then went onto successfully flash the STM32.
However, the .pioenvs is now user owned;
I suppose the test now is to delete the library files (except the json config) from the root users home directory, but being a gentleman - you first!!
now I’m thinking the 2nd set of libs must be also 0.6GB, plus the actual PIO install, I bet I could claim back a full 1.0GB (give or take) by removing PIO entirely.
I ordered a Nucleo F303RE and a shield today. Thought I’d follow the thread a bit more than just reading it.
This has been one of the more enjoyable and (especially) educational reads on the forum in quite some time.