(See my post on the Raspberry Pi forums too, with the same info)
I am having problems establishing communications between a Raspberry Pi 3 and an Arduino Uno on the standard USB connection.
I am powering the Arduino from an external 9V power supply. Before that I had no success at all.
I have Raspbian Jessie installed and have run the usual apt-get update and apt-get dist-upgrade. I installed the default Arduino IDE package with sudo apt-get install arduino but I could not get it to actually upload tp the Arduino board. I removed the arduino package, and installed the latest IDE (v1.8.2) from Arduino.cc (ARM package, manually corrected the resource name in install.sh) but I am having the identical problems still...
The Arduino shows up for lsusb:
pi@raspberrypi:~ $ lsusb
Bus 001 Device 004: ID 046d:c517 Logitech, Inc. LX710 Cordless Desktop Laser
Bus 001 Device 009: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
But it does not always list as a tty device in which case there are errors in dmesg:
pi@raspberrypi:~ $ dmesg
[355787.688227] brcmfmac: brcmf_cfg80211_escan: Connecting: status (3)
[355787.688239] brcmfmac: brcmf_cfg80211_scan: scan error (-11)
[355834.521294] usb 1-1.2: new full-speed USB device number 6 using dwc_otg
[355835.061280] usb 1-1.2: device not accepting address 6, error -32
[355835.161273] usb 1-1.2: new full-speed USB device number 7 using dwc_otg
[355835.701290] usb 1-1.2: device not accepting address 7, error -32
[355835.801319] usb 1-1.2: new full-speed USB device number 8 using dwc_otg
[355835.850646] usb 1-1.2: device descriptor read/all, error -32
[355835.941283] usb 1-1.2: new full-speed USB device number 9 using dwc_otg
[355835.973517] usb 1-1.2: unable to read config index 0 descriptor/start: -32
[355835.973528] usb 1-1.2: chopping to 0 config(s)
[355835.986026] usb 1-1.2: string descriptor 0 read error: -32
[355835.986049] usb 1-1.2: New USB device found, idVendor=2341, idProduct=0043
[355835.986061] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[355835.986678] usb 1-1.2: no configuration chosen from 0 choices
[355835.986687] usb 1-1.2: No support over 500mA
[355847.689866] brcmfmac: brcmf_cfg80211_escan: Connecting: status (3)
[355847.689880] brcmfmac: brcmf_cfg80211_scan: scan error (-11)
Unplugging the USB cable and reconnecting it sometimes gives better results, where it lists as /dev/ttyACM0 and dmesg shows more success like this:
pi@raspberrypi:/dev $ dmesg
[357139.822453] usb 1-1.2: USB disconnect, device number 9
[357153.688442] usb 1-1.2: new full-speed USB device number 10 using dwc_otg
[357157.122550] usb 1-1.2: New USB device found, idVendor=2341, idProduct=0043
[357157.122560] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[357157.122564] usb 1-1.2: Manufacturer: Arduino (www.arduino.cc)
[357157.122568] usb 1-1.2: SerialNumber: 5533031363535160B1D0
[357157.153772] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
[357157.154503] usbcore: registered new interface driver cdc_acm
[357157.154509] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
But even then, actually uploading to the Arduino fails. I enabled verbose logging on the Arduino upload and this is the output:
Archiving built core (caching) in: /tmp/arduino_cache_664260/core/core_arduino_avr_uno_64911034d6446a05af243bd509e434f6.a
Sketch uses 926 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
/usr/bin/arduino-1.8.2/hardware/tools/avr/bin/avrdude -C/usr/bin/arduino-1.8.2/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyACM0 -b115200 -D -Uflash:w:/tmp/arduino_build_470013/Blink_fast.ino.hex:i
avrdude: Version 6.3, compiled on Dec 16 2016 at 12:14:49
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/usr/bin/arduino-1.8.2/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/home/pi/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : arduino
Overriding Baud Rate : 115200
ioctl("TIOCMSET"): Broken pipe
ioctl("TIOCMSET"): Broken pipe
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
avrdude done. Thank you.
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
And then, dmesg gives the following output. See the final line which corresponds with the "programmer not responding" message from avrdude:
pi@raspberrypi:~ $ dmesg
[357139.822453] usb 1-1.2: USB disconnect, device number 9
[357153.688442] usb 1-1.2: new full-speed USB device number 10 using dwc_otg
[357157.122550] usb 1-1.2: New USB device found, idVendor=2341, idProduct=0043
[357157.122560] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[357157.122564] usb 1-1.2: Manufacturer: Arduino (www.arduino.cc)
[357157.122568] usb 1-1.2: SerialNumber: 5533031363535160B1D0
[357157.153772] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
[357157.154503] usbcore: registered new interface driver cdc_acm
[357157.154509] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[357491.879909] cdc_acm 1-1.2:1.0: failed to set dtr/rts
It feels like I have read every Raspberry Pi/Arduino blog post and forum entry on the whole internet, but I am no closer to getting further than this. Specifically, I have tried the "press the reset button just before it uploads" trick numerous times without success. And I have tried running the Arduino IDE under sudo as well.
I have tested the Arduino with the same cable and everything on a Windows system and it just works first time.
Any suggestions would be welcome! Thanks in advance