NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: py-usb problems



On 02/19/15 07:49, Andreas Gustafsson wrote:
Dave Tyson wrote:
Not sure whether this belongs here or in pkgsrc-users. I have been
trying to package the weewx weather station software which is
written in python. It uses py-usb to handle the devices, but
I cannot get it to see anything on the usb busses.
What does the device show up as in the output from "dmesg"?

If it attaches with a driver other than "ugen" (for example,
"uhid"), that's your problem - py-usb relies on libusb
which only works with the ugen driver.  On Linux, libusb
has the capability to automatically unload other drivers,
but NetBSD lacks this functionality.

You can force the device to attach as ugen by adding a line
like the following to your kernel configuration and building
a new kernel:

   ugen* at uhub? vendor 0xVVVV product 0xPPPP flags 1

replacing 0xVVVV and 0xPPPP with the hexadecimal USB vendor and
product IDs of the device.  You can find the IDs by running
usbdevs.

Just putting a statement:

ugen* at uhub? port ? vendor 0x6666 product 0x5555 flags 1

wasn't sufficient, I also needed to comment out the

#uhidev* at uhub? port ? configuration ? interface ?

and the uhidev child devices otherwise it just appeared as a child
of uhidev as before:

uhidev0 at uhub0 port 2 configuration 1 interface 0
uhidev0: LA CROSSE TECHNOLOGY Weather Direct Light Wireless Device, rev 2.00/1.00, addr 2, iclass 3/0
uhidev0: 223 report ids
uhid0 at uhidev0 reportid 1: input=14, output=0, feature=0
uhid1 at uhidev0 reportid 16: input=0, output=1, feature=0
uhid2 at uhidev0 reportid 17: input=0, output=0, feature=1
uhid3 at uhidev0 reportid 32: input=0, output=0, feature=21
uhid4 at uhidev0 reportid 33: input=0, output=0, feature=1
...

After commenting out uhidev, the device did attach as a ugen and it was visible to
py-usb.

ugen0 at uhub0 port 2
ugen0: LA CROSSE TECHNOLOGY Weather Direct Light Wireless Device, rev 2.00/1.00, addr 2

The weewx software seems to work OK so I will try and finish packaging it.

Commenting out uhidev is not practical as I lose the usb keyboard etc. I guess this needs usb quirk - but therein lies a problem. The manufacturers of the usb radio stick used the generic vendor/product codes for development/testing (0x6666/0x5555) and so just using those risks a clash with other devices produced by similar clueless manufacturers.

Any suggestions on how to work around this?

Thanks for the help!

Cheers,
Dave



--
============================================
Phone: 07805784357
Open Source O/S: www.netbsd.org
Caving: http://www.wirralcavinggroup.org.uk
============================================



Home | Main Index | Thread Index | Old Index