3

I have a device, custom mp3 player, that the pid and vid show up as a011:a011.

dmesg

usb 1-1.1: new high-speed USB device number 4 using ehci-pci
usb 1-1.1: New USB device found, idVendor=a011, idProduct=a011
usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
usb 1-1.1: Product: Custom-Mp3
usb 1-1.1: SerialNumber: 123456789abcdef
usb 1-1.1: USB disconnect, device number 4
usb 3-3: new high-speed USB device number 2 using xhci_hcd
usb 3-3: New USB device found, idVendor=a011, idProduct=a011
usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=5
usb 3-3: Product: Custom-Mp3
usb 3-3: SerialNumber: 123456789abcdef

I can connect to this device in windows 7 by selecting a generic mass storage device driver. It has a single fat32 partition that I can read and write to.

My system is Ubuntu 14. Every thing works. I connect a USB thumb drive and it auto loads the driver and creates the /dev/sdX point.

How do I connect this mp3 player to my linux pc. If I can create the /dev/sdX point then I can mount it.

I have been reading and trying to use modprobe and creating a /etc/udev/rules.d/80-mp3_a011.rules, but It has not clicked yet.

I would like to connect a single time via the command line first.

Next I would like it to connect every time I plug it in.

Last using this information I will create the rules for mdev that I use on my embedded system.

5
  • Check out python-udiskie. This is a frontend to udisks2, and is supposed to handle the mounting of USB devices automatically, but you'll have to try it. Mar 18, 2016 at 17:44
  • Actually, I'm not sure I understand your question. You say you can automount a USB mass storage device in Ubuntu, but not the mp3 player? Mar 18, 2016 at 18:04
  • Correct. I cannot mount this mass storage device, the mp3 player, on my Ubuntu machine, because the pid:vid is custom. My Ubuntu system does not know what to do with a device that identifies itself as a011:a011.
    – jc__
    Mar 18, 2016 at 18:21
  • unix.stackexchange.com/q/67936/4671 might be relevant. For an explanation about pid/vid, see voti.nl/docs/usb-pid.html. Mar 18, 2016 at 19:18
  • yes thanks, That what I was using as one of my reference. A custom pid:vid is just one that does not follow the standard of vid = vendor id and pid = product id (HID, mass storage...).
    – jc__
    Mar 18, 2016 at 19:31

1 Answer 1

1

Got the second part working.

"Next I would like it to connect every time I plug it in."

Created a udev rule at:

sudo vi /etc/udev/rules.d/80-mp3_a011.rules

Added this info that simply modprobes usb-storage and adds my pid:vid to the usb-storage new_id.

ACTION=="add", ATTRS{idVendor}=="a010", ATTRS{idProduct}=="a010", RUN+="/sbin/modprobe usb-storage" RUN+="/bin/sh -c 'echo a011 a011 > /sys/bus/usb/drivers/usb-storage/new_id'"

restart udev

sudo /etc/init.d/udev restart

Now as soon as I connect the device it is handled like any other usb mass storage device.

First part working:

"I would like to connect a single time via the command line first."

sudo echo a011 a011 > /sys/bus/usb/drivers/usb-storage/new_id

Did NOT work because the sudo was applied to the echo command and not the new_id file, or some such thing.

Changed to a root shell first then added the PID:VID to the new_id.

sudo su

echo a011 a011 > /sys/bus/usb/drivers/usb-storage/new_id
2
  • I need to make this work a single time with out creating the rule. When I echo to the new_id I always get "Permission denied" even using sudo.
    – jc__
    Mar 18, 2016 at 19:21
  • Also, you could use echo BlahBlah | sudo tee -a output_file if you want to make this a non-interactive one-liner, assuming you have password-less sudo access on the system in question.
    – Cloud
    May 17, 2017 at 16:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .