[Nut-upsdev] serial/USB-over-HID layer for fentonups
selinger at mathstat.dal.ca
Wed Oct 5 12:59:44 UTC 2005
Pierre-Yves AILLET wrote:
> Selon Charles Lepple <clepple at gmail.com>:
> > Technically, this isn't a HID UPS, it's just a serial UPS with a silly
> > USB-to-serial converter in front of it. Therefore, libhid will be of
> > very limited value in this case (it'll just tell the kernel usbhid
> > driver to go away.) I'm somewhat curious if anyone has tried to write
> > a Linux kernel driver for this sort of USB-to-serial converter.
> > --
> > - Charles Lepple
> I've done some reasearch on this USB-to-serial converter and found it this page
> This "USB To RS232 Interface (V1.0) BaudRate 2400bps" really looks like mine.
> As explained on this webpage it was detected as :
> hiddev96: USB HID v1.00 Gamepad [Ver 1.0 USB To RS232 Interface (V1.0) BaudRate
> 2400bps] on usb-0000:00:09.0-1
> This driver is already part of nut, so I tried to launch upsdrvctl with these
> lines in /etc/nut/ups.conf:
> driver = energizerups
> port = /dev/usb/hiddev0
> desc = "Something descriptive"
I suspect that doing a "serial over USB" protocol is not as simple as
that. You communicate with a serial port via IOCTLs (to set the baud
rate, stop bits, and whatever). There are different IOCTLs for USB (to
set an endpoint, get descriptors, and stuff like that).
Unless you can adapt the existing code of some other serial over USB
driver, you might have to read the USB specification
(http://www.usb.org/developers/docs/), and possibly the HID
specification (http://www.usb.org/developers/hidpage/). With this
knowledge, you might then understand the libusb interface
That's a lot of stuff to read (fortunately you can skip all the parts
about physical and engineering specs), but ultimately it explains a
lot about how to talk to a USB device.
More information about the Nut-upsdev