[Nut-upsdev] Megatec_USB on OpenBSD 4.3 - no input interrupt endpoint

ng-sup01 ng-sup01 at mclink.it
Fri Sep 12 10:24:13 UTC 2008


Hi!
  
   I am trying to get an Atlantis-Land 1501 UPS to work under OpenBSD. 
The UPS works OK under Linux + megatec_usb driver+nut_2.2.2.

   What I get under OpenBSD is:

root at puffwall:~ # dmesg
OpenBSD 4.3 (GENERIC) #698: Wed Mar 12 11:07:05 MDT 2008
    deraadt at i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel Pentium III ("GenuineIntel" 686-class, 128KB L2 cache) 767 MHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE
real mem  = 131624960 (125MB)
avail mem = 119201792 (113MB)
[...]
uhci0 at pci0 dev 7 function 2 "VIA VT83C572 USB" rev 0x10: irq 11
[...]
usb0 at uhci0: USB revision 1.0
uhub0 at usb0 "VIA UHCI root hub" rev 1.00/1.00 addr 1
[...]
uhidev0 at uhub0 port 1 configuration 1 interface 0 "UIS_ABLER USB to 
Serial" rev 1.00/1.00 addr 2
uhidev0: no input interrupt endpoint


    This is the output of usbdevs (sorry, we have no lsusb ;-)

root at puffwall# usbdevs -dv
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), 
VIA(0x1106), rev 1.00
  uhub0
 port 1 addr 2: low speed, power 100 mA, config 1, USB to 
Serial(0x0000), UIS_ABLER(0x0001), rev 1.00
   uhidev0
 port 2 powered


    Since I was having no luck with the NUT package provided by OpenBSD 
(nut version is 2.2.1, using libusb-0.1.12), I downloaded and compiled 
the 2.2.2 version (which *does* support my UPS): here's what I get:

root at puffwall:~/nut-2.2.2 # drivers/megatec_usb  -a atlantisland -u _ups 
-DDDD
Network UPS Tools 2.2.2 - Megatec protocol driver 1.5.14 [megatec_usb]
Carlos Rodrigues (c) 2003-2008

Serial-over-USB transport layer for Megatec protocol driver [megatec_usb]
Andrey Lelikov (c) 2006, Alexander Gordeev (c) 2006-2007, Jon Gough (c) 2007

debug level is '4'
No appropriate HID device found
No supported devices found. Please check your device availability with 
'lsusb'
and make sure you have an up-to-date version of NUT. If this does not help,
try running the driver with at least 'vendorid' and 'subdriver' options
specified. Please refer to the man page for details about these options
(man 8 megatec_usb).
Please report your results to the NUT user's mailing list
<nut-upsuser at lists.alioth.debian.org>.


    And, finally, here's a clip of my ups.conf file:

[atlantisland]
    driver = usbhid_ups
    port = /dev/usb0
    desc = "Atlantis Land 1501"

   Please note I tried all possibile values for "port": /dev/uhid0, 
/dev/uhidev0 and /dev/usb0


   Under Linux (with the same UPS), I just point "port" to /dev/ttyUSB0, 
or whatever (I actually found it doesn't really matter, you can enter 
/dev/foobar) and the driver starts scanning:

root at ubuntuserver:~# /usr/local/ups/bin/megatec_usb -u nut -a atlantis -DDDD
Network UPS Tools 2.2.2 - Megatec protocol driver 1.5.14 [megatec_usb]
Carlos Rodrigues (c) 2003-2008

Serial-over-USB transport layer for Megatec protocol driver [megatec_usb]
Andrey Lelikov (c) 2006, Alexander Gordeev (c) 2006-2007, Jon Gough (c) 2007

debug level is '4'
Checking device (0000/0000) (008/001)
- VendorID: 0000
- ProductID: 0000
- Manufacturer: unknown
- Product: unknown
- Serial Number: unknown
- Bus: 008
Trying to match device
Device does not match - skipping
Checking device (0000/0000) (007/001)
- VendorID: 0000
- ProductID: 0000
- Manufacturer: unknown
- Product: unknown
- Serial Number: unknown
- Bus: 007
Trying to match device
Device does not match - skipping
[...]
Checking device (FFFF/0000) (003/002)
- VendorID: ffff
- ProductID: 0000
- Manufacturer:
- Product: 068A
- Serial Number: unknown
- Bus: 003
Trying to match device
Device matches
Starting UPS detection process...
Asking for UPS status [Q1]...
set_data_krauler: index [03]
Q1 => OK [(220.1 140.0 220.0 015 50.0 27.5 30.0 00001001]
Asking for UPS status [Q1]...
set_data_krauler: index [03]
Q1 => OK [(220.1 140.0 220.0 015 50.0 27.5 30.0 00001001]
Asking for UPS status [Q1]...
set_data_krauler: index [03]
Q1 => OK [(220.1 140.0 220.0 015 49.9 27.5 30.0 00001001]
Asking for UPS status [Q1]...
set_data_krauler: index [03]
Q1 => OK [(220.1 140.0 220.0 015 50.0 27.5 30.0 00001001]
Asking for UPS status [Q1]...
set_data_krauler: index [03]
Q1 => OK [(221.8 140.0 222.0 015 49.9 27.5 30.0 00001001]
0 out of 5 detection attempts failed (minimum failures: 2).
Cancelling any pending shutdown or battery test.
set_data_krauler: index [0b]
set_data_krauler: retry [UPS No Ack]
Asking for UPS information [I]...
set_data_krauler: index [0c]
I => OK [#                           VT120725  ]
Megatec protocol UPS detected [  VT120725].
Parameter [ignoreoff]: [false]
Asking for UPS power ratings [F]...
set_data_krauler: index [0d]
F => OK [#220.0 000 024.0 50.0]
24.0V battery, interval [19.4V, 27.4V].
Done setting up the UPS.
Asking for UPS status [Q1]...
set_data_krauler: index [03]
Q1 => OK [(221.8 140.0 222.0 016 49.9 27.5 30.0 00001001]
Calculated battery charge: 100.0%
dstate_init: sock /var/state/ups/megatec_usb-atlantis open on fd 5
Asking for UPS status [Q1]...
set_data_krauler: index [03]
Q1 => OK [(221.8 140.0 222.0 016 50.0 27.5 30.0 00001001]
Calculated battery charge: 100.0%
Asking for UPS status [Q1]...
set_data_krauler: index [03]
Q1 => OK [(221.8 140.0 222.0 015 50.0 27.5 30.0 00001001]
Calculated battery charge: 100.0%
Asking for UPS status [Q1]...
set_data_krauler: index [03]
Signal 2: exiting


I am always lost when dealing with USB, HID & Co., any help is welcome. 
Thanks in advance.

--Vic



More information about the Nut-upsdev mailing list