Re: [Nut-upsuser] nutdrv_atcl_usb

2015-03-09 Thread hyo...@gmail.com
2014-11-09 16:29 GMT+01:00 Charles Lepple clep...@gmail.com:
 On Nov 8, 2014, at 7:01 PM, hyo...@gmail.com wrote:

 Since this UPS seems to be supported by UPSmart2000I, it could use a
 serial-over-usb implementation of the megatec protocol.

 Dan, that is a good point - I had not considered it. I assume companies will 
 copy bogus product IDs, but the use of the exact same USB string descriptor 
 is odd.

 Did you have a chance to compare the rest of the lsusb output that Jani sent 
 earlier in this thread? If it matches, then maybe the ATCL FOR USB string 
 comes from some generic USB-to-serial adapter chip.

Ops, sorry - I didn't notice your reply before.
I only have the following thing

kernel: usb 8-2: new low-speed USB device number 2 using xhci_hcd
kernel: usb 8-2: New USB device found, idVendor=0001, idProduct=
kernel: usb 8-2: New USB device strings: Mfr=1, Product=1, SerialNumber=1
kernel: usb 8-2: Product: ATCL FOR UPS
kernel: usb 8-2: Manufacturer: ATCL FOR UPS
kernel: usb 8-2: SerialNumber: ATCL FOR UPS
kernel: usb 8-2: ep 0x81 - rounding interval to 64 microframes, ep
desc says 80 microframes
kernel: usb 8-2: ep 0x2 - rounding interval to 64 microframes, ep desc
says 80 microframes
kernel: hid-generic 0003:0001:.0002: hiddev0,hidraw1: USB HID
v1.11 Device [ATCL FOR UPS ATCL FOR UPS] on usb-:03:00.0-2/input0

and the attached capture.


Gembird-UPS-PS-001.pcap.tar.gz
Description: GNU Zip compressed data
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] Install problems (group permissions) with nut 2.7.2

2015-03-09 Thread Rob Groner
Sorry for the bad formatting of the previous message...I tried to use plus 
signs as bullet points, and that caused a problem somehow.

Ok...I discovered that if I do the autoreconf after the first failed make (and 
the autoreconf still gives that error message), and then do make again...it 
builds.

Conclusions:
1) Autoreconf *must* be run, and not ./configure?  I had thought that putting 
in my *.c and *.h files and making the makefile changes and then executing 
./configure for the first time would be enough.  
2) Autoreconf appears to do what it needs to do, even though it shows and error 
and says it exited.

Sincerely,
Rob Groner



 -Original Message-
 From: Nut-upsuser [mailto:nut-upsuser-
 bounces+rgroner=rtd@lists.alioth.debian.org] On Behalf Of Rob Groner
 Sent: Monday, March 09, 2015 11:49 AM
 To: 'nut-upsuser List'
 Subject: Re: [Nut-upsuser] Install problems (group permissions) with nut
 2.7.2
 
 Ok, I tried this from scratch on a fresh 2.7.2 directory.  I followed the web
 instructions, specifically:
 
 + I generated the new subdriver for my UPS (rtd-hid.*) based on PATH info.
 + I put them in the drivers subdir
 + I added the include line (#include rtd-hid.h) in usbhid-ups.c
 + (specifically in the #ifndef SHUT_MODE section) I added
 + rtd_subdriver,  to the subdriver_list in usbhid-ups.c (specifically
 + in the #ifndef SHUT_MODE section) I added rtd-hid.c to
 + USBHID_UPS_SUBDRIVERS in drivers/Makefile.am I added rtd-hid.h to
 + dist_noinst_HEADERS in drivers/Makefile.am I executed ./configure
 + --with-usb --with-dev --etc --etc
 
 I execute make, and I get an error:
 /bin/sh ../libtool --tag=CC   --mode=link gcc -I../include  -g -O2 -Wall -
 Wsign-compare   -o usbhid-ups usbhid-ups.o libhid.o libusb.o hidparser.o
 usb-common.o apc-hid.o belkin-hid.o cps-hid.o explore-hid.o liebert-hid.o
 mge-hid.o powercom-hid.o tripplite-hid.o idowell-hid.o openups-hid.o
 ../common/libcommon.la ../common/libparseconf.la main.o dstate.o -lusb  -
 lpthread
 libtool: link: gcc -I../include -g -O2 -Wall -Wsign-compare -o usbhid-ups
 usbhid-ups.o libhid.o libusb.o hidparser.o usb-common.o apc-hid.o belkin-
 hid.o cps-hid.o explore-hid.o liebert-hid.o mge-hid.o powercom-hid.o
 tripplite-hid.o idowell-hid.o openups-hid.o main.o dstate.o
 ../common/.libs/libcommon.a ../common/.libs/libparseconf.a -lusb -lpthread
 usbhid-ups.o:(.rodata+0x110): undefined reference to `rtd_subdriver'
 collect2: error: ld returned 1 exit status
 make[1]: *** [usbhid-ups] Error 1
 make[1]: Leaving directory `/home/rtd/nut-2.7.2/drivers'
 
 I can see that somehow, somewhere, my rtd-hid.o isn't being included in
 that list.
 
 I followed the same process again, but this time tried autoreconf instead of
 configure (I had already run ./configure once).  That gave me an error
 message that I do not believe is related to my driver:
 
 Parallel-tests: error: required file './test-driver' not found
 Parallel-tests:  'automake --add-missing' can install 'test-driver'
 Autoreconf: automake failed with exit status 1
 
 
 
 Sincerely,
 Rob Groner
 
 
  -Original Message-
  From: Charles Lepple [mailto:clep...@gmail.com]
  Sent: Monday, March 02, 2015 8:27 PM
  To: Rob Groner
  Cc: nut-upsuser List
  Subject: Re: [Nut-upsuser] Install problems (group permissions) with
  nut
  2.7.2
 
  On Mar 2, 2015, at 12:49 PM, Rob Groner rgro...@rtd.com wrote:
 
   Well, having spent a decent amount of time trying to get my driver
   file
  added into the Makefile build system (and failing), I've decided that
  for now, simply adding that one line to the openups-hid.c file and
  recompiling is the best route to go.  When I can no longer live with
  the limited nature of the openups-hid driver, I'll revisit writing our own.
 
  I'll take this as a TODO item to make it clearer, but for later the
  basic information is here:
 
  http://www.networkupstools.org/docs/developer-
  guide.chunked/ar01s04.html#_writing_a_subdriver
 
  You must also add the subdriver to USBHID_UPS_SUBDRIVERS in
  drivers/Makefile.am and call autoreconf and/or ./configure from
  the top level NUT directory.
 
  To run autoreconf, you need automake, autoconf and libtool. automake
  turns Makefile.am into Makefile.in, and the ./configure script
  converts Makefile.in to the Makefile.
 
  --
  Charles Lepple
  clepple@gmail
 
 
 
 
 ___
 Nut-upsuser mailing list
 Nut-upsuser@lists.alioth.debian.org
 http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] nutdrv_atcl_usb

2015-03-09 Thread hyo...@gmail.com
Nice!
By the way, to avoid the initial protocol autodetection procedure and
to speed up the startup, you should set 'protocol=megatec'.
Do the various instant commands seem to work? Can you test them all
and report back the logs (a debug level of 5 should be enough)?
Also, what's the output of 'lsusb -vvv -d 0001:' (as root)?

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Install problems (group permissions) with nut 2.7.2

2015-03-09 Thread Rob Groner
Ok, I tried this from scratch on a fresh 2.7.2 directory.  I followed the web 
instructions, specifically:

+ I generated the new subdriver for my UPS (rtd-hid.*) based on PATH info.
+ I put them in the drivers subdir
+ I added the include line (#include rtd-hid.h) in usbhid-ups.c (specifically 
in the #ifndef SHUT_MODE section)
+ I added rtd_subdriver,  to the subdriver_list in usbhid-ups.c (specifically 
in the #ifndef SHUT_MODE section)
+ I added rtd-hid.c to USBHID_UPS_SUBDRIVERS in drivers/Makefile.am
+ I added rtd-hid.h to dist_noinst_HEADERS in drivers/Makefile.am
+ I executed ./configure --with-usb --with-dev --etc --etc

I execute make, and I get an error:
/bin/sh ../libtool --tag=CC   --mode=link gcc -I../include  -g -O2 -Wall 
-Wsign-compare   -o usbhid-ups usbhid-ups.o libhid.o libusb.o hidparser.o 
usb-common.o apc-hid.o belkin-hid.o cps-hid.o explore-hid.o liebert-hid.o 
mge-hid.o powercom-hid.o tripplite-hid.o idowell-hid.o openups-hid.o 
../common/libcommon.la ../common/libparseconf.la main.o dstate.o -lusb  
-lpthread 
libtool: link: gcc -I../include -g -O2 -Wall -Wsign-compare -o usbhid-ups 
usbhid-ups.o libhid.o libusb.o hidparser.o usb-common.o apc-hid.o belkin-hid.o 
cps-hid.o explore-hid.o liebert-hid.o mge-hid.o powercom-hid.o tripplite-hid.o 
idowell-hid.o openups-hid.o main.o dstate.o  ../common/.libs/libcommon.a 
../common/.libs/libparseconf.a -lusb -lpthread
usbhid-ups.o:(.rodata+0x110): undefined reference to `rtd_subdriver'
collect2: error: ld returned 1 exit status
make[1]: *** [usbhid-ups] Error 1
make[1]: Leaving directory `/home/rtd/nut-2.7.2/drivers'

I can see that somehow, somewhere, my rtd-hid.o isn't being included in that 
list.

I followed the same process again, but this time tried autoreconf instead of 
configure (I had already run ./configure once).  That gave me an error message 
that I do not believe is related to my driver:

Parallel-tests: error: required file './test-driver' not found
Parallel-tests:  'automake --add-missing' can install 'test-driver'
Autoreconf: automake failed with exit status 1



Sincerely,
Rob Groner


 -Original Message-
 From: Charles Lepple [mailto:clep...@gmail.com]
 Sent: Monday, March 02, 2015 8:27 PM
 To: Rob Groner
 Cc: nut-upsuser List
 Subject: Re: [Nut-upsuser] Install problems (group permissions) with nut
 2.7.2
 
 On Mar 2, 2015, at 12:49 PM, Rob Groner rgro...@rtd.com wrote:
 
  Well, having spent a decent amount of time trying to get my driver file
 added into the Makefile build system (and failing), I've decided that for now,
 simply adding that one line to the openups-hid.c file and recompiling is the
 best route to go.  When I can no longer live with the limited nature of the
 openups-hid driver, I'll revisit writing our own.
 
 I'll take this as a TODO item to make it clearer, but for later the basic
 information is here:
 
 http://www.networkupstools.org/docs/developer-
 guide.chunked/ar01s04.html#_writing_a_subdriver
 
 You must also add the subdriver to USBHID_UPS_SUBDRIVERS in
 drivers/Makefile.am and call autoreconf and/or ./configure from the top
 level NUT directory.
 
 To run autoreconf, you need automake, autoconf and libtool. automake
 turns Makefile.am into Makefile.in, and the ./configure script converts
 Makefile.in to the Makefile.
 
 --
 Charles Lepple
 clepple@gmail
 
 


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Fwd: Data stale error after short while

2015-03-09 Thread Jakub Scepka
I just would like to confirm that I face very similar issue when I want to
connect UPS to VM machine (on ESX server). I blame VmWare USB passthrough.


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Install problems (group permissions) with nut 2.7.2

2015-03-09 Thread Charles Lepple
On Mar 9, 2015, at 12:00 PM, Rob Groner rgro...@rtd.com wrote:

 1) Autoreconf *must* be run, and not ./configure?  I had thought that putting 
 in my *.c and *.h files and making the makefile changes and then executing 
 ./configure for the first time would be enough.  

Each tool serves a different purpose. autoreconf (and NUT's autogen.sh, by 
inclusion) generates the ./configure script. I think it typically runs it as 
well, but often you would re-run it with --prefix= or other arguments (such 
as --with-drivers=usbhid-ups to cut down on compilation time).

It occurred to me that your driver will be introducing new USB VID:PID entries, 
so this is something else that autogen.sh does: it rebuilds the udev files that 
change permissions when the UPS gets plugged in.

I mentioned pulling in a copy of autogen.sh earlier, and I'm not sure what 
other developer-only scripts are left out of the tarball. We really only 
heavily test two cases: building from Git, and building from a clean tarball. 
Small patches to the tarball are easy; structural changes like adding files are 
harder to guarantee that they will work.

That, plus the fact that 2.7.2 still has the old prefix number on the udev 
files, means you might be better off starting from the latest Git version of 
NUT, or at least including the following patch:

https://github.com/networkupstools/nut/commit/040c800efad46ead9670077c9764360802d7aaf5

Reference:

https://github.com/networkupstools/nut/issues/140

-- 
Charles Lepple
clepple@gmail




___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] nutdrv_atcl_usb

2015-03-09 Thread Charles Lepple

On Mar 9, 2015, at 11:28 AM, hyo...@gmail.com wrote:

 2014-11-09 16:29 GMT+01:00 Charles Lepple clep...@gmail.com:
 On Nov 8, 2014, at 7:01 PM, hyo...@gmail.com wrote:
 
 Since this UPS seems to be supported by UPSmart2000I, it could use a
 serial-over-usb implementation of the megatec protocol.
 
 Dan, that is a good point - I had not considered it. I assume companies will 
 copy bogus product IDs, but the use of the exact same USB string descriptor 
 is odd.
 
 Did you have a chance to compare the rest of the lsusb output that Jani sent 
 earlier in this thread? If it matches, then maybe the ATCL FOR USB string 
 comes from some generic USB-to-serial adapter chip.
 
 Ops, sorry - I didn't notice your reply before.
 I only have the following thing
 
 kernel: usb 8-2: new low-speed USB device number 2 using xhci_hcd
 kernel: usb 8-2: New USB device found, idVendor=0001, idProduct=
 kernel: usb 8-2: New USB device strings: Mfr=1, Product=1, SerialNumber=1
 kernel: usb 8-2: Product: ATCL FOR UPS
 kernel: usb 8-2: Manufacturer: ATCL FOR UPS
 kernel: usb 8-2: SerialNumber: ATCL FOR UPS
 kernel: usb 8-2: ep 0x81 - rounding interval to 64 microframes, ep
 desc says 80 microframes
 kernel: usb 8-2: ep 0x2 - rounding interval to 64 microframes, ep desc
 says 80 microframes
 kernel: hid-generic 0003:0001:.0002: hiddev0,hidraw1: USB HID
 v1.11 Device [ATCL FOR UPS ATCL FOR UPS] on usb-:03:00.0-2/input0
 
 and the attached capture.
 Gembird-UPS-PS-001.pcap.tar.gz

Hmm, the enumeration seems to be missing.

But it definitely seems to be more of a query-response protocol. The 
nutdrv_atcl_usb driver just reads interrupt packets, and doesn't send anything 
except to trigger a shutdown.

Could be a generic USB-to-serial chip, then. Too bad there isn't more to 
distinguish the two UPS types.

-- 
Charles Lepple
clepple@gmail




___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser