Anthony J. Ciani
2006-Oct-11 21:33 UTC
[Nut-upsuser] Adding TrippLite SMART550 / Protocol 2001 Support
I have added preliminary support for the TrippLite protocol number 2001 into tripplite_usb.c. The attached file is supplied as a patch against today's SVN. This patch adds support for TrippLite SMART550USB and some Omni models. Tested are On Line, On Battery, Battery Good, and Battery Bad indication. Everything else seems to work, but this UPS is attached to a critical system, and I can only do limited testing. As an aside, tripplite_usb.c seems to need nut ownership of /proc/bus/XXX/YYY in order to work, as opposed to /dev/hid/hiddevX. It would be nice to get this "fixed". ------------------------------------------------------------ Anthony Ciani (aciani1@uic.edu) Computational Condensed Matter Physics Department of Physics, University of Illinois, Chicago http://ciani.phy.uic.edu/~tony ------------------------------------------------------------ -------------- next part -------------- --- nut.20061011/drivers/tripplite_usb.c 2006-10-11 14:51:04.000000000 -0500 +++ nut.20061004/drivers/tripplite_usb.c 2006-10-04 20:41:57.000000000 -0500 @@ -243,7 +243,8 @@ #include <math.h> #include <ctype.h> -static enum tl_model_t { TRIPP_LITE_UNKNOWN = 0, TRIPP_LITE_OMNIVS, TRIPP_LITE_SMARTPRO } +static enum tl_model_t { TRIPP_LITE_UNKNOWN = 0, TRIPP_LITE_OMNIVS, TRIPP_LITE_OMNIVS2, +TRIPP_LITE_SMARTPRO} tl_model = TRIPP_LITE_UNKNOWN; /*!@brief If a character is not printable, return a dot. */ @@ -387,6 +388,9 @@ case 0x1001: upslogx(3, "Using OMNIVS protocol (%x)", proto); return TRIPP_LITE_OMNIVS; + case 0x2001: + upslogx(3, "Using OMNIVS2 protocol (%x)", proto); + return TRIPP_LITE_OMNIVS2; case 0x3003: upslogx(3, "Using SMARTPRO protocol (%x)", proto); return TRIPP_LITE_SMARTPRO; @@ -861,7 +865,7 @@ return; } - if(tl_model != TRIPP_LITE_OMNIVS) { + if(tl_model != TRIPP_LITE_OMNIVS && tl_model != TRIPP_LITE_OMNIVS2) { dstate_setinfo("ups.debug.S","%s", hexascdump(s_value+1, 7)); } @@ -893,6 +897,44 @@ } } + + if(tl_model == TRIPP_LITE_OMNIVS2) { + switch(s_value[2]) { + case '0': + dstate_setinfo("battery.test.status", "Battery OK"); + break; + case '1': + dstate_setinfo("battery.test.status", "Battery bad - replace"); + break; + case '2': + status_set("CAL"); + break; + case '3': + status_set("OVER"); + dstate_setinfo("battery.test.status", "Overcurrent?"); + break; + case '4': + /* The following message is confusing, and may not be accurate: */ + /* dstate_setinfo("battery.test.status", "Battery state unknown"); */ + break; + case '5': + status_set("OVER"); + dstate_setinfo("battery.test.status", "Battery fail - overcurrent?"); + break; + default: + upslogx(LOG_ERR, "Unknown value for s[2]: 0x%02x", s_value[2]); + dstate_datastale(); + break; + } + + /* Online/on battery: */ + if(s_value[4] & 1) { + status_set("OB"); + } else { + status_set("OL"); + } + } + if(tl_model == TRIPP_LITE_SMARTPRO) { switch(s_value[2]) { case '0': @@ -949,7 +991,7 @@ status_commit(); - if( tl_model == TRIPP_LITE_OMNIVS ) { + if( tl_model == TRIPP_LITE_OMNIVS || tl_model == TRIPP_LITE_OMNIVS2 ) { ret = send_cmd(b_msg, sizeof(b_msg), b_value, sizeof(b_value)); if(ret <= 0) { dstate_datastale(); @@ -1037,6 +1079,7 @@ switch(tl_model) { case TRIPP_LITE_OMNIVS: + case TRIPP_LITE_OMNIVS2: dstate_setinfo("output.voltage", "%.1f", hex2d(l_value+1, 4)/2.0); break; case TRIPP_LITE_SMARTPRO: @@ -1047,7 +1090,7 @@ break; } - if(tl_model != TRIPP_LITE_OMNIVS) { + if(tl_model != TRIPP_LITE_OMNIVS && tl_model != TRIPP_LITE_OMNIVS2) { debug_message("D", 2); debug_message("V", 2);
Charles Lepple
2006-Oct-13 03:59 UTC
[Nut-upsuser] Adding TrippLite SMART550 / Protocol 2001 Support
On 10/11/06, Anthony J. Ciani <aciani1@uic.edu> wrote:> I have added preliminary support for the TrippLite protocol number 2001 > into tripplite_usb.c. The attached file is supplied as a patch against > today's SVN. > > This patch adds support for TrippLite SMART550USB and some Omni models. > > Tested are On Line, On Battery, Battery Good, and Battery Bad indication. > Everything else seems to work, but this UPS is attached to a critical > system, and I can only do limited testing.Cool!> As an aside, tripplite_usb.c seems to need nut ownership of > /proc/bus/XXX/YYY in order to work, as opposed to /dev/hid/hiddevX. It > would be nice to get this "fixed".The hiddev interface is not portable to other OSes, so we use libusb instead. (See the nut-upsdev archives for more info on hiddev.) We are slowly adding hotplug and udev rules for all of the NUT-supported devices, and we should be able to change permissions for the TrippLite UPSes with those rules. -- - Charles Lepple
Charles Lepple
2006-Oct-20 02:40 UTC
[Nut-upsuser] Adding TrippLite SMART550 / Protocol 2001 Support
On 10/11/06, Anthony J. Ciani <aciani1@uic.edu> wrote:> I have added preliminary support for the TrippLite protocol number 2001 > into tripplite_usb.c. The attached file is supplied as a patch against > today's SVN. > > This patch adds support for TrippLite SMART550USB and some Omni models.I merged this into SVN as rev 556. There are also a few updates to the way that the protocol is reported, to help others figure out what works with their UPS.> Tested are On Line, On Battery, Battery Good, and Battery Bad indication. > Everything else seems to work, but this UPS is attached to a critical > system, and I can only do limited testing.If you (or anyone else reading this) gets a chance to test the low-battery status, that would wrap up the basic testing.> As an aside, tripplite_usb.c seems to need nut ownership of > /proc/bus/XXX/YYY in order to work, as opposed to /dev/hid/hiddevX. It > would be nice to get this "fixed".I looked into this, and if you put the nut-usbups.rules file in /etc/udev/rules.d (as tested on Ubuntu Dapper), it should change the group of the node when you plug the UPS in. Other distributions will likely have slightly different ways of accomplishing this. -- - Charles Lepple
Maybe Matching Threads
- Tripp Lite SMART3000RM2U (protocol 3003) running time and charge?
- Tripp Lite SMART3000RM2U (protocol 3003) running time and charge?
- Tripp Lite SMART3000RM2U (protocol 3003) running time and charge?
- Tripplite_usb
- Tripp Lite SMART3000RM2U (protocol 3003) running time and charge?