New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no usb devices; lsusb returns error code 1; /sys/bus/usb/devices: No such file or directory #3745

Closed
gojimmypi opened this Issue Dec 31, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@gojimmypi
Copy link

gojimmypi commented Dec 31, 2018

  • Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.17763.194]

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)

I'm trying to list USB devices from within WSL; No devices are listed, despite being visible in Windows.

In WSL, lsusb command returns error code 1. Using lsbusb -t returns more information indicating that:

/sys/bus/usb/devices: No such file or directory

This used to work as of a few months ago (I believe prior to my Windows 1809 update). I had used the WSL to successfully program the tinyFPGA as noted here.

All the latest Windows updates have been applied; Also ran sudo apt-get update in WSL and rebooted.

Note the tinyFPGA usb device is otherwise visible and operational from a CMD/DOS prompt:

C:\Users\gojimmypi>tinyprog

    TinyProg CLI
    ------------
    Using device id 1d50:6130
    Only one board with active bootloader, using it.

I'm also able to see and use other COM port devices in Windows with putty, just not in WSL. The problem appears to be isolated to WSL.

Further, I've tried to:

gojimmypi@MYHOST : ~
0 $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial
gojimmypi@MYHOST : ~
0 $ sudo usermod -a -G tty gojimmypi
gojimmypi@MYHOST : ~
0 $ sudo usermod -a -G dialout gojimmypi
gojimmypi@MYHOST : ~
0 $ lsusb
gojimmypi@MYHOST : ~
1 $ lsusb -v
gojimmypi@MYHOST : ~
1 $ lsusb -t
/sys/bus/usb/devices: No such file or directory
gojimmypi@MYHOST : ~
1 $ ls /sys/bus -al
total 0
drwxr-xr-x  2 root root 0 Dec 31 12:45 .
dr-xr-xr-x 12 root root 0 Dec 31 12:45 ..
gojimmypi@MYHOST : ~
0 $ sudo ls /sys/bus -al
total 0
drwxr-xr-x  2 root root 0 Dec 31 12:45 .
dr-xr-xr-x 12 root root 0 Dec 31 12:45 ..
gojimmypi@MYHOST : ~
0 $ sudo lsusb -t
/sys/bus/usb/devices: No such file or directory
gojimmypi@MYHOST : ~
  • What's wrong / what should be happening instead:

The lsusb command should not return an error; instead a list of usb devices should be displayed

  • Strace of the failing command, if applicable: (If some_command is failing, then run strace -o some_command.strace -f some_command some_args, and link the contents of some_command.strace in a gist here).

Please see https://gist.github.com/gojimmypi/eee6efbb4092ccc55178717adcafccbe

I do not believe this a WSL launch problem.

See our contributing instructions for assistance.

@therealkenc

This comment has been minimized.

Copy link
Collaborator

therealkenc commented Dec 31, 2018

@gojimmypi

This comment has been minimized.

Copy link

gojimmypi commented Dec 31, 2018

thanks for the prompt reply. respectfully, I don't think this is a duplicate of the other issues regarding specialized USB hardware (such as my Olimex JTAG debugger in #2185) I'm also not getting the same lsusb unable to initialize libusb: -99 error noted in #2287 (I quietly get an OS error 1, with no visible message unless trying to display the tree with -t)

I believe this used to work for me, and in fact - appears to work for others as noted here.

Note that no USB devices are now working in WSL for me. Not even basic serial COM ports.

@therealkenc

This comment has been minimized.

Copy link
Collaborator

therealkenc commented Dec 31, 2018

From your strace:

327   open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
327   open("/proc/bus/usb", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

I believe this used to work for me

No, /dev/bus/usb and /proc/bus/usb did not previously exist but suddenly disappeared on you.

Not even basic serial COM ports.

I wouldn't know about that. Either way those are not USB devices they are RS232 (/dev/ttyS?) devices that happen to use a USB interface. The COM interface could be provided by a PCI board for all WSL knows from its perspective.

If your problem is with /dev/tty/S?, and your JTAG thingy uses a tty, and it used to work, you could spawn a new issue from that angle - avoiding using the words USB it its entirety. Conversely, WSL does not support libusb (lsusb(1) et al) and never has.

@gojimmypi

This comment has been minimized.

Copy link

gojimmypi commented Jan 2, 2019

@therealkenc well, you are (of course) quite right; apparently the tinyFPGA board can use either serial or USB drivers - and I was chasing the wrong problem assuming it was the USB issues. In any case - thanks for your prompt replies.

I believe there's still something weird with the serial drivers in WSL.

Explicitly naming the serial port to program the board does work:
tinyprog --com /dev/ttyS12 -p hello_word.bin

Also, sending command to exit bootloader to the device with -b while explicitly naming the port works:
tinyprog -b --com /dev/ttyS12

Other command that should work (and do in DOS prompt), do not work in WSL:

tinyprog
tinyprog --list
tinyprog --meta

I'm still fairly certain that this previously worked - that all the commands worked without needed to explicitly name the serial port. But until I have more concrete evidence, I will hold off on opening a new WSL GitHub issue.

If anyone else comes here looking, I wrote a blog about it here and in particular lawrie.griffiths pointed out key information in the tinyFPGA discourse forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment