Max_G
Posts: 32
Joined: Sat May 28, 2016 8:27 am

ttyUSB not created when plugging in USB devices

Wed Sep 21, 2016 5:45 am

Running Raspbian GNU/Linux, V8 (jessie) on a new rPi3.
I am connecting a USB-serial device via USB.
The device shows up under lsusb:

Code: Select all

Bus 001 Device 004: ID 0403:8508 Future Technology Devices International, Ltd
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
... here device #4.
I cannot 'talk' to this device, because it does not appear under /dev as (I would expect) ttyUSB0

I had on initial install a keyboard and mouse connected which worked just fine.

I tried the following:
1. create the item in /etc/udev/rules.d/10-local.rules:

Code: Select all

ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8508", SYMLINK+="SPPRO"
This created the SPPRO device, but I had no access.

Code: Select all

chgrp -h dialout /dev/SPPRO
changed group; still no access

2. tried adding the vendor and product IDs:
nano /sys/bus/usb-serial/drivers/ftdi_sio/new_id
0403 8508
The directory usb-serial does not exist.

3. created a node:

Code: Select all

 mknod /dev/ttyUSB0 c 188 0
results in permission denied, despite addin it to the dialout group I am a member of too.

Code: Select all

crw-r--r-- 1 root dialout 188, 0 Sep 21 15:37 /dev/ttyUSB0
The device I am connecting is a USB1.1 serial device -- and works via its USB port (on Windows, hence, it is working as far as Linux must be concerned).

Code: Select all

T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0403 ProdID=8508 Rev=06.00
S:  Manufacturer=Selectronic
S:  Product=Selectronic SP PRO
S:  SerialNumber=0_139030-5.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)

usb-devices** reports "Spd=12" which, AIUI, implies USB 1.1
I am not really clear about what I was doing here... hence, I am lost.

Any hints appreciated.

User avatar
topguy
Posts: 5626
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: ttyUSB not created when plugging in USB devices

Wed Sep 21, 2016 10:33 am

According to the usb id database ( http://www.linux-usb.org/usb-ids.html ) it doesnt seem like the 0403:8508 device is known ( supported ) by linux.

More details can probably be found by checking the output of "dmesg" after plugging the device in.

Regarding your attempt no.2:
This sound like a clearer procedure:
- Unplug the device
- modprobe ftdi_sio
- echo 0403 8508 >/sys/bus/usb-serial/drivers/ftdi_sio/new_id
- Plug in the device

Max_G
Posts: 32
Joined: Sat May 28, 2016 8:27 am

Re: ttyUSB not created when plugging in USB devices

Wed Sep 21, 2016 11:45 am

Thank you kindly...

I got a step further with: sudo modprobe ftdi_sio
... which created the directory under /sys/bus/usb-serial/drivers
then
echo 0403 8508 >/sys/bus/usb-serial/drivers/ftdi_sio/new_id
which resulted in
sudo echo 0403 8508 >/sys/bus/usb-serial/drivers/ftdi_sio/new_id
-bash: /sys/bus/usb-serial/drivers/ftdi_sio/new_id: Permission denied

[code]# 21:36:06 [email protected] /sys/bus/usb-serial/drivers/ftdi_sio $
ls -la
total 0
drwxr-xr-x 2 root root 0 Sep 21 21:32 .
drwxr-xr-x 4 root root 0 Sep 21 21:32 ..
--w------- 1 root root 4096 Sep 21 21:35 bind
lrwxrwxrwx 1 root root 0 Sep 21 21:35 module -> ../../../../module/ftdi_sio
-rw-r--r-- 1 root root 4096 Sep 21 21:35 new_id
--w------- 1 root root 4096 Sep 21 21:32 uevent
--w------- 1 root root 4096 Sep 21 21:35 unbind
[/code]

... by the looks of it, rather symbolic link...

sudo cat new_id
does not show anything = empty file?!


more ideas?

User avatar
topguy
Posts: 5626
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: ttyUSB not created when plugging in USB devices

Wed Sep 21, 2016 11:53 am

Yeah, echo + piping don't work with sudo that way.

Code: Select all

sudo sh -c "echo 0403 8508 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id" 
Or just do "sudo bash" first and skip sudo on the rest of the commands. just remember to logout to go back to pi user.

Max_G
Posts: 32
Joined: Sat May 28, 2016 8:27 am

Re: ttyUSB not created when plugging in USB devices

Wed Sep 21, 2016 12:21 pm

:) this worked...

Code: Select all

Sep 21 16:55:57 rpi31 kernel: [69223.995362] usbcore: registered new interface driver usbserial
Sep 21 16:55:57 rpi31 kernel: [69223.996941] usbcore: registered new interface driver usbserial_generic
Sep 21 16:55:57 rpi31 kernel: [69223.997521] usbserial: USB Serial support registered for generic
Sep 21 21:32:50 rpi31 kernel: [85837.751662] usbcore: registered new interface driver ftdi_sio
Sep 21 21:32:50 rpi31 kernel: [85837.751772] usbserial: USB Serial support registered for FTDI USB Serial Device
Sep 21 22:04:21 rpi31 kernel: [87728.680575] usb 1-1.3: new full-speed USB device number 5 using dwc_otg
Sep 21 22:04:21 rpi31 kernel: [87728.813528] usb 1-1.3: New USB device found, idVendor=0403, idProduct=8508
Sep 21 22:04:21 rpi31 kernel: [87728.813550] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep 21 22:04:21 rpi31 kernel: [87728.813563] usb 1-1.3: Product: Selectronic SP PRO
Sep 21 22:04:21 rpi31 kernel: [87728.813575] usb 1-1.3: Manufacturer: Selectronic
Sep 21 22:04:21 rpi31 kernel: [87728.813587] usb 1-1.3: SerialNumber: 0_139030-5.0
Sep 21 22:04:22 rpi31 kernel: [87728.824529] usb 1-1.3: Detected FT232RL
Sep 21 22:04:22 rpi31 kernel: [87728.825488] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0
...and my python code can now connect to the device via ttyUSB ... thank you very much!!

BTW: Tried to submit the IDs, but the server errors on registering :(

User avatar
scruss
Posts: 2367
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: ttyUSB not created when plugging in USB devices

Wed Sep 21, 2016 1:47 pm

glad you got it working! Sounds like a similar process for a rebadged FTDI device that simon13 had a couple of weeks ago: Fronius serialport converter not mapped to /dev/tty - though their device was RS422.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

Return to “Troubleshooting”