Steve Ballantyne
2014-Jul-01 13:17 UTC
[Nut-upsuser] The dreaded Tripp Lite SMART500RT1U and NUT
Hello Charles, Thank you for all of your help this far. I have made some great progress. I was hung up with all sorts of USB problems which we can chalk up to a "blonde moment" for me (or more accurately, a *bald* moment). In all my starting over and screwing around, I had forgotten to reinstall libusb-compat. Duh! I am now to a point that I think we can dig a little deeper. The patch that you provided me works fine, and allows a connection with some basic values (see bottom of thread). On Sat, Jun 28, 2014 at 12:13 AM, Charles Lepple <clepple at gmail.com> wrote:> The ideal situation is a trace of all the USB commands that the > Windows software sends. However, I think this is just a binary version > of the 3003 protocol, so experimenting might be easier.SNIP, SNIP> I think the 'M' command shows the min and max voltages - see if there > is something similar in the Windows display.How would I go about providing you this stuff? Can you point me to something that would help trace out the USB data? I can install the software, and run it, but I would need some guidance on grabbing the USB debug info. This UPS has produces some really helpful data if we can manage to yank it out of there. Examples, charge remaining (in percentage), temperature, age of the battery, date of last self test, etc.> Attached is a patch to try to map some of the 3005 differences into > the driver. It should apply to the NUT 2.7.2 tarball, but it was > generated from the Git master branch. If you do check out from Github, > you'll need to install autoconf, automake and libtool. AsciiDoc is > pretty slow, so you can pass "--without-doc" to the ./configure > script. You may also want to add "--with-drivers=tripplite_usb" so > that it doesn't try to compile everything.Your patch, along with a lot of other Raspbian/Debian changes got me up and running. For any other fool that would dare attempt this ... I am providing what it took to get this up and running. Note that there are some direct links in here to mirrors that could go belly up. And I may not be choosing the most ideal of permissions. While you might be able to copy and paste this into a shell script and run it ... I would suggest stepping using these steps only as guidance. ### BEGIN SCRIPT ### #some depencies from repo sudo apt-get -y install m4 libtool libudev-dev automake #fixing autoconf for later sudo ln -s /usr/share/autoconf/Autom4te /usr/local/share/autoreconf/Autom4te sudo ln -s /usr/bin/autom4te /usr/local/bin/autom4te sudo ln -s /usr/bin/autoconf /usr/local/bin/autoconf sudo ln -s /usr/bin/autoheader /usr/local/bin/autoheader #installing nut dependencies mkdir nut-depends cd ./nut-depends # acscripts from source wget http://sourceforge.net/projects/acscripts.berlios/files/acscripts-0.0.1.13.tar.bz2 tar xf acscripts-0.0.1.13.tar.bz2 sudo mkdir /usr/lib/scripts sudo mv acscripts-0.0.1.13 /usr/lib/scripts/acscripts #autoreconf from source wget http://sourceforge.net/projects/autoreconf/files/0.0.0.1/autoreconf-0.0.0.1.tar.bz2 tar xf autoreconf-0.0.0.1.tar.bz2 cd autoreconf-0.0.0.1 ./configure && sudo make install cd .. #libusb and libusb-compat from source wget "http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.18/libusb-1.0.18.tar.bz2?r=http%3A%2F%2Fwww.libusb.org%2F&ts=1404210716&use_mirror=softlayer-ams" -O libusb-1.0.18.tar.bz2 tar -xjf libusb-1.0.18.tar.bz2 cd libusb-1.0.18 ./configure && sudo make install cd .. wget "http://downloads.sourceforge.net/project/libusb/libusb-compat-0.1/libusb-compat-0.1.4/libusb-compat-0.1.4.tar.bz2?r=http%3A%2F%2Fwww.libusb.org%2F&ts=1404210428&use_mirror=softlayer-ams" -O libusb-compat-0.1.4.tar.bz2 tar -xjf libusb-compat-0.1.4.tar.bz2 cd libusb-compat-0.1.4 ./configure && sudo make install cd .. #get back to home root cd .. #download nut from dev repo git clone git://github.com/networkupstools/nut.git cd nut #patch for TrippLite SMART500RT1U wget http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20140628/a7e23666/attachment.bin -O charles-tripplite.patch patch -p1 < charles-tripplite.patch echo "Running autogen ..." ./autogen.sh #create some groups and directories and mod some persmissions sudo groupadd nut sudo usermod -a -G nut pi sudo usermod -a -G nut root sudo mkdir /var/run/nut sudo chown root:nut /var/run/nut sudo mkdir -p /var/state/ups sudo chown root:nut /var/state/ups sudo chmod 0770 /var/state/ups #now we ./configure and make it ./configure --without-doc --with-drivers=tripplite_usb,upsdrvctl #still tries to build docs, even though I said NO to docs cp Makefile Makefile.orig sed -i 's/include common clients conf data tools docs drivers/include common clients conf data tools drivers/' Makefile make sudo make install ### END SCRIPT ### ### BEGIN CONFIG FILE CHANGES / STARTUP ### sudo vi /usr/local/ups/etc/ups.conf [SMART500RT1U] driver = tripplite_usb port = auto desc = "Tripp Lite SmartUPS 500RT 1U" sudo vi /etc/udev/rules.d/90-nut-ups.rules # TrippLite UPS [09ae:0001] ACTION=="add", \ SUBSYSTEM=="usb", \ ATTR{idVendor}=="09ae", ATTR{idProduct}=="0001", \ MODE="0666", GROUP="nut" sudo vi /usr/local/ups/etc/upsd.users [pi] password = pi upsmon master MONITOR SMART500RT1U at localhost 1 pi pass master sudo vi /usr/local/ups/etc/upsd.conf # DEFAULTS # LISTEN ::1 3493 # LISTEN localhost 3493 sudo chown root:nut /usr/local/ups/etc/upsd.conf /usr/local/ups/etc/upsd.users sudo chmod 0640 /usr/local/ups/etc/upsd.conf /usr/local/ups/etc/upsd.users sudo /usr/local/ups/sbin/upsdrvctl -u pi start sudo /usr/local/ups/sbin/upsd -u pi -4 ### END CONFIG FILE CHANGES / STARTUP ### ## TESTING DUMP! ## # Plugged into 120v outlet ... pi at raspberrypi ~/nut $ /usr/local/ups/bin/upsc SMART500RT1U at localhost battery.voltage.nominal: 12 device.mfr: Tripp Lite device.model: SMART500RT1U device.type: ups driver.name: tripplite_usb driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.version: 2.7.2-signed-19-g90e2790 driver.version.internal: 0.24 input.voltage.nominal: 120 outlet.1.desc: Load 1 outlet.1.id: 1 outlet.1.switch: 1 outlet.1.switchable: 1 outlet.2.desc: Load 2 outlet.2.id: 2 outlet.2.switchable: 0 ups.debug.D: 00 79 00 8b 0d 00 00 '.y.....' ups.debug.L: 00 00 00 07 58 58 0d '....XX.' ups.debug.load_banks: 1 ups.debug.M: 00 74 00 7f 0d 00 00 '.t.....' ups.debug.P: 30 30 35 30 30 58 0d '00500X.' ups.debug.S: 01 04 00 00 64 00 0d '....d..' ups.debug.T: 20 00 02 57 01 58 0d '...W.X.' ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' ups.delay.shutdown: 64 ups.firmware: F334401 ups.firmware.aux: protocol 3005 ups.id: 0 ups.mfr: Tripp Lite ups.model: SMART500RT1U ups.power.nominal: 500 ups.productid: 0001 ups.status: OL ups.vendorid: 09ae # UNPLUGGED! pi at raspberrypi ~/nut $ /usr/local/ups/bin/upsc SMART500RT1U at localhost battery.voltage.nominal: 12 device.mfr: Tripp Lite device.model: SMART500RT1U device.type: ups driver.name: tripplite_usb driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.version: 2.7.2-signed-19-g90e2790 driver.version.internal: 0.24 input.voltage.nominal: 120 outlet.1.desc: Load 1 outlet.1.id: 1 outlet.1.switch: 1 outlet.1.switchable: 1 outlet.2.desc: Load 2 outlet.2.id: 2 outlet.2.switchable: 0 ups.debug.D: 00 00 00 84 0d 00 00 '.......' ups.debug.L: 00 00 00 07 58 58 0d '....XX.' ups.debug.load_banks: 1 ups.debug.M: 00 00 00 7f 0d 00 00 '.......' ups.debug.P: 30 30 35 30 30 58 0d '00500X.' ups.debug.S: 01 04 00 01 64 00 0d '....d..' ups.debug.T: 20 00 00 00 01 58 0d '.....X.' ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' ups.delay.shutdown: 64 ups.firmware: F334401 ups.firmware.aux: protocol 3005 ups.id: 0 ups.mfr: Tripp Lite ups.model: SMART500RT1U ups.power.nominal: 500 ups.productid: 0001 ups.status: OB ups.vendorid: 09ae # Replugged! pi at raspberrypi ~/nut $ /usr/local/ups/bin/upsc SMART500RT1U at localhost battery.voltage.nominal: 12 device.mfr: Tripp Lite device.model: SMART500RT1U device.type: ups driver.name: tripplite_usb driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.version: 2.7.2-signed-19-g90e2790 driver.version.internal: 0.24 input.voltage.nominal: 120 outlet.1.desc: Load 1 outlet.1.id: 1 outlet.1.switch: 1 outlet.1.switchable: 1 outlet.2.desc: Load 2 outlet.2.id: 2 outlet.2.switchable: 0 ups.debug.D: 00 79 00 81 0d 00 00 '.y.....' ups.debug.L: 00 00 00 07 58 58 0d '....XX.' ups.debug.load_banks: 1 ups.debug.M: 00 00 00 7f 0d 00 00 '.......' ups.debug.P: 30 30 35 30 30 58 0d '00500X.' ups.debug.S: 01 04 00 00 5a 00 0d '....Z..' ups.debug.T: 20 00 02 58 01 58 0d '...X.X.' ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' ups.delay.shutdown: 64 ups.firmware: F334401 ups.firmware.aux: protocol 3005 ups.id: 0 ups.mfr: Tripp Lite ups.model: SMART500RT1U ups.power.nominal: 500 ups.productid: 0001 ups.status: OL ups.vendorid: 09ae pi at raspberrypi ~/nut $ Steve Ballantyne Network Engineer MCSE/MCDST; Novell CLA; LPIC-1; CTT+; A+; Network+; Linux+; Server+; I-Net+; Security+; SonicWALL CSSA
Steve Ballantyne
2014-Jul-01 19:12 UTC
[Nut-upsuser] The dreaded Tripp Lite SMART500RT1U and NUT
On Tue, Jul 1, 2014 at 9:17 AM, Steve Ballantyne <steve.ballantyne at gmail.com> wrote:> How would I go about providing you this stuff? Can you point me to > something that would help trace out the USB data?I thought I would try to make sense of the ups.debug data. All I have really figured out is that the fourth hex segment for S is a 00 for plugged in and a 01 for on-battery. Which the driver already knows. The rest is a mystery to me. But I played around with unplugging and running the load down, and then recharging, etc. Here are my notes and observations. NC = "no change". I am assuming that those fields are the make/model/serial number, etc. S fourth segment = 00 for on-power, 01 for on-battery UNPLUGD a while ups.debug.D: 00 00 00 7d 0d 00 00 '.......' <---- 4th segment = 125 ups.debug.L: 06 00 00 07 58 58 0d '....XX.' <---- 1st segment = 6 ups.debug.load_banks: 1 ups.debug.M: 00 00 00 7f 0d 00 00 '.......' NC ups.debug.P: 30 30 35 30 30 58 0d '00500X.' NC ups.debug.S: 01 04 00 01 4d 00 0d '....M..' <---- 5th segment = 77 ups.debug.T: 21 00 00 00 01 58 0d '.....X.' <---- 3/4/5 segments = 00 00 01 ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' NC REPLUGd ups.debug.D: 00 79 00 81 0d 00 00 '.y.....' <---- 4th segment = 81 ups.debug.L: 08 00 00 07 58 58 0d '....XX.' <---- 1st segment = 8 ups.debug.load_banks: 1 ups.debug.M: 00 00 00 7f 0d 00 00 '.......' NC ups.debug.P: 30 30 35 30 30 58 0d '00500X.' NC ups.debug.S: 01 04 00 00 5a 00 0d '....Z..' <---- 5th segment = 77 ups.debug.T: 21 00 02 57 01 58 0d '...W.X.' <---- 3/4/5 segments = 02 57 01 ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' NC ... ups.debug.D: 00 79 00 82 0d 00 00 '.y.....' <---- 4th segment = 82 ups.debug.L: 07 00 00 07 58 58 0d '....XX.' <---- 1st segment = 7 ups.debug.load_banks: 1 ups.debug.M: 00 00 00 7f 0d 00 00 '.......' NC ups.debug.P: 30 30 35 30 30 58 0d '00500X.' NC ups.debug.S: 01 04 00 00 5d 00 0d '.......' <---- 5th segment = 90 ups.debug.T: 21 00 02 57 01 58 0d '...W.X.' <---- 3/4/5 segments = 02 57 01 ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' NC ... ups.debug.D: 00 79 00 84 0d 00 00 '.y.....' <---- 4th segment = 84 ups.debug.L: 07 00 00 07 58 58 0d '....XX.' <---- 1st segment = 7 ups.debug.load_banks: 1 ups.debug.M: 00 00 00 7f 0d 00 00 '.......' NC ups.debug.P: 30 30 35 30 30 58 0d '00500X.' NC ups.debug.S: 01 04 00 00 64 00 0d '....d..' <---- 5th segment = 64 ups.debug.T: 21 00 02 57 01 58 0d '...W.X.' <---- 3/4/5 segments = 02 57 01 ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' NC ... ups.debug.D: 00 79 00 85 0d 00 00 '.y.....' <---- 4th segment = 85 ups.debug.L: 07 00 00 07 58 58 0d '....XX.' <---- 1st segment = 7 ups.debug.load_banks: 1 ups.debug.M: 00 00 00 7f 0d 00 00 '.......' NC ups.debug.P: 30 30 35 30 30 58 0d '00500X.' NC ups.debug.S: 01 04 00 00 64 00 0d '....d..' <---- 5th segment = 64 ups.debug.T: 21 00 02 57 01 58 0d '...W.X.' <---- 3/4/5 segments = 02 57 01 ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' NC AFTER SELF-TEST ups.debug.D: 00 79 00 83 0d 00 00 '.y.....' <---- 4th segment = 83 ups.debug.L: 07 00 00 07 58 58 0d '....XX.' <---- 1st segment = 7 ups.debug.load_banks: 1 ups.debug.M: 00 00 00 7f 0d 00 00 '.......' NC ups.debug.P: 30 30 35 30 30 58 0d '00500X.' NC ups.debug.S: 01 00 00 00 60 00 0d '.......' <---- 5th segment = 60 ups.debug.T: 21 00 02 57 01 58 0d '...W.X.' <---- 3/4/5 segments = 02 57 01 ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' NC ... ... ups.debug.D: 00 79 00 88 0d 00 00 '.y.....' <---- 4th segment = 88 ups.debug.L: 07 00 00 07 58 58 0d '....XX.' <---- 1st segment = 7 ups.debug.load_banks: 1 ups.debug.M: 00 00 00 7f 0d 00 00 '.......' NC ups.debug.P: 30 30 35 30 30 58 0d '00500X.' NC ups.debug.S: 01 00 00 00 64 00 0d '....d..' <---- 5th segment = 64 ups.debug.T: 21 00 02 58 01 58 0d '...X.X.' <---- 3/4/5 segments = 02 58! 01 ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' NC ... ups.debug.D: 00 79 00 88 0d 00 00 '.y.....' <---- 4th segment = 88 ups.debug.L: 07 00 00 07 58 58 0d '....XX.' <---- 1st segment = 7 ups.debug.load_banks: 1 ups.debug.M: 00 00 00 7f 0d 00 00 '.......' NC ups.debug.P: 30 30 35 30 30 58 0d '00500X.' NC ups.debug.S: 01 00 00 00 64 00 0d '....d..' <---- 5th segment = 64 ups.debug.T: 21 00 02 57 01 58 0d '...W.X.' <---- 3/4/5 segments = 02 57 01 ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' NC ... ups.debug.D: 00 79 00 88 0d 00 00 '.y.....' <---- 4th segment = 88 ups.debug.L: 07 00 00 07 58 58 0d '....XX.' <---- 1st segment = 7 ups.debug.load_banks: 1 ups.debug.M: 00 00 00 7f 0d 00 00 '.......' NC ups.debug.P: 30 30 35 30 30 58 0d '00500X.' NC ups.debug.S: 01 00 00 00 64 00 0d '....d..' <---- 5th segment = 64 ups.debug.T: 21 00 02 57 01 58 0d '...W.X.' <---- 3/4/5 segments = 02 57 01 ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' NC FULLY RECHARGED ups.debug.D: 00 79 00 89 0d 00 00 '.y.....' <---- 4th segment = 89 ups.debug.L: 07 00 00 07 58 58 0d '....XX.' <---- 1st segment = 7 ups.debug.load_banks: 1 ups.debug.M: 00 00 00 7f 0d 00 00 '.......' NC ups.debug.P: 30 30 35 30 30 58 0d '00500X.' NC ups.debug.S: 01 00 00 00 64 00 0d '....d..' <---- 5th segment = 64 ups.debug.T: 21 00 02 58 01 58 0d '...X.X.' <---- 3/4/5 segments = 02 58 01 ups.debug.V: 02 00 0c 01 58 58 0d '....XX.' NC Steve Ballantyne Network Engineer MCSE/MCDST; Novell CLA; LPIC-1; CTT+; A+; Network+; Linux+; Server+; I-Net+; Security+; SonicWALL CSSA
Charles Lepple
2014-Jul-01 20:55 UTC
[Nut-upsuser] The dreaded Tripp Lite SMART500RT1U and NUT
On Tue, Jul 1, 2014 at 3:12 PM, Steve Ballantyne <steve.ballantyne at gmail.com> wrote:> On Tue, Jul 1, 2014 at 9:17 AM, Steve Ballantyne > <steve.ballantyne at gmail.com> wrote: >> How would I go about providing you this stuff? Can you point me to >> something that would help trace out the USB data?Tracing the data on Windows is not my speciality, but there are a few messages in the NUT archives (can't remember whether nut-upsdev or -upsuser, but the search form at http://www.networkupstools.org/support.html hits both). The basic idea is to configure the USB sniffer software to monitor your UPS, then you would take notes on what the Windows software reports as you do a similar test to what you posted. A few people have done this by running Windows in a VM, and monitoring on the Linux host side. Others have installed the sniffer software into Windows itself. The details are going to depend on what you find to be a more palatable challenge. The free Windows sniffer software is mostly from the XP era, so with a newer OS, YMMV. I don't know if the serial port will be easier or harder to deal with.> I thought I would try to make sense of the ups.debug data. All I have > really figured out is that the fourth hex segment for S is a 00 for > plugged in and a 01 for on-battery. Which the driver already knows. > The rest is a mystery to me. But I played around with unplugging and > running the load down, and then recharging, etc. Here are my notes > and observations. NC = "no change". I am assuming that those fields > are the make/model/serial number, etc. > > S fourth segment = 00 for on-power, 01 for on-batteryHow far down did you let the battery go? I don't usually recommend running it down all the way very often, but it would be good to do that at least once to verify the LB flag. On yours, I think that would look like "S: 00 ..." The "01 04" seems to be the state before a self-test on yours as well as on the ASCII version of the SMARTPRO protocol. See comments around "switch(s_value_2) {" in the source code.> UNPLUGD a while > ups.debug.D: 00 00 00 7d 0d 00 00 '.......' <---- 4th segment = 125Looks like the first pairs of digits are the input voltage, and "00 7d" = 125V out.> ups.debug.L: 06 00 00 07 58 58 0d '....XX.' <---- 1st segment = 6Not sure, but I have a feeling that one of 06 or 07 is a percent load. Lots of good progress here! I tried to enable a few more commands for your model. For instance, the "M" values seem to be min/max voltage, so there is a "reset.input.minmax" command to use with upscmd. Also, you can trigger a battery test with "test.battery.start". I assume the work the same way as on Protocol 3003 :-) The attached patch is meant to be applied on top of the previous patch. If it's easier, I can diff it against Git master. -------------- next part -------------- A non-text attachment was scrubbed... Name: tripplite_3005_v0.25.patch Type: text/x-patch Size: 5835 bytes Desc: not available URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20140701/8ef0bd26/attachment-0001.bin>