permanent USB port names? (Linux) [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have two Arduinos now used by my program.
SInce I'm on Linux and new to Linux, the port isn't static, like "com3" and "com6", I think it's "ttyUSB0" for the first Arduino which is connected, and "ttyUSB1" for the second and so on. But since both are connected when the OS boots, can I be certain that the port names will remain the same? Or is there some other way to access ports by name?

use udev!
udevadm info -a -n /dev/ttyUSB1 | grep '{serial}' | head -n1
should give you the USB interfaces serial number.
then you can write udev rules:
example
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A6008isP", SYMLINK+="arduino"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A7004IXj", SYMLINK+="buspirate"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="FTDIF46B", SYMLINK+="cisco.serial"

Related

Why wouldn't lspci show extended config space? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I use in different Linux distribution running on Windows 10-hosted VirtualBox the following command:
lspci -xxxx
It prints dump of config spaces up to 64 bytes
When I try
sudo lspci -xxxx
It prints dump of config spaces up to 256 bytes
Can I get whole PCIe 4096 config space using lspci?
#prl made a good point to check if there is PCI Express capability (capability id 10h).
Turned out that most of devices seen under VirtualBox have all zeros in PCI capabilities space (0x40 thru 0xFF), they also have zero capabilities pointer. Even a device which has some capabilities does not have PCI Express capability.
I think it is VirtualBox emulation limitation.

Get device name from PCIE slot number [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I have 4 SSD cards plugged into my system. They show up as /dev/nvme[0-3]n1.
Using lspci -vvv I can get the PCIE slot numbers of these 4 cards. But how to match the PCIE slot number with the device name? For example one of the cards has the slot number 3b:00:0. What is the corresponding /dev/nvme[0-3]n1?
I have gone through /sys/bus/pci/devices but not found what I'm looking for. Google has not thrown up any answers either.
TIA
cheers
You may try searching for device name somewhat like this:
grep "3b:00.0" /sys/class/nvme/*/device/uevent
Then you will need to extract device name from the output:
/sys/class/nvme/nvme0n1/device/uevent:PCI_SLOT_NAME=0000:3b:00.0
This will be the string in place of the asterisk.

Detect RAID Hardware or Software on Debian [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
Are there any way to detect if my server (on debian 6) is using RAID by Hardware or Software?. I have used some command but my server do not recognize them.
/proc/mdstat
omreport storage vdisk
cat /proc/mdstat
The commands upside is the only one that I have tried.
For hardware, try
lspci -vv | grep -i raid.
For software, try the mdadm utility. It is used to manage MD devices (or Linux Software RAID). In particular, try its query command. The mdadm manpage says
This will find out if a given device is a RAID array, or is part of one, and will provide brief information about the device.
You can get a list of devices in /dev with ls -a /dev and then use
mdadm --query /dev/DEVICENAME
Sources:
hardware: https://unix.stackexchange.com/questions/139271/how-to-get-details-of-raid-devices-both-soft-and-hard
software: https://linux.die.net/man/8/mdadm

WindRiver - eth0: error fetching interface information: Device not found [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
In the "ifconfig" I don't see eth0 appears.
When I tried to type:
dmesg | grep eth0
I got the following message
eth0: PHY ID 200xx5c99 at 1 IRQ ) (stmmac-1:01) active
And when I typed:
cat /etc/udev/ruled.d/70-persistentnet.rules
I got the following message
# PCI device 0x8086:0x0937 (stmmaceth)
SUBSYSTEM=="net" , ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:97:55:ff:b8", ATTR{dev_id}=="0x0",ATTR{type}=="1",KERNEL=="eth*",NAME="eth0"
I dont get any idea why eth0 does not appear,please let me know if you may have any idea.
The typical reason why ifconfig does not show an interface is because this interface is not in the "UP" state, and the typical (again) reason for this is that the interface does not have an IP address.
For ifconfig to "display all interfaces which are currently available, even if down" (quoting the man page), use ifconfig -a.

Pipe One Serial Port to Another in Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am looking for a means to pipe one serial ports data (regardless of data type) to another serial port. In my case I am trying to take in data from one serial port and output it through a radio connected to another serial port in real time.
I already know what ports I am using and have looked up a program called socat, which should be able to handle it but there are no examples of how to do this and I have not been able to figure out how to do it.
Has anybody been able to use socat or a bash scipt/some other method to accomplish this in Linux??
I am running Ubuntu 14.04.
Assuming the serial port you are reading from is /dev/ttyS0, and the other you are writing to (where the radio is connected) is /dev/ttyS1 you shall simply do:
cat /dev/ttyS0 > /dev/ttyS1
or
dd if=/dev/ttyS0 of=/dev/ttyS1 bs=1
Of course before you should set all the serial ports' parameters using stty command.

Resources