On 09/20/2013 03:19 PM, Gregory Edigarov wrote:
On 09/19/2013 12:20 PM, Gregory Edigarov wrote:
Hello, everybody.

A few days ago I've bought a new ups, as a replacement for  my old one, which 
got it's last way to junkyard.
The old one had RS232 порт, and the new one is an USB ups.
Trying different ways to connect it to OpenBSD, but everything I've tried fails.
The UPS reports itself as:

uhidev2 at uhub3 port 2 configuration 1 interface 0 "ATCL FOR UPS ATCL FOR UPS" 
rev 2.00/0.00 addr 4
uhidev2: iclass 3/0
uhid2 at uhidev2: input=8, output=8, feature=0

I've connected it to Windows via USB, and installed software which came with 
it, snooped the protocol, and I am dead sure it is an old and frayed 
Megatec/Q1, which should work with blazer_usb driver from nut. But it isn't. 
Seems I've tried nearly every option and allowed option combinations with no 
result.
I cannot get you the usbdevs && usbhidctl right now, because I left it 
connected to windows, and it is at home.

So, my question is: could it the differences in usb stack  between various 
OSes, that are giving the trouble? Will try connect it to linux and NetBSD 
later, but I am willing to solve the puzzle with OpenBSD.


Ok, guys. so here's the continuation of story, no success so far, but may be 
somebody will sched a light...
Having add the UPS as a quirk to usb_quirks.c (thanks Martin) and recompiled 
the kernel I have:
# nut-scanner
Cannot load SNMP library (libnetsnmp) : file not found. SNMP search disabled.
Cannot load XML library (libneon) : file not found. XML search disabled.
Scanning USB bus.
No start IP, skipping NUT bus (old connect method)
Scanning NUT bus (avahi method).
Failed to create client: Daemon not running
[nutdev1]
         driver = "blazer_usb"
         port = "auto"
         vendorid = "0001"
         productid = "0000"
         product = "ATCL FOR UPS"
         serial = "ATCL FOR UPS"
         vendor = "ATCL FOR UPS"
         bus = "001"

I have this in my ups.conf:

[prologix]
         driver = "blazer_usb"
         port = "auto"
         vendorid = "0001"
         productid = "0000"

running blazer_usb in debug mode:
...
    1.096515     Checking device (0001/0000) (001/004)
    1.100225     - VendorID: 0001
    1.100237     - ProductID: 0000
    1.100245     - Manufacturer: unknown
    1.100252     - Product: ATCL FOR UPS
    1.100269     - Serial Number: ATCL FOR UPS
    1.100291     - Bus: 001
    1.100310     Trying to match device
    1.100321     Device matches
    1.100721     send: QS
    1.100732     read: QS
    1.100741     blazer_status: short reply
    1.100749     Status read 1 failed
    1.100764     send: QS
    1.100787     read: QS
    1.100805     blazer_status: short reply
    1.100811     Status read 2 failed
    1.100822     send: QS
    1.100827     read: QS
    1.100838     blazer_status: short reply
    1.100843     Status read 3 failed
    1.100855     Trying megatec/old protocol...
    1.100861     send: D
    1.100871     read: D
    1.100876     blazer_status: short reply
    1.100888     Status read 1 failed
    1.100894     send: D
    1.100918     read: D
    1.100929     blazer_status: short reply
    1.100934     Status read 2 failed
    1.100940     send: D
    1.100950     read: D
    1.100955     blazer_status: short reply
    1.100967     Status read 3 failed
    1.100972     Trying zinto protocol...
    1.100983     send: Q1
    1.102258     read: Input/output error
    1.102300     blazer_status: short reply
    1.102312     Status read 1 failed
    1.117362     Checking device (8086/0000) (000/001)
....

The input/output error &&  short reply are strange in here.
I also tried run it as an usbhid-ups with other kernel:
[p1]
         driver ="usbhid-ups"
         port="auto"
         vendorid = "0001"
         productid = "0000"

Controller /dev/usb1:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), 
Intel(0x8086), rev 1.00
  port 1 addr 2: high speed, self powered, config 1, Rate Matching Hub(0x0024), 
Intel(0x8087), rev 0.00
   port 1 addr 3: low speed, power 100 mA, config 1, product 0x0103(0x0103), 
vendor 0x04f3(0x04f3), rev 1.07
   port 2 addr 4: low speed, power 98 mA, config 1, ATCL FOR UPS(0x0000), ATCL 
FOR UPS(0x0001), rev 0.00, iSerialNumber ATCL FOR UPS
   port 3 addr 5: low speed, power 100 mA, config 1, Optical Mouse(0x003a), 
Genius(0x0458), rev 1.00
   port 4 powered
   port 5 powered
   port 6 powered
  port 2 powered

# usbhid-ups -a p1 -DDDDDDDDDDDDDDDDDD
Network UPS Tools - Generic HID driver 0.37 (2.6.5)
USB communication driver 0.31
    0.000000     debug level is '18'
    0.000377     upsdrv_initups...
    0.033537     Checking device (8086/0000) (000/001)
    0.033730     - VendorID: 8086
    0.033739     - ProductID: 0000
    0.033754     - Manufacturer: Intel
    0.033759     - Product: EHCI root hub
    0.033771     - Serial Number: unknown
    0.033776     - Bus: 000
    0.033803     Trying to match device
    0.033811     Device does not match - skipping
    0.033864     Checking device (8087/0024) (000/002)
    0.033880     - VendorID: 8087
    0.033885     - ProductID: 0024
    0.033890     - Manufacturer: unknown
    0.033900     - Product: unknown
    0.033905     - Serial Number: unknown
    0.033928     - Bus: 000
    0.033940     Trying to match device
    0.033945     Device does not match - skipping
    0.033966     Checking device (8086/0000) (001/001)
    0.034045     - VendorID: 8086
    0.034062     - ProductID: 0000
    0.034068     - Manufacturer: Intel
    0.034073     - Product: EHCI root hub
    0.034085     - Serial Number: unknown
    0.034089     - Bus: 001
    0.034100     Trying to match device
    0.034105     Device does not match - skipping
    0.034130     Checking device (8087/0024) (001/002)
    0.034148     - VendorID: 8087
    0.034158     - ProductID: 0024
    0.034164     - Manufacturer: unknown
    0.034174     - Product: unknown
    0.034192     - Serial Number: unknown
    0.034204     - Bus: 001
    0.034209     Trying to match device
    0.034220     Device does not match - skipping
    0.034243     Checking device (04F3/0103) (001/003)
    0.034262     - VendorID: 04f3
    0.034267     - ProductID: 0103
    0.034272     - Manufacturer: unknown
    0.034283     - Product: unknown
    0.034288     - Serial Number: unknown
    0.034299     - Bus: 001
    0.034304     Trying to match device
    0.034328     Device does not match - skipping
    0.034348     Checking device (0001/0000) (001/004)
    0.038736     - VendorID: 0001
    0.038749     - ProductID: 0000
    0.038757     - Manufacturer: ATCL FOR UPS
    0.038765     - Product: ATCL FOR UPS
    0.038773     - Serial Number: ATCL FOR UPS
    0.038788     - Bus: 001
    0.038820     Trying to match device
    0.038832     Device does not match - skipping
    0.038861     Checking device (0458/003A) (001/005)
    0.040976     - VendorID: 0458
    0.040987     - ProductID: 003a
    0.040994     - Manufacturer: Genius
    0.041001     - Product: Optical Mouse
    0.041017     - Serial Number: unknown
    0.041038     - Bus: 001
    0.041057     Trying to match device
    0.041063     Device does not match - skipping
    0.041087     No appropriate HID device found
    0.041104     No matching HID UPS found - check permissions on /dev/ugen* 
and /dev/usb*

have also explored it with usbhid-ups:
usbhid-ups -a p1 -DDDDDDDDDDDDDDDDDD -x explore
Network UPS Tools - Generic HID driver 0.37 (2.6.5)
USB communication driver 0.31
   0.000000     send_to_all: SETINFO driver.flag.explore "enabled"
   0.000045     debug level is '18'
   0.000388     upsdrv_initups...
   0.032451     Checking device (8086/0000) (000/001)
   0.032629     - VendorID: 8086
   0.032638     - ProductID: 0000
   0.032652     - Manufacturer: Intel
   0.032657     - Product: EHCI root hub
   0.032669     - Serial Number: unknown
   0.032674     - Bus: 000
   0.032698     Trying to match device
   0.032719     Device does not match - skipping
   0.032766     Checking device (8087/0024) (000/002)
   0.032781     - VendorID: 8087
   0.032786     - ProductID: 0024
   0.032791     - Manufacturer: unknown
   0.032800     - Product: unknown
   0.032805     - Serial Number: unknown
   0.032826     - Bus: 000
   0.032830     Trying to match device
   0.032837     Device does not match - skipping
   0.032856     Checking device (8086/0000) (001/001)
   0.032933     - VendorID: 8086
   0.032945     - ProductID: 0000
   0.032957     - Manufacturer: Intel
   0.032962     - Product: EHCI root hub
   0.032967     - Serial Number: unknown
   0.032978     - Bus: 001
   0.032983     Trying to match device
   0.032996     Device does not match - skipping
   0.033021     Checking device (8087/0024) (001/002)
   0.033037     - VendorID: 8087
   0.033043     - ProductID: 0024
   0.033054     - Manufacturer: unknown
   0.033060     - Product: unknown
   0.033070     - Serial Number: unknown
   0.033085     - Bus: 001
   0.033095     Trying to match device
   0.033101     Device does not match - skipping
   0.033122     Checking device (04F3/0103) (001/003)
   0.033138     - VendorID: 04f3
   0.033148     - ProductID: 0103
   0.033153     - Manufacturer: unknown
   0.033165     - Product: unknown
   0.033170     - Serial Number: unknown
   0.033181     - Bus: 001   0.038453     HID descriptor length 32
   0.039395     Report Descriptor size = 32
   0.039415     Report Descriptor: (32 bytes) => 06 a0 ff 09 01 a1 01 09 03 15 
00 25 01 75
   0.039434      08 95 08 81 02 09 04 15 00 25 01 75 08 95 08 91 02 c0
   0.039524     Using subdriver: EXPLORE HID 0.1
   0.039548     Entering libusb_get_report
   0.040722     libusb_get_report: Input/output error
   0.040756     Can't retrieve Report 00: Input/output error
   0.040766     hid_lookup_path: ffa00001 -> not found in lookup table
   0.040781     hid_lookup_path: ffa00003 -> not found in lookup table
   0.040796     Path: ffa00001.ffa00003, Type: Input, ReportID: 0x00, Offset: 
0, Size: 8
   0.040810     Entering libusb_get_report
   0.041661     libusb_get_report: Input/output error
   0.041697     Can't retrieve Report 00: Input/output error
   0.041723     hid_lookup_path: ffa00001 -> not found in lookup table
   0.041741     hid_lookup_path: ffa00004 -> not found in lookup table
   0.041747     Path: ffa00001.ffa00004, Type: Output, ReportID: 0x00, Offset: 
0, Size: 8
   0.041764     send_to_all: SETINFO ups.mfr "ATCL FOR UPS"
   0.041773     send_to_all: SETINFO ups.model "ATCL FOR UPS"
   0.041781     send_to_all: SETINFO ups.serial "ATCL FOR UPS"
   0.041790     send_to_all: SETINFO ups.vendorid "0001"
   0.041808     send_to_all: SETINFO ups.productid "0000"
   0.041815     Report descriptor retrieved (Reportlen = 32)
   0.041825     Found HID device
   0.041831     Detected a UPS: ATCL FOR UPS/ATCL FOR UPS
   0.041844     find_nut_info: unknown info type: load.off.delay
   0.041849     find_nut_info: unknown info type: load.on.delay
   0.041874     find_nut_info: unknown info type: load.off.delay
   0.041891     send_to_all: SETINFO device.type "ups"
   0.041899     send_to_all: SETINFO driver.version "2.6.5"
   0.041911     send_to_all: SETINFO driver.version.internal "0.37"
   0.041918     send_to_all: SETINFO driver.name "usbhid-ups"
   0.041925     upsdrv_initinfo...
   0.041932     send_to_all: SETINFO driver.version.data "EXPLORE HID 0.1"
   0.041945     send_to_all: SETINFO driver.parameter.pollfreq "30"
   0.041959     upsdrv_updateinfo...
   0.042017     libusb_get_interrupt: Function not implemented
   0.042025     Got 0 HID objects...
   0.042032     Quick update...
   0.042040     send_to_all: SETINFO ups.status "OB"
   0.042050     send_to_all: DATAOK
   0.058503     dstate_init: sock /var/db/nut/usbhid-ups-p1 open on fd 8
   0.058519     send_to_all: SETINFO driver.parameter.pollinterval "2"
   0.058531     send_to_all: SETINFO device.mfr "ATCL FOR UPS"
   0.058552     send_to_all: SETINFO device.model "ATCL FOR UPS"
   0.058580     send_to_all: SETINFO device.serial "ATCL FOR UPS"
   0.058591     upsdrv_updateinfo...
   0.058647     libusb_get_interrupt: Function not implemented
   0.058655     Got 0 HID objects...
   0.058661     Quick update...
   2.066393     upsdrv_updateinfo...
   2.066505     libusb_get_interrupt: Function not implemented
   2.066513     Got 0 HID objects...
   2.066520     Quick update...
   4.076359     upsdrv_updateinfo...
   4.076442     libusb_get_interrupt: Function not implemented
   4.076469     Got 0 HID objects...
   4.076480     Quick update...
   6.086324     upsdrv_updateinfo...
   6.086426     libusb_get_interrupt: Function not implemented
   6.086434     Got 0 HID objects...
   6.086441     Quick update...
   8.096290     upsdrv_updateinfo...
   8.096388     libusb_get_interrupt: Function not implemented
   8.096397     Got 0 HID objects...
   8.096403     Quick update...
  10.106257     upsdrv_updateinfo...
  10.106364     libusb_get_interrupt: Function not implemented
  10.106373     Got 0 HID objects...
  10.106379     Quick update...
  12.116222     upsdrv_updateinfo...
  12.116324     libusb_get_interrupt: Function not implemented
  12.116333     Got 0 HID objects...



is there anything else I could try?

--
With best regards,
     Gregory Edigarov

Reply via email to