At work, on a Ubuntu 14.04 system, I can access my Trinket Pro without any difficulty whatsoever.
At home, using either Linux Mint or Ubuntu across two laptops, I can not communicate with the device no matter what I try.
I have the correct board selected, the correct processor, and trying to use USBTiny ISP.
Currently, I'm getting:
avrdude: ser_open(): can't open device "COM1": No such file or directory
An error occurred while uploading the sketch
It's really getting frustrating having to take my devices to work just to upload a sketch, and I've been banging my head for over a week and a half. My UNO R3 boards work without issue on the same laptops.
Here's what dmesg
says:
[ 863.471315] usb 1-1.1: Product: USBtiny
[ 863.471316] usb 1-1.1: Manufacturer: Adafruit
[ 876.438778] usb 1-1.1: USB disconnect, device number 12
[ 880.921492] usb 2-1: new low-speed USB device number 5 using xhci_hcd
[ 881.092152] usb 2-1: New USB device found, idVendor=1781, idProduct=0c9f
[ 881.092157] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 881.092161] usb 2-1: Product: USBtiny
[ 881.092163] usb 2-1: Manufacturer: Adafruit
[ 1004.305143] usb 2-1: USB disconnect, device number 5
[ 1019.935505] usb 2-1: new low-speed USB device number 6 using xhci_hcd
[ 1020.106524] usb 2-1: New USB device found, idVendor=1781, idProduct=0c9f
[ 1020.106530] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1020.106533] usb 2-1: Product: USBtiny
[ 1020.106536] usb 2-1: Manufacturer: Adafruit
I am running IDE version 1.8.3, with sudo
, the exact same way I'm doing at the office.
Can someone please advise on what I'm missing here? Windows is not an option; I haven't used it in many years. I'd just like to figure out what's wrong.
I do have an FTDI connector, but didn't have much luck with it either, and to be honest, don't want to use it as I just want to plug the Trinket in, and upload.
Update: I've tried both USB2 and USB3 ports repeatedly with the same results.
2 Answers 2
[ 881.092161] usb 2-1: Product: USBtiny
[ 881.092163] usb 2-1: Manufacturer: Adafruit
[ 1004.305143] usb 2-1: USB disconnect, device number 5
[ 1019.935505] usb 2-1: new low-speed USB device number 6 using xhci_hcd
[ 1020.106524] usb 2-1: New USB device found, idVendor=1781, idProduct=0c9f
The USB Tiny ISP device which this logs shows being connected to your system is not a USB serial device. Therefore, it will not have any /dev/ttyXXX
device associated with it. Instead it should be used with the -c usbtiny
argument to avrdude
.
Adafruit documents their products fairly well, and this is no exception. The Linux section of the user guide is at https://learn.adafruit.com/usbtinyisp/avrdude#for-linux
That guide goes on to explain that you will typically need to create a udev rule to allow an ordinary user account to access the device. Depending on Linux installation, typical contents might be
SUBSYSTEM=="usb", SYSFS{idVendor}=="1781", SYSFS{idProduct}=="0c9f", GROUP="users", MODE="0666"
or
SUBSYSTEM=="usb", SYSFS{idVendor}=="1781", SYSFS{idProduct}=="0c9f", GROUP="adm", MODE="0666"
The above linked guide will more comprehensively explain how all of this works.
Note that the above pertains to the USB Tiny ISP programmer shown in your dmesg output. According to the Adafruit page on the Trinket Pro, the Trinket Pro "bootloader looks just like a USBtinyISP" therefore, you would talk to it in the same way as the USB Tiny ISP that your system reports finding, ie, without using a /dev/ttyXXX
device, but rather by specifying -c usbtiny
in the avrdude command line, or using an Arduino IDE board configuration which does so.
Your error message suggests that avrdude
is not being run with the correct command line options. You may want to turn on verbose mode to see what is being run - it would especially helpful if you did that on both the working and the non-working Linux systems.
-
Thanks Chris. I will check what the
avrdude
upload command is on the home machine tonight. At work, it does get sent in with the-cusbtiny
flag. What I meant by the serial port is that I'm aware it's irrelevant in this case, but on the work machine, thePort
within the IDE can be set to anyttyS#
and this doesn't affect the upload. The only thing I can think of is that at home, for some reason, the-c
flag isn't being sent in. After some research, I've found how to upload via the command line, so I'll try that first, then troubleshoot the IDE if necessary.stevieb– stevieb2017年06月16日 14:39:49 +00:00Commented Jun 16, 2017 at 14:39 -
Also, my understanding was that the
udev
rules are only necessary for running as a non-root user. That said, I did configure them on both machines in the same fashion already. I'll redo these steps if the steps in my above comment fail to produce positive results.stevieb– stevieb2017年06月16日 14:43:18 +00:00Commented Jun 16, 2017 at 14:43
So, in the end, although Chris' answer didn't directly lead me to the solution, by delving through his links, I eventually ended up at a page that suggested using the Sketch->Upload Using Programmer
feature.
That corrected the issue both as root
and my normal Linux user account, without any other changes necessary. I find it odd that it isn't required on my work PC, but I digress. It works on both, so I'm pleased.
-
Sounds like you do not have a valid configuration for a Trinket Pro installed, or at least not selected as the board in use, on your home machine.Chris Stratton– Chris Stratton2017年06月17日 02:53:52 +00:00Commented Jun 17, 2017 at 2:53
-
It works; I will completely review my setup, but I know for fact that things are the same on both machines IDE-config (UI) wise. There is no doubt. Again, I will review again, but I've been at this for a while. I may just redo everything from scratch to see if I did happen to go wrong somewhere.stevieb– stevieb2017年06月17日 03:52:14 +00:00Commented Jun 17, 2017 at 3:52
/dev/ttyS4
and/dev/ttyS5
. Selecting either one produces the same error. Technically, the serial port selection should be irrelevant with USBTiny, at least to my understanding.