Re: [Nut-upsuser] Tripp-Lite BCPERS450 shutdown/restart problems

2018-01-11 Thread Charles Lepple
On Jan 11, 2018, at 3:14 PM, Ken Olum wrote:
> 
> So I monitored the USB port with wireshark (an interesting endeavor
> since I didn't start out with any knowledge of USB protocols).  But I
> have managed to discover that when I ask Tripp Lite's poweralert
> software to schedule a UPS shutdown, it does it by using the SET_REPORT
> function of the USB HID protocol with ReportType "Feature", ReportID 21
> (0x15), and 3 bytes of data which are 0x15 followed by the number of
> seconds to wait before shutting down in two bytes, LSB first.
> 
> Below I include wireshark packet dissections for two such commands.  The
> difference is in the "data fragment".  In the first case it is 150500,
> representing a shutdown in 5 seconds, and the second 153701,
> representing a shutdown in 311 = 0x0137 seconds.
> 
> Is this helpful?

Definitely. (The trick will be adding support for this without breaking other 
models.)

Here's the debug output describing ReportID 0x15:

  0.070916  Path: UPS.OutletSystem.Outlet.DelayBeforeShutdown, Type: 
Feature, ReportID: 0x15, Offset: 0, Size: 16, Value: 65535

(In case you are interested, this mapping between the "Path" and the report ID 
is in the HID Report Descriptor which should be early in the Wireshark capture.)

Other HID UPS models tend to provide both DelayBeforeShutdown and 
DelayBeforeStartup, so I will need to reacquaint myself with how that is 
handled in the code, since your UPS only seems to need one of those (and this 
command is an exception to the usual 1:1 mapping of HID Usage IDs to NUT 
variables). That might not happen until the weekend.

For completeness, would you mind sending the output of "upsrw" and "upscmd -l"? 
I would like to verify some of the other mappings, and also publish that here: 
http://networkupstools.org/ddl/Tripp_Lite/index.html
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Tripp-Lite BCPERS450 shutdown/restart problems

2018-01-11 Thread Ken Olum
Thanks again for your help, Charles.  I was able to install the Tripp
Lite software on my Ubuntu machine, and it sort of works.  It does
something which continually changes the USB device ID of the UPS, and
prints voluminous error messages in the log.  However, one of the things
that it can do is to schedule a UPS shutdown, which Nut does not know
how to do.

So I monitored the USB port with wireshark (an interesting endeavor
since I didn't start out with any knowledge of USB protocols).  But I
have managed to discover that when I ask Tripp Lite's poweralert
software to schedule a UPS shutdown, it does it by using the SET_REPORT
function of the USB HID protocol with ReportType "Feature", ReportID 21
(0x15), and 3 bytes of data which are 0x15 followed by the number of
seconds to wait before shutting down in two bytes, LSB first.

Below I include wireshark packet dissections for two such commands.  The
difference is in the "data fragment".  In the first case it is 150500,
representing a shutdown in 5 seconds, and the second 153701,
representing a shutdown in 311 = 0x0137 seconds.

Is this helpful?

Ken


  27738 174.290305 host  1.44.0USBHID   67  
   SET_REPORT Request

Frame 27738: 67 bytes on wire (536 bits), 67 bytes captured (536 bits) on 
interface 0
USB URB
[Source: host]
[Destination: 1.44.0]
URB id: 0x964d9a2f8540
URB type: URB_SUBMIT ('S')
URB transfer type: URB_CONTROL (0x02)
Endpoint: 0x00, Direction: OUT
Device: 44
URB bus id: 1
Device setup request: relevant (0)
Data: present (0)
URB sec: 1515699253
URB usec: 785764
URB status: Operation now in progress (-EINPROGRESS) (-115)
URB length [bytes]: 3
Data length [bytes]: 3
[Response in: 27739]
Interval: 0
Start frame: 0
Copy of Transfer Flags: 0x
Number of ISO descriptors: 0
[bInterfaceClass: HID (0x03)]
URB setup
bmRequestType: 0x21
bRequest: 9
wValue: 0x0315
wIndex: 0 (0x)
wLength: 3
Data Fragment: 150500
bRequest: SET_REPORT (0x09)
wValue: 0x0315
ReportID: 21
ReportType: Feature (3)
wIndex: 0
wLength: 3

  66224 1042.041242host  1.48.0USBHID   67  
   SET_REPORT Request

Frame 66224: 67 bytes on wire (536 bits), 67 bytes captured (536 bits) on 
interface 0
USB URB
[Source: host]
[Destination: 1.48.0]
URB id: 0x964c9246bd80
URB type: URB_SUBMIT ('S')
URB transfer type: URB_CONTROL (0x02)
Endpoint: 0x00, Direction: OUT
Device: 48
URB bus id: 1
Device setup request: relevant (0)
Data: present (0)
URB sec: 1515700121
URB usec: 536701
URB status: Operation now in progress (-EINPROGRESS) (-115)
URB length [bytes]: 3
Data length [bytes]: 3
[Response in: 66225]
Interval: 0
Start frame: 0
Copy of Transfer Flags: 0x
Number of ISO descriptors: 0
[bInterfaceClass: HID (0x03)]
URB setup
bmRequestType: 0x21
bRequest: 9
wValue: 0x0315
wIndex: 0 (0x)
wLength: 3
Data Fragment: 153701
bRequest: SET_REPORT (0x09)
wValue: 0x0315
ReportID: 21
ReportType: Feature (3)
wIndex: 0
wLength: 3

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