WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to get VID and PID of USB flash drive in TC?  (Read 6083 times)

Offline Paulo

  • Full Member
  • ***
  • Posts: 139
How to get VID and PID of USB flash drive in TC?
« on: April 07, 2013, 01:20:25 PM »
Hi all

Anyone know the easiest way to get the VendorID and ProductID of connected USB devices, especially USB flash drives?
I have tried dmesg and udevadm info --query=all --name=/dev/sda1 but to no avail.

Thanks.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to get VID and PID of USB flash drive in TC?
« Reply #1 on: April 07, 2013, 01:38:34 PM »
lsusb?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Paulo

  • Full Member
  • ***
  • Posts: 139
Re: How to get VID and PID of USB flash drive in TC?
« Reply #2 on: April 07, 2013, 01:40:33 PM »
Aha forgot about that one.

EDIT:

Not installed by default, will check the repo.

EDIT 2:

Nope, not there.
Perhaps it's part of another package?
« Last Edit: April 07, 2013, 01:45:51 PM by Paulo »

Offline Paulo

  • Full Member
  • ***
  • Posts: 139
Re: How to get VID and PID of USB flash drive in TC?
« Reply #3 on: April 07, 2013, 01:49:46 PM »
OK found it, it's part of usb-utils.
Thanks tinypoodle.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to get VID and PID of USB flash drive in TC?
« Reply #4 on: April 07, 2013, 01:51:08 PM »
I cheated and used the defaultconfig binary from busybox :P
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Paulo

  • Full Member
  • ***
  • Posts: 139
Re: How to get VID and PID of USB flash drive in TC?
« Reply #5 on: April 07, 2013, 02:04:21 PM »
Hi tinypoodle

You should get the real lsusb as it comes with a real nice file called usb.ids.gz
It's a big database (actually a flat text file) with thousands of PIDs and VIDs.
Very handy.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Paulo

  • Full Member
  • ***
  • Posts: 139
Re: How to get VID and PID of USB flash drive in TC?
« Reply #7 on: April 07, 2013, 02:26:14 PM »
OK since we are playing "Top Trumps"  :) usb-utils also comes with a script to update usb.ids

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to get VID and PID of USB flash drive in TC?
« Reply #8 on: April 07, 2013, 02:29:20 PM »
Code: [Select]
cat /sys/devices/pci*/*/usb*/*/idVendor
cat /sys/devices/pci*/*/usb*/*/idProduct

KISS :D
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Paulo

  • Full Member
  • ***
  • Posts: 139
Re: How to get VID and PID of USB flash drive in TC?
« Reply #9 on: April 07, 2013, 02:37:16 PM »
Code: [Select]
usb-devices | grep 'P:'

Less typing  :)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to get VID and PID of USB flash drive in TC?
« Reply #10 on: April 07, 2013, 02:44:59 PM »
The fact that core extensions could not easily be unloaded has taught me discipline wrt to exhaust all means to achieve a goal before considering to load an additional extension.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Paulo

  • Full Member
  • ***
  • Posts: 139
Re: How to get VID and PID of USB flash drive in TC?
« Reply #11 on: April 07, 2013, 02:55:49 PM »
Can't argue there and I suspect it will happen naturally as I get more proficient with Linux.
That is exactly the reason why I like TC so much, it's a no-bloat, bare minimum approach
that forces one to do more with less and if you really can't manage, there are always the....cough...splutter...extensions to fall back on.

Contrary to what most people say that TC is for the seasoned Linux user, I actually think it's a perfect "2nd stage" distro to learn on.
By "2nd stage" I mean first start as I did on something easier like Puppy Linux, get used to that as it's pretty friendly then later on as the confidence grows
move to TC to learn more of the "nitty-gritty" stuff.

And if by chance you stuff the whole thing up, no big deal reformat the USB stick, load it back on and you're up and running in a few minutes as opposed to the
other big distros that expect to be installed onto HDD and a gigs and gigs in size.
« Last Edit: April 07, 2013, 03:11:28 PM by Paulo »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to get VID and PID of USB flash drive in TC?
« Reply #12 on: April 07, 2013, 05:41:26 PM »
udevadm could actually do:
Code: [Select]
udevadm info --attribute-walk --name /dev/sd*|grep id
« Last Edit: April 07, 2013, 05:52:40 PM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline thane

  • Hero Member
  • *****
  • Posts: 697
Re: How to get VID and PID of USB flash drive in TC?
« Reply #13 on: April 07, 2013, 06:30:09 PM »
OT, but re stuffing the whole thing up (which I've done a few times) it's worthwhile saving the mydata.tgz file (and of course any non-TCL files you want to keep) somewhere safe. I spent a lot more time recreating/recovering the info on those than I did reloading the system and extensions.

Offline Paulo

  • Full Member
  • ***
  • Posts: 139
Re: How to get VID and PID of USB flash drive in TC?
« Reply #14 on: April 08, 2013, 10:04:45 AM »
@tinypoodle
At least I was on the right track with udevadm but did
not know about those options so thanks for the tip.
Actually udev is something I want to learn when I get a gap.
Been collecting bits and pieces of info on udev and rules and converting them to pdf to make a mini booklet for further study.

@thane
Good point, I will start saving mydata on a regular basis.