PlatformIO Core USB permissions on Raspberry Pi

Hello! Thanks in advance!

I am having the same error as this post except I am on a Raspberry pi 4 with a blank boot of Rasbian. I am trying to build a quick and dirty over the air update system for a project on a Teensy 4.0.

I made sure to enable UART in config.txt and in raspy-config, and I tried all of the suggested commands from the thread:

sudo adduser pi dialout

sudo usermod -a -G dialout pi

and yet I still get this message when I try to install my program:

**pi@raspberrypi** : **~/Documents/Visualisd $** pio run --target upload

Processing **teensy36** (platform: teensy; board: teensy36; framework: arduino)

**---------------------------------------------------------------------------------------------------------------------------------------------------------------**

Verbose mode can be enabled via `-v, --verbose` option

CONFIGURATION: 

PLATFORM: Teensy 4.11.0 > Teensy 3.6

HARDWARE: MK66FX1M0 180MHz, 256KB RAM, 1MB Flash

DEBUG: Current (jlink) External (jlink)

PACKAGES:

- framework-arduinoteensy 1.153.0 (1.53)

- tool-teensy 1.21.1

- toolchain-gccarmnoneeabi 1.50401.0 (5.4.1)

LDF: Library Dependency Finder -> 

LDF Modes: Finder ~ chain, Compatibility ~ soft

Found 90 compatible libraries

Scanning dependencies...

Dependency Graph

|-- <arduinoFFT> 1.5.5

|-- <OctoWS2811> 1.4

Building in release mode

Linking .pio/build/teensy36/firmware.elf

Checking size .pio/build/teensy36/firmware.elf

Building .pio/build/teensy36/firmware.hex

Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"

RAM: [ ] 4.3% (used 11212 bytes from 262144 bytes)

Flash: [ ] 1.5% (used 16136 bytes from 1048576 bytes)

Configuring upload protocol...

AVAILABLE: jlink, teensy-cli, teensy-gui

CURRENT: upload_protocol = teensy-cli

Rebooting...

Uploading .pio/build/teensy36/firmware.hex

Teensy Loader, Command Line, Version 2.1

Read ".pio/build/teensy36/firmware.hex": 16148 bytes, 1.5% usage

Unable to claim interface, check USB permissions

Error opening USB device: could not claim interface 0: Operation not permitted

Waiting for Teensy device...

(hint: press the reset button)

Unable to claim interface, check USB permissions

Unable to claim interface, check USB permissions

Unable to claim interface, check USB permissions

Unable to claim interface, check USB permissions

Unable to claim interface, check USB permissions

Unable to claim interface, check USB permissions

Unable to claim interface, check USB permissions

Unable to claim interface, check USB permissions

Thanks for any help you can offer!

Thanks for any help you can offer!hanks for any help you can offer!

When you added your pi user to the dialout group, did you close the terminal and start a new one? Adding a user to new groups takes place in new applications, shell sessions etc. Already open applications and shell sessions do not change.

The groups command will show you the list of groups your (current) user belongs to. Check that dialout is listed. If not, close the terminal and start a new one, or, su - pi from your current one, and then check groups again.

Cheers,
Norm.

I rebooted the pi, closed the terminal and started a new one and a new ssh.
When I ran groups I get this:
pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi

I also tried su - pi and I am still getting the same error

Your user is definitely in the dialout group. So that’s fine.

Did you install the udev rules file from https://github.com/platformio/platformio-core/blob/develop/scripts/99-platformio-udev.rules? wget or download that file and check the instructions within.

Cheers,
Norm.

2 Likes

Totally fixed it, perfect! You have no idea how much this is gonna enable me to do. Thank you!

Been there, done that! Welcome to the club. :grinning:

Glad to help.

Cheers,
Norm.

1 Like