On Dec 26, 2013, at 10:28 PM, Ariel Wainer wrote:> On 27/12/13 00:06, Charles Lepple wrote: >> Could you please send the debug output? (if it is more than ~ 30KB >> gzipped, just send it directly to me.) I was going to use the debug >> output from the earlier thread to generate those C files, but yeah, >> there are some additional bits needed. If nothing else, it would be >> good to improve the diagnostics for that script. > > Here's the output (attached). I interrupted the process, but it > continues looping forever. > > Kind regards. > <debug.log>There is a very proof-of-concept-y driver (nutdrv_atcl_usb) in the atcl branch in GitHub. We can probably remove a bunch of the retry loops that it inherited from richcomm_usb. There should also be a tarball here fairly soon: http://buildbot.networkupstools.org/public/nut/builders/Debian-x64-gcc/builds/115 -- Charles Lepple clepple at gmail
On 31/12/13 21:00, Charles Lepple wrote:> > There is a very proof-of-concept-y driver (nutdrv_atcl_usb) in the atcl branch in GitHub. > > We can probably remove a bunch of the retry loops that it inherited from richcomm_usb. > > There should also be a tarball here fairly soon: > > http://buildbot.networkupstools.org/public/nut/builders/Debian-x64-gcc/builds/115 >That's great! I downloaded the code from github, built it and here's what happened. With AC ok: root at lucy:/usr/local/ups/bin# ./nutdrv_atcl_usb -a ups -DDD -u root Network UPS Tools - 'ATCL FOR UPS' USB driver 0.01 (2.7.1.5) Warning: This is an experimental driver. Some features may not function correctly. 0.000000 debug level is '3' 2.297779 read: (8 bytes) => 03 00 00 00 00 00 00 00 2.298029 dstate_init: sock /var/state/ups/nutdrv_atcl_usb-ups open on fd 5 3.345960 read: (8 bytes) => 03 00 00 00 00 00 00 00 4.394102 read: (8 bytes) => 03 00 00 00 00 00 00 00 6.306350 read: (8 bytes) => 03 00 00 00 00 00 00 00 8.306648 read: (8 bytes) => 03 00 00 00 00 00 00 00 10.306919 read: (8 bytes) => 03 00 00 00 00 00 00 00 12.315210 read: (8 bytes) => 03 00 00 00 00 00 00 00 14.315452 read: (8 bytes) => 03 00 00 00 00 00 00 00 16.315744 read: (8 bytes) => 03 00 00 00 00 00 00 00 18.315995 read: (8 bytes) => 03 00 00 00 00 00 00 00 20.316306 read: (8 bytes) => 03 00 00 00 00 00 00 00 [continues forever] Here I started it with AC unplugged and then plugged it back in, you can see the change: root at lucy:/usr/local/ups/bin# ./nutdrv_atcl_usb -a ups -DDD -u root Network UPS Tools - 'ATCL FOR UPS' USB driver 0.01 (2.7.1.5) Warning: This is an experimental driver. Some features may not function correctly. 0.000000 debug level is '3' 2.521094 read: (8 bytes) => 01 00 00 00 00 00 00 00 2.521346 dstate_init: sock /var/state/ups/nutdrv_atcl_usb-ups open on fd 5 3.569176 read: (8 bytes) => 01 00 00 00 00 00 00 00 4.617379 read: (8 bytes) => 01 00 00 00 00 00 00 00 6.529645 read: (8 bytes) => 01 00 00 00 00 00 00 00 8.529894 read: (8 bytes) => 01 00 00 00 00 00 00 00 10.530161 read: (8 bytes) => 01 00 00 00 00 00 00 00 12.538490 read: (8 bytes) => 01 00 00 00 00 00 00 00 14.538700 read: (8 bytes) => 01 00 00 00 00 00 00 00 16.539040 read: (8 bytes) => 01 00 00 00 00 00 00 00 18.539349 read: (8 bytes) => 01 00 00 00 00 00 00 00 20.539600 read: (8 bytes) => 03 00 00 00 00 00 00 00 22.539836 read: (8 bytes) => 03 00 00 00 00 00 00 00 24.548131 read: (8 bytes) => 03 00 00 00 00 00 00 00 [continues forever] Then, I started upsd and tryed upsc: With AC ok: ./upsc ups at localhost device.mfr: ATCL FOR UPS device.model: ATCL FOR UPS device.type: ups driver.name: nutdrv_atcl_usb driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.version: 2.7.1.5 driver.version.internal: 0.01 ups.mfr: ATCL FOR UPS ups.model: ATCL FOR UPS ups.productid: 0000 ups.status: OL ups.vendorid: 0001 Unplugging: root at lucy:/usr/local/ups/bin# ./upsc ups at localhost device.mfr: ATCL FOR UPS device.model: ATCL FOR UPS device.type: ups driver.name: nutdrv_atcl_usb driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.version: 2.7.1.5 driver.version.internal: 0.01 ups.mfr: ATCL FOR UPS ups.model: ATCL FOR UPS ups.productid: 0000 ups.status: OB ups.vendorid: 0001 Low battery beeping: device.mfr: ATCL FOR UPS device.model: ATCL FOR UPS device.type: ups driver.name: nutdrv_atcl_usb driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.version: 2.7.1.5 driver.version.internal: 0.01 ups.mfr: ATCL FOR UPS ups.model: ATCL FOR UPS ups.productid: 0000 ups.status: LB OB ups.vendorid: 0001 When the battery runs out, the ups (and it's load) powers off and it reads: device.mfr: ATCL FOR UPS device.model: ATCL FOR UPS device.type: ups driver.name: nutdrv_atcl_usb driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.version: 2.7.1.5 driver.version.internal: 0.01 ups.mfr: ATCL FOR UPS ups.model: ATCL FOR UPS ups.productid: 0000 ups.status: OL ups.vendorid: 0001 2892.952972 read: (8 bytes) => 03 00 00 00 00 00 00 00 2894.953249 read: (8 bytes) => 03 00 00 00 00 00 00 00 2896.953469 read: (8 bytes) => 03 00 00 00 00 00 00 00 Very strange! It seems like the completly powered down and OK status yeild the same reading. The reading didn't change after plugging back in the AC.
On Jan 1, 2014, at 1:52 PM, Ariel Wainer wrote:> Very strange! It seems like the completly powered down and OK status > yeild the same reading. The reading didn't change after plugging back in > the AC.Well, as strange as that is, I don't think it would be a common case. Ordinarily, the load would be the computer monitoring the UPS, and if the load is off... We can certainly document that, though. In your testing, do you have suggestions on better debug levels? We should probably log the status changes at level 2 or less, since the hex dump is only useful for those who know the protocol. Also, I'm not sure how many of the messages we should print while scanning the bus. Good to hear that the rest of the driver works. Can you check the shutdown feature? (run the driver with "-k", or execute "upsdrvctl shutdown"). I wonder if the "0x01" in the shutdown command corresponds to the time between when the command is sent, and when the UPS actually turns off the load. -- Charles Lepple clepple at gmail