01-19-2016
USB port events linstening
Hi everybody!
I am a
complete newbie.
Is it possible to write a script (
shell or python) to listen to usb port event and to notify me every time an usb storage key is plugged or ejected? I want it to echo the device to mount (eg. /dev/sdb).
I wrote an udev rule wich runs a script after usb plugging but I don't know how to get the right device interface(eg. /dev/sdb) attached to my usb device.
The second problem is, how to get the right device interface if I plugged two or more usb devices? I'm lost.
Please, help me.
I'm working on a raspberry pi (without monitor).
Thanks.
10 More Discussions You Might Find Interesting
1. Solaris
hi all,
I have been trying to setup network on solaris10 from a long time but am unable to do so..
I tried it with the ethernet card i have(dfe -520tx) but since i was not able to find drivers for that particular device, i thought of using the usb mode to run network..
However am not able... (0 Replies)
Discussion started by: wrapster
0 Replies
2. AIX
Hello AIX Group Members,
I have two systems: (1) IBM pSeries 640, 7026-B80. (2) A 5-month old HP laptop with Windows Vista. It has no serial port and only has USB ports on it.
My question are: How can I use the laptop as the p640's terminal? How can I make the connection? What type of cable... (4 Replies)
Discussion started by: aixlover
4 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I have PC with Linux OS RHEL3 and USB port is disabled from BIOS. BIOS access is protected using password. But, I have root access. Now, how can I enable USB port using root access? Is there any trick that I can do using root access that can enable USB port once my PC has booted up? (3 Replies)
Discussion started by: gydave
3 Replies
4. UNIX for Advanced & Expert Users
I want to watch the USB ports.
If any device is connected to the USB port I want to take the name of the device and
I want to log the device name. how to watch all the USB ports.
How to find the device is connected in which usb port. (1 Reply)
Discussion started by: ungalnanban
1 Replies
5. Ubuntu
Hi
I have to buy my selfe external case for hdd but I don't know whether my ubuntu linux, needs some driver to be able to work with this device or it has inside of itselfe this driver ?
rhx for help. (1 Reply)
Discussion started by: presul
1 Replies
6. Hardware
I'm looking for a router that has a USB port for my 3G internet card (which is USB) so that several cell phones can connect to the router for wifi internet during a trip with no power outlets except the occasional stop where I will be able to recharge once every 8-10 hours or so.
Obviously I'm... (1 Reply)
Discussion started by: Emiles
1 Replies
7. UNIX for Dummies Questions & Answers
Hello All,
So I have been running into an issue with a USB Modem where if someone ends their dialin connection abruptly from the other side the modem gets stuck
and I found that the only way to fix it is to either unplug the USB Modem and plug it back in, or just reboot. I'd rather not reboot... (5 Replies)
Discussion started by: mrm5102
5 Replies
8. Solaris
Hello,
I have an unloaded T5140 machine and want to access the ILOM for the first time and subsequently the network port after that., and then load Solaris 10 the final January 2011 build.
The first part is what confuses me -the cabling.
I am coming from a Windows machine (w/appropriate... (5 Replies)
Discussion started by: joboy
5 Replies
9. Solaris
In ubuntu etopic i create this udev rules for prolink 3g usb modem:
SUBSYSTEM=="block",
SUBSYSTEM=="scsi",
ATTRS{idVendor}=="1e0e",
ATTRS{idProduct}=="f000",
ACTION=="add",
RUN+="/sbin/modprobe usbserial Vendor=0X1e0e Product=0Xf000"
After plugging the usb modem, ubuntu assigns the ports... (4 Replies)
Discussion started by: shamsat
4 Replies
10. Linux
I have someone wanting to connect to the serial management port of a switch from a PC running CentOS6. The management port on the switch is apparently baud 9600, 8 data bits, 1 stop bit & no parity They have plugged in a cable to connect and the output from lsusb is:-Bus 001 Device 001: ID... (7 Replies)
Discussion started by: rbatte1
7 Replies
LEARN ABOUT LINUX
usb-devices
usb-devices(1) Linux USB Utilities usb-devices(1)
NAME
usb-devices - print USB device details
SYNOPSIS
usb-devices
DESCRIPTION
usb-devices is a (bash) shell script that can be used to display details of USB buses in the system and the devices connected to them.
The output of the script is similar to the usb/devices file available either under /proc/bus (if usbfs is mounted), or under /sys/ker-
nel/debug (if debugfs is mounted there). The script is primairily intended to be used if the file is not available.
In contrast to the usb/devices file, this script only lists active interfaces (those marked with a "*" in the usb/devices file) and their
endpoints.
Be advised that there can be differences in the way information is sorted, as well as in the format of the output.
RETURN VALUE
If sysfs is not mounted, a non-zero exit code is returned.
FILES
/sys/bus/usb/devices/usb*
The part of the sysfs tree the script walks through to assemble the printed information.
/proc/bus/usb/devices
Location where the usb/devices file can normally be found for Linux kernels before 2.6.31, if usbfs is mounted.
/sys/kernel/debug/usb/devices
Location where the usb/devices file can normally be found for Linux kernel 2.6.31 and later, if debugfs is mounted.
SEE ALSO
lsusb(8), usbview(8).
AUTHORS
Greg Kroah-Hartman <greg@kroah.com>
Randy Dunlap <rdunlap@xenotime.net>
Frans Pop <elendil@planet.nl>
usbutils-001 23 June 2009 usb-devices(1)