Linux - port associated to a device - linux

I have one development board attached via USB to my Linux machine. For the sake of debugging I want to monitor the serial port. My problem is that I don't know how understand which serial port should I monitor.
When running lsusb in the terminal, I see
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0461:4e1d Primax Electronics, Ltd
Bus 001 Device 004: ID 0d28:0204 NXP LPC1768
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 046d:c019 Logitech, Inc. Optical Tilt Wheel Mouse
Bus 003 Device 002: ID 03f0:c511 Hewlett-Packard
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The device I am interested in is the NXP LPC1768,so it is "attached" to Bus01, device 04. However, which port should I monitor to read the serial port of that NXP LPC1768 device?
When running dmesg | grep tty, I see
[ 0.000000] console [tty0] enabled
[ 97.204143] cdc_acm 1-1.2:1.1: ttyACM0: USB ACM device
but this still doesn't give me that information I am looking for.
When I used Windows, I would go to the Device manager, Ports tab, see the COM port associated to the device and use software like Putty for monitoring the serial port.
Do you how can I do that in Linux?
I'm sorry if this question has been asked before but I've searched for an hour and still couldn't find the answer..

My problem is that I don't know how understand which serial port should I monitor.
If this "one development board" is recognized as a USB gadget by your Linux PC, then there will be syslog entries.
Disconnect the board, wait 15 seconds, then connect the board.
Use the commands dmesg | tail to review the end of the syslog.
You might get something like this:
$ dmesg | tail
[ 2094.481014] usb 1-1: Product: EDBG CMSIS-DAP
[ 2094.481019] usb 1-1: Manufacturer: Atmel Corp.
[ 2094.481023] usb 1-1: SerialNumber: ATML0000001351195199
[ 2095.033449] hidraw: raw HID events driver (C) Jiri Kosina
[ 2095.038550] cdc_acm 1-1:1.1: ttyACM0: USB ACM device
[ 2095.038874] usbcore: registered new interface driver cdc_acm
[ 2095.038877] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 2095.112372] usbcore: registered new interface driver usbhid
[ 2095.112376] usbhid: USB HID core driver
[ 2095.237686] hid-generic 0003:03EB:2111.0001: hiddev0,hidraw0: USB HID v1.11 Device [Atmel Corp. EDBG CMSIS-DAP] on usb-0000:00:1d.7-1/input0
$
The first three lines shown relate to the completion of the low-level USB protocol.
The remaining seven lines are the USB device installation.
It's the fifth line that's salient, as that indicates that the attached board implements the USB CDC (Communications Device Class) ACM (Abstract Control Model) to emulate a serial port.
If the SBC does connect as a serial device (e.g. /dev/ttyACM0 ), then you can use a terminal emulator program, such as minicom or puTTY.
$ minicom --device /dev/ttyACM0
When running dmesg | grep tty, I see
[ 0.000000] console [tty0] enabled
[ 97.204143] cdc_acm 1-1.2:1.1: ttyACM0: USB ACM device
but this still doesn't give me that information I am looking for.
Actually that is the information that you need (assuming this device is for your SBC).
ADDENDUM
When I tried to access it with putty, I got the error message "Unable to open connection Unable to access serial port".
Presumably the device node ttyACM is owned by root and the group dialout:
$ ls -l /dev/ttyACM*
crw-rw---- 1 root dialout 166, 0 Sep 22 15:54 /dev/ttyACM0
Verify that your username belongs to the dialout group (so that you have access to this device).
$ whoami
george
$ grep dialout </etc/group
dialout:x:20:george
If your username is not a member of the dialout group, then use the administrative (or system tool) program of your Linux distro to add your username to dialout. Or see https://unix.stackexchange.com/questions/14354/read-write-to-a-serial-port-without-root or https://askubuntu.com/questions/112568/how-do-i-allow-a-non-default-user-to-use-serial-device-ttyusb0

Related

How to configure driver in Buildroot for Moxa UPort 1110 USB serial converter?

I have a board with an embedded system that is buildroot based. In "make linux-menuconfig" I would like to add the appropriate drivers for the USB-RS232 adapter "Moxa UPORT 1110". I marked in "make linux-menuconfig":
Device Drivers-> USB support -> USB Serial Converter support-> USB MoxaUPORT Serial Driver
after connecting the adapter with the device, linux will not recognize the device.
When I check "lsusb" I get:
lsusb
Bus 001 Device 006: ID 110a:1110
Bus 001 Device 001: ID 1d6b:0002
The board does not see the producer's name etc. On my Ubuntu computer I get after plugging in usb and typing "lsusb ::
Bus 001 Device 036: ID 110a:1110 Moxa Technologies Co., Ltd.
When I check dmesg after plugging in the USB and see:
[ 9752.822985] usb 1-1: USB disconnect, device number 5
[ 9754.605939] usb 1-1: new full-speed USB device number 6 using musb-hdrc
[ 9754.768212] usb 1-1: New USB device found, idVendor=110a, idProduct=1110
[ 9754.775263] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 9754.782783] usb 1-1: Product: UPort 1110
[ 9754.786903] usb 1-1: Manufacturer: Moxa Technologies Co., Ltd.
should I check any additional settings / drivers in "make linux-menuconfig" to see the USB-R232 adapter?
From looking at the Linux source code, I understand that you enabled the mxuport driver which does not cover the UPORT 1110. However, it looks like the ti_usb_3410_5052 driver does. You can enable it by setting CONFIG_USB_SERIAL_TI.
In the Buildroot sources I see that you must make sure that BR2_PACKAGE_LINUX_FIRMWARE_USB_SERIAL_TI is set in order to include the firmware file (moxa-1110.fw).
So, in make menuconfig enable USB TI 3410/5052 Serial Firmware under Target packages > Hardware handling > Firmware > linux-firmware > USB to Serial Firmware

Linux, wierd issues with camera on Debian system

So, I made some high speed opencv camera detection code, got it running on my debian labtop, and bought some 720p60 chinese usb cam. All worked well. However I wanted to make it run on my TinkerBoard S (tinkerOS - debian).
Here the camera simply refused to get detected, as my lsusb output hinted (also tried guvcview & cheese, none worked):
Bus 001 Device 006: ID 05a3:9230 ARC International
Bus 001 Device 004: ID 1ea7:2001 *this is where i suspect the cam should be*
Bus 001 Device 005: ID 0458:003a KYE Systems Corp. (Mouse Systems) NetScroll+ Mini Traveler / Genius NetScroll 120
Bus 001 Device 003: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 0bda:481a Realtek Semiconductor Corp.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
However I think I found the issue, just dont know the solution. When running dmesg, I found the following entries:
[ 94.277615] usb 1-1.4: new high-speed USB device number 6 using dwc2
[ 94.450592] usb 1-1.4: New USB device found, idVendor=05a3, idProduct=9230
[ 94.450611] usb 1-1.4: New USB device strings: Mfr=2, Product=1,
SerialNumber=0
[ 94.450625] usb 1-1.4: Product: USB 2.0 Camera
[ 94.450637] usb 1-1.4: Manufacturer: HD Camera Manufacturer
[ 94.454526] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (05a3:9230)
[ 94.496335] uvcvideo: auto-suspend is blacklisted for this device
EDIT: both outputs are from the tinker Board.
Sounds like whatever driver is installed on your laptop doesn't exisit on the TinkerOS board. Going by the second code block, this line looks like the camera:
Bus 001 Device 006: ID 05a3:9230 ARC International
It would be useful to have a comparison from the laptop to see what's different.
Maybe try these answers to obtain the driver (on the laptop with the webcam connected). Be sure to use the same physical ports when changing stuff over, to avoid numbers changing and causing confusion.
Searching the vendor / product code (05a3:9230) on google brings up some related results aswell although nothing I found to be conclusive.
Dead thread but still feel I should provide the solution.
Turns out that despite the cam being the only one connected, it was somewhere all the way at /dev/video4
whatever be the reason...

Configuring the minicom serial port

Actually i want to use minicom to run AT commands for my GSM modem (USB 2.0 FAX MODEM).
output of lsusb:-
Bus 002 Device 009: ID 17ef:602d Lenovo
Bus 002 Device 008: ID 04ca:0061 Lite-On Technology Corp.
Bus 002 Device 007: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
Bus 002 Device 012: ID 0572:1300 Conexant Systems (Rockwell), Inc. SoftK56 Data Fax Voice CARP
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
and the output of dmesg:-
[ 0.000000] console [tty0] enabled
[ 2933.978369] usb 2-1.1: generic converter now attached to ttyUSB0
The output of my assigned serial port is ttyUSB0.
So when i configure the serial port in minicom :-
serial port - /dev/ttyUSB0
Baud rate - 9600 8NI
Flow control - OFF
and then save the setting as dfl.
it says configuration saved.
But when i run "Sudo minicom" from mu ubuntu terminal :-
Welcome to minicom 2.6.2
OPTIONS: I18n
Compiled on Feb 8 2013, 06:27:51.
Port /dev/ttyUSB0, 18:54:08
Press CTRL-A Z for help on special keys
Oops - Its not giving me the cmd to write my at commands.
Any suggesstions would be highly appreciated.
I also had the same issue with my Nokia N21 Modem and minicom. I just used utility called screen and only executed
sudo screen /dev/ttyUSB0 9600
and bingo !!
Cheers
Anuradha

kinect "unable to enumerate USB device on port" mounts as regular hub, but "Xbox NUI Camera" and "Xbox NUI Audio" are detected

NOTE: MY DEVICE is an xbox 360 kinect device NOT a kinect for windows.
I have tried different linux kernels and different compilations of libfreenect, but no cigar.
The light on the connection cord is solid green, the light on the kinect device blinks green (when its plugged into my running computer).
One pecularity that seemed suspicious is that the udev file designates ATTR{idProduct}=="02b0" to the xbox "Xbox NUI Motor". As one can see in my lsusb file linux is recocnizing the device with an idProduct of "02c2". The device has been purchased about a month ago, so could they have changed the idProduct?? Under this guess I modified my udev rules files restarted udev, no work, then restarted my computer, still no work.
I am compiling libfreenect from github and you can see the output below. I also tried the debian package (0.1.2). Since "Xbox NUI Audio" "Xbox NUI Camera" are detected I feel its not a usb power issue, but I could be wrong.
test program output:
$ ./bin/glview
Kinect camera test
Number of devices found: 1
Could not open device
debug info:
$ dmesg
[ 361.532077] usb 1-4: new high-speed USB device number 2 using ehci_hcd
[ 361.664408] usb 1-4: New USB device found, idVendor=045e, idProduct=02c2
[ 361.664416] usb 1-4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 361.664875] hub 1-4:1.0: USB hub found
[ 361.665008] hub 1-4:1.0: 2 ports detected
[ 361.940144] usb 1-4.2: new high-speed USB device number 3 using ehci_hcd
[ 361.972410] hub 1-4:1.0: unable to enumerate USB device on port 2
[ 362.668134] usb 1-4.1: new high-speed USB device number 4 using ehci_hcd
[ 362.762514] usb 1-4.1: New USB device found, idVendor=045e, idProduct=02ad
[ 362.762522] usb 1-4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 362.762529] usb 1-4.1: Product: Xbox Kinect Audio, \xffffffc2\xffffffa9\xffffffa9 2011 Microsoft Corporation. All rights reserved.
[ 362.762535] usb 1-4.1: Manufacturer: Microsoft
[ 362.762540] usb 1-4.1: SerialNumber: A70774X04011232A
lsusb debug info:
$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 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
Bus 003 Device 002: ID 064e:a101 Suyin Corp. Acer CrystalEye Webcam
Bus 005 Device 003: ID 0c45:7403 Microdia
Bus 001 Device 002: ID 045e:02c2 Microsoft Corp.
Bus 001 Device 004: ID 045e:02ad Microsoft Corp. Xbox NUI Audio
Bus 001 Device 006: ID 045e:02ae Microsoft Corp. Xbox NUI Camera
Installed ROS (fuerto/groovy) + PCL and works fine with openni_launch package. I'm using XBOX kinect also. Use RVIZ for visualization!

re-plug required to get usb device link established

I'm having a builddroot assembled busybox distribution running on my micro.
It all works well so far but I realized one thing. When I boot my box up and
I do an lsusb I see this:
# lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 003: ID 12d1:14ac Huawei Technologies Co., Ltd.
Bus 001 Device 004: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x
Composite Device
and I have following links:
ttyUSB0 ttyUSB1 ttyUSB2 ttyUSB3
buyt none of those links seem to go to Device 0004 but if I replug the
CP210x device, I get this:
# lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 003: ID 12d1:14ac Huawei Technologies Co., Ltd.
Bus 001 Device 005: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x
Composite Device
and these links:
ttyUSB0 ttyUSB1 ttyUSB2 ttyUSB3 ttyUSB4
and now ttyUSB4 is linking to my Device 005 why do I need to replug my
device in order to get a working symlink? That's not what I want? :(
How can I fix this? The cp210x module is compiled into the kernel (not
attached as a separate module) - any suggestions?
This for some reason just stop happening probably due to the fact that we're only using one usb device now. Inodes would have been a solution but got never implemented in our system.

Resources