USB bus ports representation in sysfs - linux-kernel

Following is the output of /sys/bus/usb/devices/ in the embedded system.
# ls /sys/bus/usb/devices/
1-0:1.0 1-1 1-1.1 1-1.1:1.0 1-1.1:1.1 1-1.1:1.2 1-1:1.0 usb1
#
While trying to understand this output, it was mentioned in some place as "bus-port.port".
My understanding is a port will be connected to a bus and device will connect to port, my doubt here is how a port is connected to another port.
In which scenario the Kernel will create sysfs entry as "1-1.1".

That happens when a docking station is connected.
In your example, 1-1 is a device connected to port 1 on your computer and 1-1.1 is a device connected to port 1 on a docking station that is connected to port 1 on your computer.

Related

Golang cannot send packets to stun received ip

I’m using Golang to try to send packets through UDP to an IP address and port provided by STUN. The goal is to communicate between two devices without having to open a port in the firewall, as both devices are located in a different network.
The program runs on both devices in the following manner:
Device 1 waits for device 2 to send the IP address and port found by STUN. This goes through an open port in the firewall of device 1. (Only for device 1 an open port is possible)
The problem is that device 2 does not receive any packets through the port found by STUN.
I think the problem consists of the router not knowing the connection to device 2. Device 2 is connected with the router, but the router doesn’t know what to do with the packets.
Do you have any idea how to solve this problem?
Thanks!

Do I understand the mechanism of COM Port assignment for USB-Serial bridge (VCP) correctly?

I have to base a critical Windows 7 software on virtual COM Port assignment. The software has to test devices in a production line. Each device is different and needs to be supplied with individual security keys.
There are 20 serial connections from an USB-Serial bridge (Silicon Lab CP2103). Each connection on a physical USB Port gets some virtual COM Port, which I can adapt by the device manager (e.g. to COM7).
If the serial number of the bridges are all the same, I was told, that Windows remembers the chosen COM Port for each USB Port. Can I rely on that to be "stable" under restarts and other USB activities, not related to my adapters?
What would be the difference, if each adapter has individual serial number: Is it true, that in this case Windows remembers the COM assignment, but is doesn't matter which physical USB port is used for connection?
Are there any recommendations to do it in one or an another way?

Getting the USB hub port of an open handle

I have a situation where my product enumerates to Windows and I can see it and all its sub components.
My problem is that there is a:
USB Connector - HUB - Port 1 - USB Component
Port 2 - USB Component
Port 3 - USB Component
Port 4 - USB Component
At the time of enumeration the USB Components all the look the same. They have a serial number that is programmed into them at manufacture time, but it is not marked on the part. I can open the device by the serial number. What I need to do after I open it, is to find out what hub port the device is on so that I can be sure I opened the proper part. If I have the wrong one I can open the next until I get the proper port. How can I tell which port the open handler is on? I can try IOCTL or SetupDi but I do not know what to look at or what to do with the data when it comes back.
Basically I have an open pipe/handle to a device on a hub, I want to find out what hub port that handle is pointing to.
Any ideas?

LLDP In wirelss port

Currently I am designing layer 2 topology discovery application. LLDP protocol helps me to discover layer 2 neighbor devices. So far I have observed that LLDP is only available in Layer 2 Device Lan Ports but Wirless port does not provides LLDP information.
As per LLDP, if more neighbor device are connected to the same port (i.e By the help of HUB ) on the local device, then it may not give all neighbor information. This may not be suitable for Wireless device, because WLAN AP device connects many more client on the same port.
Also, WLAN AP itself provides all connected client information on their private MIBS and WLAN client device says who is my current WLAN AP. This would be sufficient to know the neighbor device and thus no need of LLDP in WLAN port.
Please help to me know, is my assumption correct? and Is there any wireless port provides LLDP information?

Embedded Linux - Get Signal Strength of Modem While Connected

I am running a USB cell modem via PPP in Embedded Linux. I can use AT commands via minicom to connect to the modem and interrogate the signal strength (AT+CSQ) when the PPP connection is not active. However, when it's active, this is not possible.
Is there any way to retrieve the signal strength from a PPP connected USB cell modem while the PPP connection is being used? I am open to an API or any other method available.
I don't have a umw190, but the Linux driver for the modem should have more than one ttyACM character device available. Use one for PPP and the other for AT+CSQ. Check dmesg for cdc_acm to see.
If your embedded device has udev then both devices should automagically appear in /dev. If not you'll have to mknod more. Off the top of my head major number is 166 for cdc_acm.
What does the physical setup look like?
1. Are you using a modem that is on a board designed/printed by the same company as your SBC?
2. Is it connected via something like PC104 serial or USB?
3. What specific modem are you using?

Resources