MrM87
Posts: 4
Joined: Thu Feb 11, 2016 10:16 pm

how to determine port of a device (like /dev/ttyUSB0)

Thu Feb 11, 2016 10:21 pm

Hello!
i'm so sorry but i have a problem:
under lsusb i have this device
Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

until today if i dind't remember badly, this serial adapter was under
/dev/ttyUSB0

But not i don't have yet this device...
pi@raspberrypi ~ $ dmesg | grep tty
[ 0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708.boardrev=0x1000002 bcm2708.serial=0x316d6fc1 smsc95xx.macaddr=B8:27:EB:6D:6F:C1 bcm2708_fb.fbswap=1 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0xec00000 vc_mem.mem_size=0x10000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
[ 0.001731] console [tty1] enabled
[ 0.139514] 20201000.uart: ttyAMA0 at MMIO 0x20201000 (irq = 83, base_baud = 0) is a PL011 rev2
[ 0.523718] console [ttyAMA0] enabled

Can someone help me?
thanks in advance

MrM87
Posts: 4
Joined: Thu Feb 11, 2016 10:16 pm

Re: how to determine port of a device (like /dev/ttyUSB0)

Fri Feb 12, 2016 12:22 am

[ 2.934320] usb 1-1.2: new full-speed USB device number 4 using dwc_otg
[ 3.057009] usb 1-1.2: New USB device found, idVendor=067b, idProduct=2303
[ 3.065966] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber =0
[ 3.075246] usb 1-1.2: Product: USB-Serial Controller
[ 3.082483] usb 1-1.2: Manufacturer: Prolific Technology Inc.
[ 5.114873] EXT4-fs (mmcblk0p2): recovery complete
[ 5.134064] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. O pts: (null)
[ 5.145974] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 5.156250] devtmpfs: mounted
[ 5.162272] Freeing unused kernel memory: 348K (c07c3000 - c081a000)
[ 8.127361] udevd[162]: starting version 175
[ 12.564382] random: nonblocking pool is initialized
[ 15.854198] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 16.414148] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 26.918399] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 32.121360] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 33.646357] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE 1
[ 45.489901] Adding 102396k swap on /var/swap. Priority:-1 extents:129 across :1754856k SSFS
[ 111.437123] uart-pl011 20201000.uart: no DMA platform data

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: how to determine port of a device (like /dev/ttyUSB0)

Fri Feb 12, 2016 12:43 am

Type this without the device plugged in:

Code: Select all

ls -l /dev > /tmp/dev1.txt
Type this with the device plugged in:

Code: Select all

ls -l /dev > /tmp/dev2.txt
This will show the new device (an Arduino in my case):

Code: Select all

diff /tmp/dev1.txt /tmp/dev2.txt
7c7
< drwxr-xr-x 2 root root        2380 Feb  4 20:17 char
---
> drwxr-xr-x 2 root root        2420 Feb 12 00:30 char
64a65
> drwxr-xr-x 4 root root          80 Feb 12 00:30 serial
134a136
> crw-rw---- 1 root dialout 166,   0 Feb 12 00:30 ttyACM0 
160c162
< prw-r----- 1 root adm            0 Feb 12 00:29 xconsole
---
> prw-r----- 1 root adm            0 Feb 12 00:30 xconsole
Ignoring all the system stuff, /dev/ttyACM0 is my new device.

Return to “Beginners”