ng-sup01
2008-Sep-12 10:24 UTC
[Nut-upsdev] Megatec_USB on OpenBSD 4.3 - no input interrupt endpoint
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
Arjen de Korte
2008-Sep-12 10:54 UTC
[Nut-upsuser] [Nut-upsdev] Megatec_USB on OpenBSD 4.3 - no input interrupt endpoint
Citeren ng-sup01 <ng-sup01 at mclink.it>:> 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.[...]> And, finally, here's a clip of my ups.conf file:[...]> [atlantisland] > driver = usbhid_ups > port = /dev/usb0 > desc = "Atlantis Land 1501"Use the correct the driver, 'usbhid_ups' != 'megatec_usb'. Looking at the output on your Linux system, you'd need the latter.> Please note I tried all possibile values for "port": /dev/uhid0, > /dev/uhidev0 and /dev/usb0The value of 'port' is irrelevant, as long as it's not empty. See the FAQ. Best regards, Arjen PS This question would have been more appropriate on the nut-upsusers list. -- Eindhoven - The Netherlands Key fingerprint - 66 4E 03 2C 9D B5 CB 9B 7A FE 7E C1 EE 88 BC 57
Henning Brauer
2008-Sep-12 11:01 UTC
[Nut-upsdev] Megatec_USB on OpenBSD 4.3 - no input interrupt endpoint
* ng-sup01 <ng-sup01 at mclink.it> [2008-09-12 12:24]:> uhidev0 at uhub0 port 1 configuration 1 interface 0 "UIS_ABLER USB to > Serial" rev 1.00/1.00 addr 2that's the problem, uhiddev must not claim the device and leave it to ugen. you must add a quirk like { USB_VENDOR_APC, USB_PRODUCT_APC_UPSPRO500, ANY, {UQ_BAD_HID }}, (with vendor & product for your UPS of course) to sys/dev/usb/usb_quirks.c for now, and use sendbug to send it in for inclusion. the UPS HID situtaion sucks. there might be a more generic solution soon, if one of our usb hackers can be convinced to do it. -- Henning Brauer, hb at bsws.de, henning at openbsd.org BS Web Services, http://bsws.de Full-Service ISP - Secure Hosting, Mail and DNS Services Dedicated Servers, Rootservers, Application Hosting - Hamburg & Amsterdam
ng-sup01
2008-Sep-12 12:58 UTC
[Nut-upsdev] Megatec_USB on OpenBSD 4.3 - no input interrupt endpoint
Hello again, and thanks for your quick replies. Arjen de Korte wrote:> >> And, finally, here's a clip of my ups.conf file: > > [...] > >> [atlantisland] >> driver = usbhid_ups >> port = /dev/usb0 >> desc = "Atlantis Land 1501" > > Use the correct the driver, 'usbhid_ups' != 'megatec_usb'. Looking at > the output on your Linux system, you'd need the latter. >Yes, and don't post if you didn't get a good night's sleep. This morning (around 3AM) in despair, I was fooling around with the .conf, trying the usbhid_ups driver as well. The ups.conf file reflects the result of said ramblings...>> Please note I tried all possibile values for "port": /dev/uhid0, >> /dev/uhidev0 and /dev/usb0 > > The value of 'port' is irrelevant, as long as it's not empty. See the > FAQ.Missed that one.> > Best regards, Arjen > > PS This question would have been more appropriate on the nut-upsusers > list.Posted here because I remember seeing prior messages concerning same UPS that were moved from upsusers to upsdev: but I'm new, and might be very wrong. Please tell me what to do ;) Henning Brauer wrote: > * ng-sup01 <ng-sup01 at mclink.it> [2008-09-12 12:24]:> > uhidev0 at uhub0 port 1 configuration 1 interface 0 "UIS_ABLER USB to > > Serial" rev 1.00/1.00 addr 2 > that's the problem, uhiddev must not claim the device and leave it to > ugen.But the same version of NUT (2.2.2), compiled on an Ubuntu machine, works fine, while on OpenBSD I get this problem. Is this possible?> you must add a quirk like> { USB_VENDOR_APC, USB_PRODUCT_APC_UPSPRO500, ANY, {UQ_BAD_HID }},Will try and post results. Thanks to everybody for now! --Vic