Hi I’m new to Raspberry pi and trying to get 2 devices to assign to exact TTYUSB
Below is some info that may help. Any help is appreciated.
Thanks
Chris Hopper
lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 043: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 001 Device 042: ID 1546:01a9 U-Blox AG u-blox GNSS receiver
Bus 001 Device 041: ID 0424:2512 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 044: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
____________________________________________________________________________________________________________-
#########FAULT###################
dmesg | grep ttyUSB #plug in gps first
[6687.172588] usb 1-1.2.2: ch341-uart converter now attached to ttyUSB0
[ 6690.337939] usb 1-1.1: FTDI USB Serial Device converter now attached to ttyUSB1
dmesg | grep ttyUSB #plug in gps second
[ 6781.750850] usb 1-1.1: FTDI USB Serial Device converter now attached to ttyUSB0
[ 6788.089243] usb 1-1.2.2: ch341-uart converter now attached to ttyUSB1
#python script ping assigned to ttyusb1
def read_ping_data(data_list, pole_height, script_running):
myPing = Ping1D()
myPing.connect_serial(“/dev/ttyUSB1”, 115200)
myPing.set_speed_of_sound(1500) # Hardcoded speed of sound, consider using a variable
sudo nano /etc/udev/rules.d/99-usb-serial.rules
Rule for u-blox GNSS receiver to always use ttyUSB0
SUBSYSTEM==“tty”, ATTRS{idVendor}==“1546”, ATTRS{idProduct}==“01a9”, SYMLINK+=“ttyUSB0”
Rule for other devices to use ttyUSB1
SUBSYSTEM==“tty”, ATTRS{idVendor}==“0424”, ATTRS{idProduct}==“2512”, SYMLINK+=“ttyUSB1”
SUBSYSTEM==“tty”, ATTRS{idVendor}==“0403”, ATTRS{idProduct}==“6015”, SYMLINK+=“ttyUSB1”
<O
<E
sudo udevadm control --reload-rules
sudo udevadm trigger
still switching
I even tried to change this to ttyUSB2
SUBSYSTEM==“tty”, ATTRS{idVendor}==“0403”, ATTRS{idProduct}==“6015”, SYMLINK+=“ttyUSB1”