magu_
magu_

Reputation: 4856

Find specific USB port under Ubuntu

I want to connect to my BeagleBone Black via USB in C++ more or less using this way.

In order to do so, I need to find the port on the BeagleBone Black as well as on my laptop.

My BeagleBone Black hangs on the same network as the host and is also connected over USB. I tried to find the port using lsusb and ifconfig (results are beneath).

How do I find the device?

OS: Ubuntu on both systems

On the host there are the files:

On the BeagleBone Black there are the files:

lsusb @ host:

Bus 001 Device 004: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget
Bus 003 Device 002: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Bus 005 Device 002: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

lsusb @ BBB:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

ifconfig @ host:

eth0      Link encap:Ethernet  HWaddr 00:21:86:98:da:67
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
      Interrupt:20 Memory:fe200000-fe220000

eth1      Link encap:Ethernet  HWaddr 90:59:af:5b:50:ca
      inet addr:192.168.7.1  Bcast:192.168.7.3  Mask:255.255.255.252
      inet6 addr: fe80::9259:afff:fe5b:50ca/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:3777 errors:0 dropped:0 overruns:0 frame:0
      TX packets:4763 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:958652 (958.6 KB)  TX bytes:1113836 (1.1 MB)

lo        Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:1687 errors:0 dropped:0 overruns:0 frame:0
      TX packets:1687 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:154459 (154.4 KB)  TX bytes:154459 (154.4 KB)

wlan0     Link encap:Ethernet  HWaddr 00:13:e8:c0:1f:fd
      inet addr:192.168.1.102  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::213:e8ff:fec0:1ffd/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:23129 errors:0 dropped:0 overruns:0 frame:0
      TX packets:14663 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:18413433 (18.4 MB)  TX bytes:2312100 (2.3 MB)

ifconfig @ BBB:

eth0      Link encap:Ethernet  HWaddr 90:59:af:5b:50:c8
      inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::9259:afff:fe5b:50c8/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:4216 errors:0 dropped:0 overruns:0 frame:0
      TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:1467748 (1.4 MB)  TX bytes:3232 (3.2 KB)
      Interrupt:56

lo        Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

usb0      Link encap:Ethernet  HWaddr fa:82:fc:fe:32:05
      inet addr:192.168.7.2  Bcast:192.168.7.3  Mask:255.255.255.252
      inet6 addr: fe80::f882:fcff:fefe:3205/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:4715 errors:0 dropped:0 overruns:0 frame:0
      TX packets:3737 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:834726 (834.7 KB)  TX bytes:1170046 (1.1 MB)

Upvotes: 0

Views: 10688

Answers (1)

David Grayson
David Grayson

Reputation: 87376

I would guess that the port you want to talk to is /dev/ttyACM0.

I suspect that the "1d6b:0104 Linux Foundation Multifunction Composite Gadget" is the entry corresponding to the BeagleBone.

Do the 1d6b entry and ttyACM0 go away when you unplug the BeagleBone? Could you run dmesg right after plugging in the BeagleBone to USB and show us the lines that correspond to your laptop recognizing the BeagleBone, and everything after that?

Upvotes: 1

Related Questions