networkupstools / nut

The Network UPS Tools repository. UPS management protocol Informational RFC 9271 published by IETF at https://www.rfc-editor.org/info/rfc9271 Please star NUT on GitHub, this helps with sponsorships!
https://networkupstools.org/
Other
2.03k stars 349 forks source link

Tripp Lite SMX1200XLHG - protocol 3017 #2258

Open biohead opened 9 months ago

biohead commented 9 months ago

I've just got hold of a Tripp Lite SMX1200XLHG, although disappointed to find it's not fully working with NUT... yet. This is a 36v, 1000VA/750w UPS with 6 outlets, with expandable battery storage.

When using the tripplite_usb driver, it reports that it uses an unknown protocol:

root@proxmox2:~# upsdrvctl -ddddd start
Network UPS Tools - UPS driver controller 2.8.0
Network UPS Tools - Tripp Lite OMNIVS / SMARTPRO driver 0.33 (2.8.0)
Warning: This is an experimental driver.
Some features may not function correctly.

Detected a UPS: Tripp Lite /TRIPP LITE SMX1200XLHG 
Unit ID: 65535
Unknown protocol (3017)Attached to Tripp Lite TRIPP LITE SMX1200XLHG

As per the documentation, it's falling down with: ups.firmware.aux: protocol 3017

Here is the output when connecting using the tripplite_usb driver:

root@proxmox2:~# upsc tripp@localhost
Init SSL without certificate database
battery.voltage.nominal: 36
device.mfr: Tripp Lite
device.model: TRIPP LITE SMX1200XLHG
device.type: ups
driver.name: tripplite_usb
driver.parameter.bus: 001
driver.parameter.pollinterval: 15
driver.parameter.port: auto
driver.parameter.product: TRIPP LITE SMX1200XLHG
driver.parameter.productid: 0001
driver.parameter.synchronous: auto
driver.parameter.vendor: Tripp Lite
driver.parameter.vendorid: 09AE
driver.version: 2.8.0
driver.version.internal: 0.33
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
input.voltage.nominal: 230
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 42 38 38 0d 00 00 '7B88...'
ups.debug.L: 30 30 30 44 07 58 0d '000D.X.'
ups.debug.load_banks: 0
ups.debug.M: 37 39 37 44 0d 00 00 '797D...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 34 30 04 64 30 0d '140.d0.'
ups.debug.T: 41 34 31 46 33 30 0d 'A41F30.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
ups.delay.shutdown: 64
ups.firmware: F3009.C
ups.firmware.aux: protocol 3017
ups.id: 65535
ups.mfr: Tripp Lite
ups.model: TRIPP LITE SMX1200XLHG
ups.power.nominal: 1000
ups.productid: 0001
ups.status: 
ups.vendorid: 09ae 

I'm happy to try help assist working out this protocol and getting it into NUT, but not quite sure the best place to start this. I'm guessing the debug arrays are the useful info and they just need interpreting properly first?

jimklimov commented 9 months ago

CC @aquette @dzomaya

clepple commented 9 months ago

I'm guessing the debug arrays are the useful info and they just need interpreting properly first?

Yes. Here are examples for protocol 1001: https://github.com/networkupstools/nut/blob/v2.8.1/drivers/tripplite_usb.c#L33 and protocol 3003: https://github.com/networkupstools/nut/blob/v2.8.1/drivers/tripplite_usb.c#L67

From what I can tell, the main difference between the protocols is whether each value is sent in binary, BCD, hex, etc.: https://github.com/networkupstools/nut/blob/v2.8.1/drivers/tripplite_usb.c#L529 and what sort of scale factors need to be applied (usually based on the number of battery packs, or nominal AC voltage).

Hopefully this is just a matter of extending the driver with a few more case/switch statements. Unfortunately, I don't have a lot of time to maintain the driver these days (my 1001 unit needs a battery replacement, and the 3016 USB hardware was especially unreliable with newer USB controllers so I sold it to someone who didn't need monitoring), but I can probably answer a few questions here and there.

Along the lines of the 3016 USB hardware issue, you might be able to tell whether this will be a problem on the 3017 as well - just leave the USB cable plugged in for several days, and check the kernel log for disconnections. (Maybe run lsusb -v -d 09ae: occasionally to send some traffic to the UPS.) The general trend I saw was that later-generation USB 2.0+ host chipsets would stall when talking to the UPS (USB 1.1 low-speed, IIRC) and would eventually reconnect. Hopefully the 3017 doesn't have the same device-side USB chip. If it does, the driver modifications may not be worth the hassle.

biohead commented 9 months ago

I've had it powered up and connected for about 24 hours now, and so far dmesg is looking ok. I have configured NUT to talk to the UPS, and setup the upsstats.cgi to report on it - hopefuly that is keeping some traffic flowing. I'll keep it running like this for a bit longer to be sure.

This is the entire dmesg output since connecting the UPS yesterday (the device itself is sat doing nothing else, explaining the low message count):


[  215.933596] usb 1-1.2: New USB device found, idVendor=09ae, idProduct=0001, bcdDevice= 0.0a
[  215.933620] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  215.933628] usb 1-1.2: Product: TRIPP LI
[  215.933634] usb 1-1.2: Manufacturer: Tripp Lite 
[  215.940554] hid-generic 0003:09AE:0001.0004: hiddev0,hidraw0: USB HID v1.10 Device [Tripp Lite  TRIPP LI] on usb-0000:00:15.0-1.2/input0
[17145.851346] perf: interrupt took too long (2511 > 2500), lowering kernel.perf_event_max_sample_rate to 79500
[23295.285830] perf: interrupt took too long (3145 > 3138), lowering kernel.perf_event_max_sample_rate to 63500
[31446.963882] perf: interrupt took too long (3945 > 3931), lowering kernel.perf_event_max_sample_rate to 50500
[43787.983227] perf: interrupt took too long (4947 > 4931), lowering kernel.perf_event_max_sample_rate to 40250
[62903.362714] perf: interrupt took too long (6211 > 6183), lowering kernel.perf_event_max_sample_rate to 32000```
clepple commented 9 months ago

I have configured NUT to talk to the UPS, and setup the upsstats.cgi to report on it

but upsstats is just showing empty bar graphs? (just keeping the driver running should be sufficient - I think it sends each of the queries for the debug strings every two seconds)

That is a good sign, though - I saw issues with 3016 well before 24 hours.

biohead commented 9 months ago

Yes, it's got nothing but the name reported, everything else is "Not Supported". I was hoping it would keep enough traffic for the purpose of testing. If the driver would drop out, it'd hopefully show there too as not connected - saves me logging into the test server.

biohead commented 9 months ago

I've been running it like this, and not so much a sniff of any USB disconnections so I think it's good to continue.

What would be the best way to tackle this - just periodically poll and grab the debug strings? Or is there a logical method to breaking down these Tripp protocols?

clepple commented 9 months ago

Yes, logging the ups.debug.* values is what I did. If you make a shell script with upsc in a loop, it helps to record the time as well, and also try to ballpark some values for things like ambient temperature and percent load. Mark down stats from the LCD (if applicable); the UPS usually returns the same data in short order.

Just paging through the code for other models, I am noticing one value that corresponds to 120V (first character of ups.debug.V is effectively an enum), and another that corresponds to 50 Hz (last 0 of ups.debug.S) - is that correct? Also, you mentioned six outlets - are any of them individually controllable? (last 0 of ups.debug.V implies no) The 4 in ups.debug.S usually implies that no self-test has been performed recently.

biohead commented 9 months ago

Here is a first run at some outputs. Ambient temp is around 20C I'm UK - so nominal 240V/50Hz - NOT 120V. This unit has no LCD, so can't check the load. It's going to be around the 50w mark though. The unit is 1kVW/750w rated. No switchable output.

A self test was carried out just after 09:45 I simulated a power loss just before 10:00 There should've been a slight increase in load around 10:50 Power restored 11:00 Slight decrease in power at 11:10

[2024-01-25 09:20:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 44 38 38 0d 00 00 '7D88...'
ups.debug.L: 30 30 30 44 07 58 0d '000D.X.'
ups.debug.load_banks: 0
ups.debug.M: 36 43 38 31 0d 00 00 '6C81...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 34 30 00 64 30 0d '140.d0.'
ups.debug.T: 39 43 31 46 34 30 0d '9C1F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 09:25:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 44 38 38 0d 00 00 '7D88...'
ups.debug.L: 30 30 30 44 07 58 0d '000D.X.'
ups.debug.load_banks: 0
ups.debug.M: 36 43 38 31 0d 00 00 '6C81...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 34 30 00 64 30 0d '140.d0.'
ups.debug.T: 39 43 31 46 34 30 0d '9C1F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 09:30:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 44 38 38 0d 00 00 '7D88...'
ups.debug.L: 30 30 30 44 07 58 0d '000D.X.'
ups.debug.load_banks: 0
ups.debug.M: 36 43 38 31 0d 00 00 '6C81...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 34 30 00 64 30 0d '140.d0.'
ups.debug.T: 39 43 31 46 32 30 0d '9C1F20.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 09:35:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 44 38 38 0d 00 00 '7D88...'
ups.debug.L: 30 30 30 44 07 58 0d '000D.X.'
ups.debug.load_banks: 0
ups.debug.M: 36 43 38 31 0d 00 00 '6C81...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 34 30 00 64 30 0d '140.d0.'
ups.debug.T: 39 43 31 46 33 30 0d '9C1F30.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 09:40:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 44 38 38 0d 00 00 '7D88...'
ups.debug.L: 30 38 30 44 07 58 0d '080D.X.'
ups.debug.load_banks: 0
ups.debug.M: 36 43 38 31 0d 00 00 '6C81...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 34 30 00 64 30 0d '140.d0.'
ups.debug.T: 39 43 31 46 34 30 0d '9C1F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 09:45:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 42 38 38 0d 00 00 '7B88...'
ups.debug.L: 30 38 30 44 07 58 0d '080D.X.'
ups.debug.load_banks: 0
ups.debug.M: 36 43 38 31 0d 00 00 '6C81...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 34 30 00 64 30 0d '140.d0.'
ups.debug.T: 39 43 31 46 34 30 0d '9C1F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 09:50:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 42 38 44 0d 00 00 '7B8D...'
ups.debug.L: 30 38 30 44 07 58 0d '080D.X.'
ups.debug.load_banks: 0
ups.debug.M: 36 43 38 31 0d 00 00 '6C81...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 64 30 0d '100.d0.'
ups.debug.T: 39 43 31 46 34 30 0d '9C1F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 09:55:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 44 38 44 0d 00 00 '7D8D...'
ups.debug.L: 30 36 30 44 07 58 0d '060D.X.'
ups.debug.load_banks: 0
ups.debug.M: 36 43 38 31 0d 00 00 '6C81...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 64 30 0d '100.d0.'
ups.debug.T: 39 46 31 46 34 30 0d '9F1F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 10:00:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 30 30 37 43 0d 00 00 '007C...'
ups.debug.L: 33 43 30 44 07 58 0d '3C0D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 01 00 30 0d '100..0.'
ups.debug.T: 39 46 30 30 30 30 0d '9F0000.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 10:05:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 30 30 37 43 0d 00 00 '007C...'
ups.debug.L: 33 41 30 44 07 58 0d '3A0D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 01 00 30 0d '100..0.'
ups.debug.T: 41 30 30 30 30 30 0d 'A00000.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 10:10:02] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 30 30 37 42 0d 00 00 '007B...'
ups.debug.L: 33 41 30 44 07 58 0d '3A0D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 01 00 30 0d '100..0.'
ups.debug.T: 41 30 30 30 30 30 0d 'A00000.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 10:15:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 30 30 37 42 0d 00 00 '007B...'
ups.debug.L: 33 32 30 44 07 58 0d '320D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 01 00 30 0d '100..0.'
ups.debug.T: 41 30 30 30 30 30 0d 'A00000.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 10:20:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 30 30 37 42 0d 00 00 '007B...'
ups.debug.L: 33 32 30 44 07 58 0d '320D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 01 00 30 0d '100..0.'
ups.debug.T: 39 46 30 30 30 30 0d '9F0000.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 10:25:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 30 30 37 42 0d 00 00 '007B...'
ups.debug.L: 33 34 30 44 07 58 0d '340D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 01 00 30 0d '100..0.'
ups.debug.T: 39 46 30 30 30 30 0d '9F0000.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 10:30:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 30 30 37 42 0d 00 00 '007B...'
ups.debug.L: 33 32 30 44 07 58 0d '320D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 01 00 30 0d '100..0.'
ups.debug.T: 39 46 30 30 30 30 0d '9F0000.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 10:35:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 30 30 37 42 0d 00 00 '007B...'
ups.debug.L: 33 32 30 44 07 58 0d '320D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 01 00 30 0d '100..0.'
ups.debug.T: 39 46 30 30 30 30 0d '9F0000.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 10:40:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 30 30 37 42 0d 00 00 '007B...'
ups.debug.L: 33 32 30 44 07 58 0d '320D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 01 00 30 0d '100..0.'
ups.debug.T: 39 46 30 30 30 30 0d '9F0000.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 10:45:02] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 30 30 37 39 0d 00 00 '0079...'
ups.debug.L: 32 42 30 44 07 58 0d '2B0D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 01 00 30 0d '100..0.'
ups.debug.T: 39 46 30 30 30 30 0d '9F0000.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 10:50:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 30 30 37 38 0d 00 00 '0078...'
ups.debug.L: 32 42 30 44 07 58 0d '2B0D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 01 00 30 0d '100..0.'
ups.debug.T: 39 46 30 30 30 30 0d '9F0000.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 10:55:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 30 30 37 38 0d 00 00 '0078...'
ups.debug.L: 32 42 30 44 07 58 0d '2B0D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 01 00 30 0d '100..0.'
ups.debug.T: 39 46 30 30 30 30 0d '9F0000.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 11:00:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 44 38 33 0d 00 00 '7D83...'
ups.debug.L: 30 39 30 44 07 58 0d '090D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 32 30 0d '100.20.'
ups.debug.T: 41 34 31 46 34 30 0d 'A41F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 11:05:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 44 38 33 0d 00 00 '7D83...'
ups.debug.L: 30 38 30 44 07 58 0d '080D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 32 30 0d '100.20.'
ups.debug.T: 41 34 31 46 34 30 0d 'A41F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 11:10:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 42 38 33 0d 00 00 '7B83...'
ups.debug.L: 30 32 30 44 07 58 0d '020D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 32 30 0d '100.20.'
ups.debug.T: 41 33 31 46 34 30 0d 'A31F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 11:15:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 42 38 34 0d 00 00 '7B84...'
ups.debug.L: 30 32 30 44 07 58 0d '020D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 3c 30 0d '100..0.'
ups.debug.T: 41 33 31 46 34 30 0d 'A31F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 11:20:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 44 38 35 0d 00 00 '7D85...'
ups.debug.L: 30 32 30 44 07 58 0d '020D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 46 30 0d '100.F0.'
ups.debug.T: 41 33 31 46 33 30 0d 'A31F30.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 11:25:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 42 38 35 0d 00 00 '7B85...'
ups.debug.L: 30 32 30 44 07 58 0d '020D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 46 30 0d '100.F0.'
ups.debug.T: 41 33 31 46 34 30 0d 'A31F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 11:30:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 42 38 36 0d 00 00 '7B86...'
ups.debug.L: 30 32 30 44 07 58 0d '020D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 50 30 0d '100.P0.'
ups.debug.T: 41 34 31 46 35 30 0d 'A41F50.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 11:35:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 42 38 36 0d 00 00 '7B86...'
ups.debug.L: 30 32 30 44 07 58 0d '020D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 50 30 0d '100.P0.'
ups.debug.T: 41 34 31 46 34 30 0d 'A41F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 11:40:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 42 38 37 0d 00 00 '7B87...'
ups.debug.L: 30 32 30 44 07 58 0d '020D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 5a 30 0d '100.Z0.'
ups.debug.T: 41 35 31 46 34 30 0d 'A51F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 11:45:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 44 38 37 0d 00 00 '7D87...'
ups.debug.L: 30 30 30 44 07 58 0d '000D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 5a 30 0d '100.Z0.'
ups.debug.T: 41 35 31 46 33 30 0d 'A51F30.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 11:50:02] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 39 38 38 0d 00 00 '7988...'
ups.debug.L: 30 30 30 44 07 58 0d '000D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 64 30 0d '100.d0.'
ups.debug.T: 41 35 31 46 33 30 0d 'A51F30.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 11:55:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 42 38 39 0d 00 00 '7B89...'
ups.debug.L: 30 30 30 44 07 58 0d '000D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 64 30 0d '100.d0.'
ups.debug.T: 41 35 31 46 34 30 0d 'A51F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 12:00:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 42 38 41 0d 00 00 '7B8A...'
ups.debug.L: 30 30 30 44 07 58 0d '000D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 64 30 0d '100.d0.'
ups.debug.T: 41 36 31 46 34 30 0d 'A61F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
[2024-01-25 12:05:01] Command Output (filtered): 
ups.debug.0: 30 17 58 58 58 58 0d '0.XXXX.'
ups.debug.D: 37 44 38 36 0d 00 00 '7D86...'
ups.debug.L: 30 30 30 44 07 58 0d '000D.X.'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 50 30 0d '100.P0.'
ups.debug.T: 41 36 31 46 34 30 0d 'A61F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
clepple commented 9 months ago

Thanks, that's a good set of events for testing.

Okay, I guess that means that 3017 uses this weird voltage ordering: https://github.com/networkupstools/nut/blob/v2.8.1/drivers/tripplite_usb.c#L555

The S status digits are the same as basically all of the other models, which is good. (Note that after the self test, it went from 14... to 10....) The "on battery" status shows up at 10pm (4th ASCII digit of S), then M switches from 6C81 (min: 207V) to 0081 (min: 0V), with a max voltage of 247V throughout.

It looks like the load (first part of L) is pretty low except when you increased it to ~ 50%. The two hex digits at the beginning of the L string can be concatenated, so '32... (or 33 32 ... in the hex dump of the ASCII - confusing, I know) is 0x32 == 50.

clepple commented 9 months ago

If you're up for testing the code, I pushed an update to the 2217-TL-proto-3017 branch.

I don't personally have experience with proxmox, but given that it seems to be based on Debian, the following may be useful: https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests

clepple commented 9 months ago

I wonder if the temperature reading is intended to be a heatsink temperature rather than ambient. 0x9c - 0xa4 is roughly 35-38°C. At least it increases a bit when the inverter is on, so it isn't likely a NTC thermistor or anything wacky. Both of the commits on that branch put the 3017 protocol into the "smart" set, so they should both yield ups.temperature readings in upsc.

If you build the code from the branch, the driver version should be at least 0.36 - if not, you are still running the stock 2.8.0 driver.

biohead commented 9 months ago

I think I've had a good go at compiling, but when I try to start the driver I'm getting this error in the debug output:

   0.000000     [D5] send_to_all: SETINFO driver.state "init.starting"
Network UPS Tools - Tripp Lite OMNIVS / SMARTPRO driver 0.36 (2.8.1-405-g76d0602fb)
Warning: This is an experimental driver.
Some features may not function correctly.
   0.000284     [D5] send_to_all: SETINFO driver.version.usb "libusb-1.0.26 (API: 0x1000109)"
   0.000316     [D1] Using USB implementation: libusb-1.0.26 (API: 0x1000109)
   <snipped>
   0.600239     [D2] Checking device 5 of 8 (09AE/0001)
   0.605729     [D2] - VendorID: 09ae
   0.605787     [D2] - ProductID: 0001
   0.605811     [D2] - Manufacturer: Tripp Lite 
   0.605840     [D2] - Product: TRIPP LITE SMX1200XLHG 
   0.605937     [D2] - Serial Number: unknown
   0.605983     [D2] - Bus: 001
   0.606039     [D2] - Bus Port: 004
   0.606083     [D2] - Device: 005
   0.606111     [D2] - Device release number: 000a
   0.606140     [D2] Trying to match device
   0.606169     [D3] match_function_regex: matching a device...
   0.606211     [D2] Device matches
   0.606239     [D2] Reading configuration descriptor 1 of 1
   0.606296     [D3] libusb_kernel_driver_active() returned 0: Success
   0.606375     [D2] Claimed interface 0 successfully
   0.606421     [D3] nut_usb_set_altinterface: skipped libusb_set_interface_alt_setting(udev, 0, 0)
   0.607397     [D2] Retrieved HID descriptor (expected 9, got 9)
   0.607439     [D3] HID descriptor, method 1: (9 bytes) => 09 21 10 01 00 01 22 34 00
   0.607465     [D3] HID descriptor length (method 1) 52
   0.607496     [D4] i=0, extra[i]=09, extra[i+1]=21
   0.607530     [D3] HID descriptor, method 2: (9 bytes) => 09 21 10 01 00 01 22 34 00
   0.607562     [D3] HID descriptor length (method 2) 52
   0.607591     [D2] HID descriptor length 52
   0.609611     [D3] send_cmd(msg_len=2, type='U')
   0.609654     [D5] send_cmd: sending  3a 55 aa 0d 00 00 00 00 '.U......'
   0.717313     [D5] send_cmd: received 55 ff ff 0d 00 00 00 00 'U.......' (OK)
   0.717371     [D2] Caller doesn't like this device
clepple commented 9 months ago

I think @sapireli may have broken the default case when adding the "matching by unit ID" code to tripplite_usb. Try adding upsid = 65535 to ups.conf.

biohead commented 9 months ago

Looking good so far. Values displayed so far look as expected.

root@proxmox2:/tmp/nut# upsc tripp@localhost
Init SSL without certificate database
battery.test.status: Battery OK
battery.voltage: 40.80
battery.voltage.nominal: 36
device.mfr: Tripp Lite
device.model: TRIPP LITE SMX1200XLHG
device.type: ups
driver.debug: 0
driver.flag.allow_killpower: 0
driver.name: tripplite_usb
driver.parameter.pollinterval: 15
driver.parameter.port: auto
driver.parameter.productid: 0001
driver.parameter.synchronous: auto
driver.parameter.upsid: 65535
driver.parameter.vendorid: 09ae
driver.state: quiet
driver.version: 2.8.1-405-g76d0602fb
driver.version.internal: 0.36
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
input.frequency: 50.0
input.frequency.nominal: 50
input.voltage: 239
input.voltage.maximum: 247
input.voltage.minimum:   0
input.voltage.nominal: 230
ups.debug.D: 37 44 38 38 0d 00 00 '7D88...'
ups.debug.load_banks: 0
ups.debug.M: 30 30 38 31 0d 00 00 '0081...'
ups.debug.P: 30 31 30 30 30 58 0d '01000X.'
ups.debug.S: 31 30 30 00 64 30 0d '100.d0.'
ups.debug.T: 41 31 31 46 34 30 0d 'A11F40.'
ups.debug.V: 32 30 36 30 58 58 0d '2060XX.'
ups.delay.shutdown: 64
ups.firmware: F3009.C
ups.firmware.aux: protocol 3017
ups.id: 65535
ups.load: 0
ups.mfr: Tripp Lite
ups.model: TRIPP LITE SMX1200XLHG
ups.power.nominal: 1000
ups.productid: 0001
ups.status: OL
ups.temperature: 37.5
ups.vendorid: 09ae
biohead commented 9 months ago

When putting everything together, and using the NUT cgistats as the visualising mechanism, the only things missing now is the battery % and output (VAC). Runtime is also missing, but I guess there is a dependency on %. NUT Stats

clepple commented 9 months ago

There is a driver-side approximation for battery.charge that I just pushed. No guarantees as to the accuracy.

I don't know where the output voltage is - one of the other models stores it where this one reports load percentage. For the OMNIVS1000, I ramped the input voltage up and down with a variac, and watched what changed. Even if you get a variac, this one is going to complicate that because it has a voltage correction circuit.

None of the other models supported by this driver return runtime. That is usually estimated by the UPS firmware, because the UPS has better insight into the discharge statistics (voltage and current over time). Calculating runtime from battery percentage depends on the size of the battery, so you'd have an approximation on top of an approximation.

biohead commented 8 months ago

Driver: 2.8.1-406-g49d4a5ed7 - looks as expected! (Actively on battery operation to monitor the %age) image

jimklimov commented 8 months ago

Cross-referencing: fixes here are explored on branch https://github.com/networkupstools/nut/compare/2217-TL-proto-3017