I’m trying to flash a *.hex file to the Arduboy on Ubuntu 18.04.
$ groups
brian adm tty dialout cdrom sudo dip plugdev lpadmin sambashare libvirt vboxusers
$ ls -l /dev/ttyACM0
crw-rw-rw- 1 root dialout 166, 0 Jan 22 22:55 /dev/ttyACM0
$ cat /etc/udev/rules.d/51-arduboy.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="[80]036", GROUP="dialout", MODE="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="[80]036", GROUP="dialout", MODE="0666"
$ dmesg | tail -n 6
[ 1221.094323] usb 1-1.1: new full-speed USB device number 25 using xhci_hcd
[ 1221.189285] usb 1-1.1: New USB device found, idVendor=2341, idProduct=8036
[ 1221.189293] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1221.189298] usb 1-1.1: Product: Arduino Leonardo
[ 1221.189303] usb 1-1.1: Manufacturer: Arduino LLC
[ 1221.192643] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device
However, upload still fails with a permission denied error:
$ python uploader.py ~/arduboy/crait/MidnightWild.arduboy
Arduboy python uploader v1.1 by Mr.Blinky April - June 2018
Loading "MidnightWild.arduboy"
Found Arduino Leonardo at port /dev/ttyACM0
Selecting bootloader mode...
Found Arduino Leonardo at port /dev/ttyACM0
Traceback (most recent call last):
File "uploader.py", line 177, in <module>
bootloaderStart()
File "uploader.py", line 80, in bootloaderStart
bootloader = Serial(port,57600)
File "/home/brian/.local/lib/python2.7/site-packages/serial/serialutil.py", line 240, in __init__
self.open()
File "/home/brian/.local/lib/python2.7/site-packages/serial/serialposix.py", line 268, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'
I noticed that when the device is put into bootloader mode, dmesg shows this:
[ 1403.438342] usb 1-1.1: USB disconnect, device number 25
[ 1403.656267] usb 1-1.1: new full-speed USB device number 26 using xhci_hcd
[ 1403.746047] usb 1-1.1: New USB device found, idVendor=2341, idProduct=0036
[ 1403.746049] usb 1-1.1: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[ 1403.746050] usb 1-1.1: Product: Arduino Leonardo
[ 1403.746051] usb 1-1.1: Manufacturer: Arduino LLC
[ 1403.747446] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device
[ 1411.630520] usb 1-1.1: USB disconnect, device number 26
[ 1411.817200] usb 1-1.1: new full-speed USB device number 27 using xhci_hcd
[ 1411.909194] usb 1-1.1: New USB device found, idVendor=2341, idProduct=8036
[ 1411.909202] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1411.909209] usb 1-1.1: Product: Arduino Leonardo
[ 1411.909213] usb 1-1.1: Manufacturer: Arduino LLC
[ 1411.911382] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device
So I suspect when the device is reconnected, it’s setup with the wrong permissions, which is why the write fails. Though I’m not sure what additional udev-fu I need to make it work. Any suggestions?
Thanks!