Lemuntu

USB - no device attached - error message

11 2830
Tido  
Edited by Tido at Nov 14, 2015 21:30

No device attached:
  1. root@Leguitar:/var/log# apt-get install usbutils

  2. root@Leguitar:/var/log# lsusb
  3. unable to initialize libusb: -99
Copy the Code

Now I connected a device to USB:
  1. root@Leguitar:/var/log# lsusb
  2. Bus 001 Device 002: ID 058f:6377 Alcor Micro Corp. Multimedia Card Reader
  3. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Copy the Code

hnsncxy replied at Nov 13, 2015 12:37
Yes, I meet the same error message according to your method. The problem may be caused by lack of the usbfs filesystem on the system.

I did some more testing:
  1. root@Leguitar:~# export LIBUSB_DEBUG=9

  2. root@Leguitar:~# dmesg | grep usbfs
  3. [    0.667623] usbcore: registered new interface driver usbfs

  4. root@Leguitar:~# cd /dev/
  5. block/  char/   disk/   dri/    fd/     input/  mapper/ net/    pts/    shm/    snd/

  6. root@Leguitar:~# lsusb
  7. libusb: debug [libusb_init] created default context
  8. libusb: debug [libusb_init] libusb v1.0.19.10903
  9. libusb: error [op_init] could not find usbfs
  10. unable to initialize libusb: -99
Copy the Code


If I understand that information correct, then a usbfs filesystem should be present.
The s500 comes with USB2 & USB3 controller why is there no usbfs filesystem  present?

hnsncxy  
If I understand that information correct, then a usbfs filesystem should be present.
The s500 comes with USB2 & USB3 controller why is there no usbfs filesystem  present?
The link below can solve your problem, please check it.
http://stackoverflow.com/questio ... n-linux-3-10-kernel

Tido  
Edited by Tido at Nov 16, 2015 20:47
hnsncxy replied at Nov 16, 2015 06:59
The link below can solve your problem, please check it.
http://stackoverflow.com/questio ... n-linux ...
  1. root@Leguitar:~# /sys/bus/
  2. clocksource/  event_source/ i2c/          mdio_bus/     owldss/       scsi/         serio/        usb/          workqueue/
  3. cpu/          hid/          iio/          mmc/          platform/     sdio/         spi/          usb-serial/  
Copy the Code
I see, so
/dev/bus/usb vs /sys/bus/usb
but I have a clean, fresh install, no update -  not like the link you mentioned.

I guess the answer may be somewhere on this website or this comment sounds also interesting: avoid static creation of device nodes

Somewhere must be a bug, right?


hnsncxy  
Edited by hnsncxy at Nov 17, 2015 05:04
Tido replied at Nov 16, 2015 13:45
I see, so
/dev/bus/usb vs /sys/bus/usb
but I have a clean, fresh install, no update -  not like th ...

You need to create the symbolic link  by yourself,Please refer to the following information
  1. root@Lemuntu:~# ln -s /sys/bus /dev/bus
  2. root@Lemuntu:~# lsusb
  3. root@Lemuntu:~# lsusb
  4. Bus 001 Device 002: ID 046d:c534 Logitech, Inc.
  5. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Copy the Code

Tido  
hnsncxy replied at Nov 17, 2015 12:02
You need to create the symbolic link  by yourself.

Things worked fine on my system with an older kernel as the USB device nodes were found under /proc/bus/usb.
I never had to create any devices under /dev/bus/usb. After upgrading the kernel to the 3.10 kernel
the /proc/bus/usb dir disappeared. I understand from the previous thread and your current comments
that I need to create device nodes under /dev/bus/usb.

I was just hoping that I could rely on mdev vs udev to do this for me.  
The mdev which I have does not seem to create them.  
I'm sure I could write a script to parse the usb bus / device info under /sys/bus/usb and create the device nodes, if I had to.

Answer:
It ought to be possible to write a script which mdev can call to create and destroy the nodes.  
All the information you need will be present either as arguments to mdev or as environment variables.  
You shouldn't need to mess around with /sys/bus/usb. I suggest you start by writing a simple script
that records its arguments and environment variables in a file somewhere.  

Plug in and unplug a USB device and see what you get in the file.  
Then based on that information write an mdev config line that selects
just the USB device creation/removal events and write a script that creates/removes the appropriate device node.

So it sounds to me, that this is what is missing. This is current information on the libusb Mailinglist - March 2015

Can you change that in the next Lemuntu release?

hnsncxy  
Tido replied at Nov 17, 2015 09:31
Things worked fine on my system with an older kernel as the USB device nodes were found under /proc ...

The system has supported to create the device node by the udev. The usb deivce node /dev/bus/usb/* will be created by the udev when you plug in your usb device.Therefore, there is no error messages when you are runing the lsusb. as follows:
  1. root@lemaker:/dev# lsusb
  2. Bus 001 Device 002: ID 046d:c534 Logitech, Inc.
  3. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  4. root@lemaker:/dev# ls -l /dev/bus/usb/
  5. total 0
  6. drwxr-xr-x 2 root root 80 Nov 18 09:02 001
  7. root@lemaker:/dev#
Copy the Code
If there is no usb device attached, and the /dev/bus/usb/* will not be created in the /dev. At the moment, it will output the error messages you mentioned when you are running the lsusb. In fact,  it should not be affect the using, and you can consider to refer the method above to avoid the problem. Thanks



Tido  
Edited by Tido at Nov 18, 2015 21:58
hnsncxy replied at Nov 18, 2015 02:13
In fact,  it should not be affect the using,  ...

I agree with you hnsncxy, that it basically works.
This is not a big deal, but if you are trying to solve a problem, such a behavior can mislead you.
Therefore this bug and should be solved.

The s500 comes with an USB2- & USB3-Controller.
If there is no USB device attached, the /dev/bus/usb/ will not be created.
Why not - the controller is present, right?
hnsncxy replied at Nov 18, 2015 02:13
USB-Device-Node /dev/bus/usb/* will be created by the UDEV on the event of the plug-in of an USB-Device.

So I see two things:
  • There is no node created for the controller.
  • When you unplug the USB-Device, the whole node is removed.

The remove rule seems to be too rigorous with cleaning up.
It shall remove the device nodes, but NOT the parent node.

Don't you think so?


hnsncxy  
Tido replied at Nov 18, 2015 04:14
I agree with you hnsncxy, that it basically works.
This is not a big deal, but if you are trying to ...

Yes, I know what you said.

Tido  
Tido replied at Nov 18, 2015 11:14
There is no node created for the controller.
When you unplug the USB-Device, the whole node is removed...

Will there be some change how you handle the USB in the next Lemuntu release?

hnsncxy  
Tido replied at Dec 08, 2015 13:10
Will there be some change how you handle the USB in the next Lemuntu release?

Sorry, we don't find better way to fix it at present.

You have to log in before you can reply Login | Sign Up

Points Rules