Using usbmod

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
EdK
Level 1
Level 1
Posts: 33
Joined: Mon Dec 18, 2017 3:11 pm
Location: Oregon

Using usbmod

Post by EdK » Thu Feb 08, 2018 1:07 pm

I want to be able to use usbmon to monitor USB devices. Using in the terminal lsusb > with.log, without.log, and then looking at the difference I find the Bus and Device numbers. When I try to use usbmon I'm stymied. In terminal I entered grep CONFIG_USB_MON /boot/config-`uname -r`, which resulted with "CONFIG_USB_MON=m", which seems to me to indicate usbmon is a module and so I entered modprobe usbmon which is apparently accepted; it just advanced to another input line, but if I try usbmon, with or without arguments, I see "usbmon: command not found".

Where do I go from here?
Ed
Mint 18.3 x64 Cinnamon - Sylvia

User avatar
WharfRat
Level 20
Level 20
Posts: 11286
Joined: Thu Apr 07, 2011 8:15 pm

Re: Using usbmod

Post by WharfRat » Thu Feb 08, 2018 1:26 pm

EdK,

As you discovered usbmon is a kernel module. You really can't do anything with it as there are no parameters to set or view in /sys/modules.

You can see this with modinfo usbmon

The config setting CONFIG_USB_MON=m means it's not built in to the kernel image and will be loaded when/if needed.

If you change that setting in the config file it will have absolutely no effect unless you recompile the kernel against that config file.
ImageImage

EdK
Level 1
Level 1
Posts: 33
Joined: Mon Dec 18, 2017 3:11 pm
Location: Oregon

Re: Using usbmod

Post by EdK » Thu Feb 08, 2018 2:09 pm

no effect unless you recompile the kernel against that config file
For this newbie that sounds scary, but I will research how that's done.
Is there any utility, application, or whatever I can use to accomplish similar results? I want to do something like usbmon would do... ie usbmon -i 6 | grep :007: to limit the outputs from USB bus 6 to the specific device I'm interested in monitoring (device 006) and then I would start a source for that USB bus traffic. (I'm gleaning this in bits and pieces from my research via the Internet)
Ed
Mint 18.3 x64 Cinnamon - Sylvia

User avatar
WharfRat
Level 20
Level 20
Posts: 11286
Joined: Thu Apr 07, 2011 8:15 pm

Re: Using usbmod

Post by WharfRat » Thu Feb 08, 2018 9:15 pm

Is this of any help https://www.kernel.org/doc/Documentation/usb/usbmon.txt or possibly
https://superuser.com/questions/743350/ ... b-pendrive

Can I ask where you found usbmon -i 6 | grep :007: :?:
ImageImage

EdK
Level 1
Level 1
Posts: 33
Joined: Mon Dec 18, 2017 3:11 pm
Location: Oregon

Re: Using usbmod

Post by EdK » Thu Feb 08, 2018 11:28 pm

Thanks for the links. I'll follow them up.
Can I ask where you found usbmon -i 6 | grep :007: :?:
When I did diff with.log without.log | grep '<' it returned

Code: Select all

< Bus 006 Device 007: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Here's the link that headed me there. https://arachnoid.com/JRX/index.html#Installation

I also found the power of udevadm monitor –udev. When I did that with the device USB cable Unplugged I was able to get the info I needed.

Code: Select all

UDEV  [18319.807181] remove   /devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2.4/6-2.4.2/6-2.4.2:1.0/ttyUSB2/tty/ttyUSB2 (tty)
UDEV  [18319.809522] remove   /devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2.4/6-2.4.2/6-2.4.2:1.0/ttyUSB2 (usb-serial)
Now I need to learn how to use that to connect my software to the device, an HF transceiver in this case. Moving forward, albeit slowly. At least I think I'm heading in the right direction... time will tell.

Ed
Mint 18.3 x64 Cinnamon - Sylvia

Post Reply

Return to “Newbie Questions”