Robert Cudmore    archive    tags    search    software


Platformio-teensy-udev-rules

Setting udev rules is critical for using platformio and a teensy. Instruction are here

#this command
platformio run --target upload

#was giving this
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)

Recipe is:

Make sure .rules file is created with sudo.

platformio version

platformio --version
#gives
PlatformIO, version 3.0.1

platformio serialports list

platformio serialports list

#gives
Usage: platformio [OPTIONS] COMMAND [ARGS]...

Error: No such command "serialport"
pi@pi3:~ $ platformio serialports list
/dev/ttyACM0
------------
Hardware ID: USB VID:PID=16C0:0483 SER=617160 LOCATION=1-1.5
Description: USB Serial

/dev/ttyAMA0
------------
Hardware ID: 3f201000.uart
Description: ttyAMA0

check /dev/ttyACM0

ls -al /dev/ttyACM0 
 #gives
 crw-rw-rw- 1 root dialout 166, 0 Sep 17 14:31 /dev/ttyACM0

teensy udev rules

See description here and download from https://www.pjrc.com/teensy/49-teensy.rules

# UDEV Rules for Teensy boards, http://www.pjrc.com/teensy/
#
# The latest version of this file may be found at:
#   http://www.pjrc.com/teensy/49-teensy.rules
#
# This file must be placed at:
#
# /etc/udev/rules.d/49-teensy.rules    (preferred location)
#   or
# /lib/udev/rules.d/49-teensy.rules    (req'd on some broken systems)
#
# To install, type this command in a terminal:
#   sudo cp 49-teensy.rules /etc/udev/rules.d/49-teensy.rules
#
# After this file is installed, physically unplug and reconnect Teensy.
#
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789]?", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789]?", ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789]?", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789]?", MODE:="0666"
#
# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and mange access using standard unix groups.
#
#
# If using USB Serial you get a new device each time (Ubuntu 9.10)
# eg: /dev/ttyACM0, ttyACM1, ttyACM2, ttyACM3, ttyACM4, etc
#    apt-get remove --purge modemmanager     (reboot may be necessary)
#
# Older modem proding (eg, Ubuntu 9.04) caused very slow serial device detection.
# To fix, add this near top of /lib/udev/rules.d/77-nm-probe-modem-capabilities.rules
#   SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789]?", GOTO="nm_modem_probe_end" 
#
Tags: raspberry, debian, linux, arduino

©2017. Robert Cudmore.