[SOLVED] Problem connecting two Arduino boards

Getting your soundcard to work, using Debian on non-i386 hardware, etc

[SOLVED] Problem connecting two Arduino boards

Postby Alefa » 2018-01-29 15:08

Hi,

I'm trying to connect two Arduino microcontrollers to my laptop running Debian Stretch, but without success. Connecting a single board works fine. The problem seems to be that both Arduinos are assigned to the same serial port (for example /dev/ttyACM1), and then one of the boards gets disconnected. Here is the output of dmesg when I connect the first board via USB:

Code: Select all
[331661.246877] usb 2-1: new full-speed USB device number 93 using xhci_hcd
[331661.397748] usb 2-1: New USB device found, idVendor=2341, idProduct=0242
[331661.397753] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[331661.397755] usb 2-1: Product: Genuino Mega 2560
[331661.397757] usb 2-1: Manufacturer: Arduino LLC (www.arduino.cc)
[331661.397759] usb 2-1: SerialNumber: 55434343633351501181
[331661.398492] cdc_acm 2-1:1.0: ttyACM1: USB ACM device



And this is what happens when I connect the second board:

Code: Select all
[331676.860957] usb 2-1: USB disconnect, device number 93
[331677.082844] usb usb3-port1: over-current condition
[331678.074958] usb 2-2: new full-speed USB device number 94 using xhci_hcd
[331678.225561] usb 2-2: New USB device found, idVendor=2341, idProduct=0242
[331678.225566] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[331678.225569] usb 2-2: Product: Genuino Mega 2560
[331678.225572] usb 2-2: Manufacturer: Arduino LLC (www.arduino.cc)
[331678.225575] usb 2-2: SerialNumber: 5543434363335150C0B0
[331678.226313] cdc_acm 2-2:1.0: ttyACM1: USB ACM device


As you see, the first board becomes disconnected as soon as I plugin the second board. The first board's control LED also goes out.

The strange thing is that connecting two boards to the same computer worked fine when I last tested it about a year ago. At that time, one Arduino was automatically assigned to ttyACM0 and the second to ttyACM1. Maybe the issue was introduced through a kernel update? I'm running kernel 4.14 from stretch-backports, because the default kernel in Stretch (4.9) causes graphical artifacts and system crashes with my hardware.

Any idea how to solve or debug this? I've already spent hours googling, but to no avail. If you'd like to have additional information about my system, let me know.
Last edited by Alefa on 2018-01-30 11:41, edited 1 time in total.
User avatar
Alefa
 
Posts: 17
Joined: 2013-06-11 09:09

Re: Problem connecting two Arduino boards

Postby Dai_trying » 2018-01-29 21:49

I just tested on my machine and it seems to be working ok here

Code: Select all
Jan 29 22:31:58 q4fujitsu kernel: [45242.784021] usb 2-2: new full-speed USB device number 2 using uhci_hcd
Jan 29 22:31:58  kernel: [45243.004106] usb 2-2: New USB device found, idVendor=2341, idProduct=0042
Jan 29 22:31:58  kernel: [45243.004110] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=220
Jan 29 22:31:58  kernel: [45243.004113] usb 2-2: Manufacturer: Arduino (www.arduino.cc)
Jan 29 22:31:58  kernel: [45243.004115] usb 2-2: SerialNumber: 956353336303510182E1
Jan 29 22:31:58  mtp-probe: checking bus 2, device 2: "/sys/devices/pci0000:00/0000:00:1d.1/usb2/2-2"
Jan 29 22:31:58  mtp-probe: bus: 2, device: 2 was not an MTP device
Jan 29 22:31:58  kernel: [45243.148987] cdc_acm 2-2:1.0: ttyACM0: USB ACM device
Jan 29 22:31:58  kernel: [45243.150526] usbcore: registered new interface driver cdc_acm
Jan 29 22:31:58  kernel: [45243.150529] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
Jan 29 22:32:22  kernel: [45267.364018] usb 3-2: new full-speed USB device number 3 using uhci_hcd
Jan 29 22:32:22  kernel: [45267.579162] usb 3-2: New USB device found, idVendor=2341, idProduct=0043
Jan 29 22:32:22  kernel: [45267.579166] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=220
Jan 29 22:32:22  kernel: [45267.579169] usb 3-2: Manufacturer: Arduino (www.arduino.cc)
Jan 29 22:32:22  kernel: [45267.579172] usb 3-2: SerialNumber: 556393131333514190F0
Jan 29 22:32:22  kernel: [45267.582329] cdc_acm 3-2:1.0: ttyACM1: USB ACM device
Jan 29 22:32:22  mtp-probe: checking bus 3, device 3: "/sys/devices/pci0000:00/0000:00:1d.2/usb3/3-2"
Jan 29 22:32:22  mtp-probe: bus: 3, device: 3 was not an MTP device
Jan 29 22:32:44  kernel: [45288.924085] usb 3-2: USB disconnect, device number 3
Jan 29 22:32:48  kernel: [45292.892088] usb 2-2: USB disconnect, device number 2


I connected the Arduino Mega first and then an Uno and both are available.
Dai_trying
 
Posts: 447
Joined: 2016-01-07 12:25

Re: Problem connecting two Arduino boards

Postby Alefa » 2018-01-30 07:19

Thanks for trying this out! Which kernel version do you use?
I just noticed that dmesg shows the message "usb3-port1: over-current condition" when I plug in the second board. Apparently this message usually appears when there's a short circuit in the usb port. Maybe I need to clean my usb ports, but I think it's strange that the message only appears when both ports are connected to Arduino boards. Connecting two pen drives at the same time works fine. Maybe there's a problem with the Arduinos' usb cables. I'll try different cables and a different computer next. I can also try exchanging one of the Arduino Mega boards with an Arduino Uno I have at home.
If you or anybody else has other ideas how to solve this, please let me know.
Dell Latitude E6320
Debian Wheezy KDE
User avatar
Alefa
 
Posts: 17
Joined: 2013-06-11 09:09

Re: Problem connecting two Arduino boards

Postby Dai_trying » 2018-01-30 10:25

Yes I noticed that line in your dmesg output too, I was wondering if you were using a hub attached and it may have been drawing too much power from a single usb port, but that was just a guess really. Just one thing though, do you have anything connected to the Arduino boards when you connect them as this might cause more current to go through the usb port...

My Kernel : 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux

I only have one Mega board so couldn't test with two, but I wouldn't have thought it made a difference.
Dai_trying
 
Posts: 447
Joined: 2016-01-07 12:25

Re: Problem connecting two Arduino boards

Postby Alefa » 2018-01-30 10:54

No, I'm not using a usb hub, just the two ports in the laptop. But you put me on the right track with your last comment. I had a rather complex array of four circuit boards connected to the Arduinos. Once I unplugged everything, I was able to connect both boards to the computer without problems. So now I only have to find out what's causing the short circuit. :(
I didn't consider this possibility before, because the whole array was working perfectly last year. Evidently something's broken now. Since this is not a Linux problem, I'll mark the thread as solved. Thanks a lot for your help!
Dell Latitude E6320
Debian Wheezy KDE
User avatar
Alefa
 
Posts: 17
Joined: 2013-06-11 09:09

Re: [SOLVED] Problem connecting two Arduino boards

Postby Dai_trying » 2018-01-30 16:21

You're welcome, and I don't think there is a short circuit, just the devices are using more current than the usb port can supply, generally it is less than 500mA and often it is considerably less (depending on laptop). Also I don't know if you were running on battery but if you were you could try connecting the mains power to laptop to see if it helps.
Dai_trying
 
Posts: 447
Joined: 2016-01-07 12:25

Re: [SOLVED] Problem connecting two Arduino boards

Postby Davood_T » 2018-02-07 18:55

Thank you
my problem is solve
Davood_T
 
Posts: 1
Joined: 2018-02-07 18:53


Return to Hardware

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable