<div dir="ltr"><div class="gmail_default" style="">During the last RBNV I mentioned that I was having problems communicating with an Arduino connected to the RPI due to that nature of the USB bus and what device gets connected first ei: /dev/ttyUSB0 vs /dev/ttyUSB1 or /dev/ttyACM0...etc when using multiple Arduinos.  To resolve this I used some udev rules as below to connect the devices to a symbolic link therefore resolving the unknown USB device name.  The same symbolic link name will be given to the USB serial device connected to a specific port.</div><div class="gmail_default" style=""><br></div><div class="gmail_default" style="">I created <b>/etc/udev/rules.d/99-tty-by-path.rules</b> with the following content on the raspberry pi.</div><div class="gmail_default" style=""><br></div><div class="gmail_default" style=""># Rules to create SYMLINK to Arduino device by USB path</div><div class="gmail_default" style="">ACTION=="add", SUBSYSTEMS=="usb", KERNELS=="1-1.2.7:1.0", SYMLINK+="ttyUSB-motor"<br>ACTION=="add", SUBSYSTEMS=="usb", KERNELS=="1-1.2.7:1.1", SYMLINK+="ttyUSB-ultrasonic"<br></div><div class="gmail_default" style=""><br></div><div class="gmail_default" style="">I got the path for the KERNELS=="1-1.2.7:1.x" by typing the command below in the terminal for each devices connected</div><div class="gmail_default" style="">udevadm info -a --name=ttyACM0</div><div class="gmail_default" style=""><br></div><div class="gmail_default" style="">      looking at parent device '/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2.7/1-1.2.7:1.0':</div>    <b>KERNELS=="1-1.2.7:1.0"</b><br>    SUBSYSTEMS=="usb"<div class="gmail_default" style=""><br></div><div class="gmail_default" style="">Reload the rules or reboot for them to take effect!!</div><div class="gmail_default" style=""><br></div><div class="gmail_default" style="">In python I use:</div><div class="gmail_default" style=""><br></div><div class="gmail_default" style="">    try:<br>        link = txfer.SerialTransfer('/dev/ttyUSB-motor', 57600)<br>        <br>        link.open()<br>        time.sleep(2) # allow some time for the Arduino to completely reset<br>        while True:<br>            .......<br></div><div class="gmail_default" style=""><br></div><div class="gmail_default" style="">Regards,</div><div class="gmail_default" style="">...Pat</div></div>