Hey all, I ended up picking up the module listed in Subject line. I switched over my config but apparently not all going smoothly. My config is: [office] driver = powerpanel port = /dev/ttyS0 desc = "Office UPS" When I test the driver running power-panel as a test, I get:> [root at cornelius init.d]# powerpanel -a office -D -D -D -D > Network UPS Tools - CyberPower text/binary protocol UPS driver 0.25 (2.6.5) > Warning: This is an experimental driver. > Some features may not function correctly. > > 0.000000 debug level is '4' > 0.011515 Trying binary protocol... > 0.213611 send: (2 bytes) => 46 0d > 0.667149 read: timeout > 0.667192 \_: (0 bytes) => > 0.768409 send: (2 bytes) => 46 0d > 1.223223 read: timeout > 1.223270 \_: (0 bytes) => > 1.324495 send: (2 bytes) => 46 0d > 1.777587 read: timeout > 1.777634 \_: (0 bytes) => > 1.798033 Trying text protocol... > 1.898845 send: (2 bytes) => 0d 0d > 1.999995 read: (3 bytes) => 23 2d 32 > 2.151843 send: (3 bytes) => 50 34 0d > 2.399718 read: (52 bytes) => 23 50 52 31 35 30 30 4c 43 44 52 54 58 4c 32 55 61 20 > 2.399766 20 20 20 2c 34 2e 33 35 30 2c 50 53 55 45 56 32 30 30 30 31 31 33 2c 43 59 > 2.399794 42 45 52 20 50 4f 57 45 52 > 2.399818 CyberPower UPS with text protocol on /dev/ttyS0 detected > 2.551420 send: (3 bytes) => 50 33 0d > 2.703743 read: (29 bytes) => 23 31 32 2c 34 78 31 2c 39 2c 30 30 2c 30 30 35 2c 34 > 2.703786 38 30 2c 31 32 2c 34 78 32 2c 39 > 2.855643 send: (3 bytes) => 50 32 0d > 2.996719 read: (31 bytes) => 23 31 35 30 30 2c 31 33 35 30 2c 31 32 30 2c 34 37 2c > 2.996765 36 33 2c 31 32 2e 30 2c 35 33 2c 35 37 > 3.148635 send: (3 bytes) => 50 31 0d > 3.249251 read: (21 bytes) => 23 31 32 30 2c 31 35 30 2c 30 38 30 2c 33 35 2c 30 30 > 3.249287 33 30 30 > 3.401125 send: (3 bytes) => 50 36 0d > 3.615723 read: (44 bytes) => 23 31 34 30 2c 31 34 31 2c 31 34 32 2c 31 34 33 2c 31 > 3.615799 34 34 2c 31 34 35 2c 31 34 36 2c 31 34 37 2c 31 34 38 2c 31 34 39 2c 31 35 > 3.615823 30 > 3.767688 send: (3 bytes) => 50 37 0d > 3.964712 read: (44 bytes) => 23 30 38 30 2c 30 38 31 2c 30 38 32 2c 30 38 33 2c 30 > 3.964781 38 34 2c 30 38 35 2c 30 38 36 2c 30 38 37 2c 30 38 38 2c 30 38 39 2c 30 39 > 3.964806 30 > 4.116667 send: (3 bytes) => 50 38 0d > 4.256708 read: (30 bytes) => 23 32 30 2c 32 35 2c 33 30 2c 33 35 2c 34 30 2c 34 35 > 4.256746 2c 35 30 2c 35 35 2c 36 30 2c 36 35 > 4.408610 send: (3 bytes) => 50 35 0d > 4.509005 read: (3 bytes) => 23 2d 32 > 4.660827 send: (3 bytes) => 50 39 0d > 4.761975 read: (4 bytes) => 23 d5 df f0 > 4.863075 send: (2 bytes) => 43 0d > 4.964149 read: (2 bytes) => 23 30 > 5.064982 send: (2 bytes) => 44 0d > 5.266667 read: (35 bytes) => 23 49 31 31 39 2e 30 4f 31 31 39 2e 30 4c 30 31 38 42 > 5.266710 31 30 30 54 30 32 37 48 30 36 30 2e 30 46 30 36 30 > 5.266834 Parsing status string failed > 5.266876 Communications with UPS lost: Status read failed! > 5.267201 dstate_init: sock /var/run/nut/powerpanel-office open on fd 5 > 5.368488 send: (2 bytes) => 44 0d > 5.569134 read: (35 bytes) => c0 88 80 57 00 81 0d 23 49 31 32 30 2e 30 4f 31 32 30 > 5.569183 2e 30 4c 30 31 38 42 31 30 30 54 30 32 37 48 30 36 > 5.569208 Parsing status string failed > 5.569231 Communications with UPS lost: Status read failed! > 7.374181 send: (2 bytes) => 44 0d > 7.575264 read: (35 bytes) => 23 49 31 32 30 2e 30 4f 31 32 30 2e 30 4c 30 31 38 42 > 7.575313 31 30 30 54 30 32 37 48 30 36 30 2e 30 46 30 36 30 > 7.575351 Parsing status string failed > 7.575377 Communications with UPS lost: Status read failed!Maybe better off just switching to different driver? (is the USBHID worth using?) I'm running CentOS 6.7 on this system. not sure if the gnome USB UPS drivers are installed. (meh) Thanks, -Ben
BTW, I did a run with a higher debug level that resulted with this...> [root at cornelius ups]# powerpanel -a office -D -D -D -D -D -D -D -D > Network UPS Tools - CyberPower text/binary protocol UPS driver 0.25 (2.6.5) > Warning: This is an experimental driver. > Some features may not function correctly. > > 0.000000 debug level is '8' > 0.011347 Trying text protocol... > 0.112558 send: (2 bytes) => 0d 0d > 0.213400 read: (3 bytes) => 23 2d 32 > 0.365066 send: (3 bytes) => 50 34 0d > 0.608547 read: (52 bytes) => 23 50 52 31 35 30 30 4c 43 44 52 54 58 4c 32 55 61 20 > 0.608592 20 20 20 2c 34 2e 33 35 30 2c 50 53 55 45 56 32 30 30 30 31 31 33 2c 43 59 > 0.608620 42 45 52 20 50 4f 57 45 52 > 0.608645 CyberPower UPS with text protocol on /dev/ttyS0 detected > 0.608679 send_to_all: SETINFO device.type "ups" > 0.608709 send_to_all: SETINFO driver.version "2.6.5" > 0.608761 send_to_all: SETINFO driver.version.internal "0.25" > 0.608790 send_to_all: SETINFO driver.name "powerpanel" > 0.608818 send_to_all: SETINFO ups.mfr "CyberPower" > 0.608845 send_to_all: SETINFO ups.model "[unknown]" > 0.608873 send_to_all: SETINFO ups.serial "[unknown]" > 0.608901 send_to_all: SETINFO ups.delay.start "60" > 0.608929 send_to_all: SETINFO ups.delay.shutdown "60" > 0.608959 send_to_all: SETINFO ups.model "PR1500LCDRTXL2Ua" > 0.608987 send_to_all: SETINFO ups.firmware "4.350" > 0.609016 send_to_all: SETINFO ups.serial "PSUEV2000113" > 0.609043 send_to_all: SETINFO ups.mfr "CYBER POWER" > 0.760850 send: (3 bytes) => 50 33 0d > 0.912565 read: (29 bytes) => 23 31 32 2c 34 78 31 2c 39 2c 30 30 2c 30 30 35 2c 34 > 0.912607 38 30 2c 31 32 2c 34 78 32 2c 39 > 0.912664 send_to_all: SETINFO battery.voltage.nominal "12" > 0.912696 send_to_all: SETINFO battery.packs "4" > 0.912727 send_to_all: SETINFO battery.capacity "9" > 1.064328 send: (3 bytes) => 50 32 0d > 1.205572 read: (31 bytes) => 23 31 35 30 30 2c 31 33 35 30 2c 31 32 30 2c 34 37 2c > 1.205621 36 33 2c 31 32 2e 30 2c 35 33 2c 35 37 > 1.205659 send_to_all: SETINFO ups.power.nominal "1500" > 1.205710 send_to_all: SETINFO ups.realpower.nominal "1350" > 1.205741 send_to_all: SETINFO input.voltage.nominal "120" > 1.205770 send_to_all: SETINFO input.frequency.low "47" > 1.205799 send_to_all: SETINFO input.frequency.high "63" > 1.357356 send: (3 bytes) => 50 31 0d > 1.458526 read: (21 bytes) => 23 31 32 30 2c 31 35 30 2c 30 38 30 2c 33 35 2c 30 30 > 1.458557 33 30 30 > 1.458596 send_to_all: SETINFO input.transfer.high "150" > 1.458626 send_to_all: SETINFO input.transfer.low "80" > 1.458655 send_to_all: SETINFO battery.charge.low "35" > 1.458680 send_to_all: ADDCMD test.battery.start.quick > 1.458705 send_to_all: ADDCMD test.battery.stop > 1.458730 send_to_all: ADDCMD beeper.enable > 1.458754 send_to_all: ADDCMD beeper.disable > 1.458778 send_to_all: ADDCMD beeper.on > 1.458802 send_to_all: ADDCMD beeper.off > 1.458826 send_to_all: ADDCMD shutdown.stop > 1.610423 send: (3 bytes) => 50 36 0d > 1.823554 read: (44 bytes) => 23 31 34 30 2c 31 34 31 2c 31 34 32 2c 31 34 33 2c 31 > 1.823599 34 34 2c 31 34 35 2c 31 34 36 2c 31 34 37 2c 31 34 38 2c 31 34 39 2c 31 35 > 1.823622 30 > 1.823650 send_to_all: SETFLAGS input.transfer.high RW > 1.823682 send_to_all: ADDENUM input.transfer.high "140" > 1.823711 send_to_all: ADDENUM input.transfer.high "141" > 1.823740 send_to_all: ADDENUM input.transfer.high "142" > 1.823768 send_to_all: ADDENUM input.transfer.high "143" > 1.823796 send_to_all: ADDENUM input.transfer.high "144" > 1.823824 send_to_all: ADDENUM input.transfer.high "145" > 1.823853 send_to_all: ADDENUM input.transfer.high "146" > 1.823881 send_to_all: ADDENUM input.transfer.high "147" > 1.823909 send_to_all: ADDENUM input.transfer.high "148" > 1.823938 send_to_all: ADDENUM input.transfer.high "149" > 1.823966 send_to_all: ADDENUM input.transfer.high "150" > 1.975763 send: (3 bytes) => 50 37 0d > 2.174605 read: (44 bytes) => 23 30 38 30 2c 30 38 31 2c 30 38 32 2c 30 38 33 2c 30 > 2.174662 38 34 2c 30 38 35 2c 30 38 36 2c 30 38 37 2c 30 38 38 2c 30 38 39 2c 30 39 > 2.174685 30 > 2.174714 send_to_all: SETFLAGS input.transfer.low RW > 2.174748 send_to_all: ADDENUM input.transfer.low "80" > 2.174778 send_to_all: ADDENUM input.transfer.low "81" > 2.174807 send_to_all: ADDENUM input.transfer.low "82" > 2.174835 send_to_all: ADDENUM input.transfer.low "83" > 2.174864 send_to_all: ADDENUM input.transfer.low "84" > 2.174893 send_to_all: ADDENUM input.transfer.low "85" > 2.174921 send_to_all: ADDENUM input.transfer.low "86" > 2.174950 send_to_all: ADDENUM input.transfer.low "87" > 2.174979 send_to_all: ADDENUM input.transfer.low "88" > 2.175007 send_to_all: ADDENUM input.transfer.low "89" > 2.175036 send_to_all: ADDENUM input.transfer.low "90" > 2.326799 send: (3 bytes) => 50 38 0d > 2.465560 read: (30 bytes) => 23 32 30 2c 32 35 2c 33 30 2c 33 35 2c 34 30 2c 34 35 > 2.465602 2c 35 30 2c 35 35 2c 36 30 2c 36 35 > 2.465632 send_to_all: SETFLAGS battery.charge.low RW > 2.465663 send_to_all: ADDENUM battery.charge.low "20" > 2.465692 send_to_all: ADDENUM battery.charge.low "25" > 2.465720 send_to_all: ADDENUM battery.charge.low "30" > 2.465748 send_to_all: ADDENUM battery.charge.low "35" > 2.465776 send_to_all: ADDENUM battery.charge.low "40" > 2.465804 send_to_all: ADDENUM battery.charge.low "45" > 2.465832 send_to_all: ADDENUM battery.charge.low "50" > 2.465860 send_to_all: ADDENUM battery.charge.low "55" > 2.465888 send_to_all: ADDENUM battery.charge.low "60" > 2.465916 send_to_all: ADDENUM battery.charge.low "65" > 2.617248 send: (3 bytes) => 50 35 0d > 2.718390 read: (3 bytes) => 23 2d 32 > 2.870104 send: (3 bytes) => 50 39 0d > 2.971248 read: (4 bytes) => 23 d5 df f0 > 3.072351 send: (2 bytes) => 43 0d > 3.173541 read: (2 bytes) => 23 30 > 3.173590 send_to_all: ADDCMD shutdown.return > 3.173617 send_to_all: ADDCMD shutdown.stayoff > 3.173642 send_to_all: ADDCMD shutdown.reboot > 3.274849 send: (2 bytes) => 44 0d > 3.475293 read: (35 bytes) => 23 49 31 31 39 2e 30 4f 31 31 39 2e 30 4c 30 31 39 42 > 3.475341 31 30 30 54 30 32 37 48 30 36 30 2e 30 46 30 36 30 > 3.475409 Parsing status string failed > 3.475435 Communications with UPS lost: Status read failed! > 3.475717 dstate_init: sock /var/run/nut/powerpanel-office open on fd 5 > 3.475776 send_to_all: SETINFO driver.parameter.pollinterval "2" > 3.475823 send_to_all: SETINFO device.mfr "CYBER POWER" > 3.475856 send_to_all: SETINFO device.model "PR1500LCDRTXL2Ua" > 3.475886 send_to_all: SETINFO device.serial "PSUEV2000113" > 3.577039 send: (2 bytes) => 44 0d > 3.779200 read: (35 bytes) => c0 88 80 57 00 81 0d 23 49 31 31 39 2e 30 4f 31 31 39 > 3.779238 2e 30 4c 30 31 39 42 31 30 30 54 30 32 37 48 30 36 > 3.779263 Parsing status string failed > 3.779286 Communications with UPS lost: Status read failed! > 5.580788 send: (2 bytes) => 44 0d > 5.781504 read: (35 bytes) => 23 49 31 31 39 2e 30 4f 31 31 39 2e 30 4c 30 31 38 42 > 5.781554 31 30 30 54 30 32 37 48 30 36 30 2e 30 46 30 36 30 > 5.781590 Parsing status string failed > 5.781615 Communications with UPS lost: Status read failed!the line that fails looks like: D #I120.0O120.0L018B100T027H060.0F060 Where can I look in the source code for where that's sent and parsed? (perhaps I can assist updating the driver) -Ben
On 2016-01-18 4:56 PM, Ben Kamen wrote:> > the line that fails looks like: > > D > #I120.0O120.0L018B100T027H060.0F060 > > Where can I look in the source code for where that's sent and parsed? (perhaps I can assist updating the driver) > > -Ben > > _______________________________________________I see the problem (I think).... in the file powerp-txt.c in the function powpan_status() /* * WRITE D\r * READ #I119.0O119.0L000B100T027F060.0S..\r * 01234567890123456789012345678901234 * 0 1 2 3 * 01234567890123456789012345678901234 * #I120.0O120.0L018B100T027H060.0F060 * */ The top set response was written into the file -- the bottom set is what I'm getting from the UPS which isn't working... it's a little different. Now to figure out what the parms mean so I can fix the function to maybe handle either string. -Ben
Charles Lepple
2016-Jan-19 00:07 UTC
[Nut-upsuser] NUT support for CyberPower PR1500LCDRTXL2Ua
[please use reply-all to include the list. thanks!] On Jan 18, 2016, at 5:08 PM, Ben Kamen <bkamen at benjammin.net> wrote:> > (is the USBHID worth using?)It's hit-or-miss. I have a different CyberPower unit (no LCD, kind of like a big power strip) and there are some scale issues, similar to this entry: http://buildbot.networkupstools.org/~buildbot/docker-debian-jessie/docs/latest/ddl/Cyber_Power_Systems/PR6000LCDRTXL5U.html Also, there are some permissions issues on the /dev/bus/usb nodes that can be fixed, but they are annoying to track down if your distribution has a bad combination of NUT and udev versions. - - - Sounds like you are on the right track with the text protocol. There are two different sscanf() format strings - it looks like yours follows similar conventions ('I' for input voltage, 'O' for output voltage, etc.). Yours might have been cut off, since it seems like the driver tries to read 35 bytes first, then an additional 23 if it does not succeed. Note that your result does not have 'S', which I would guess is status. -- Charles Lepple clepple at gmail
On 2016-01-18 6:07 PM, Charles Lepple wrote:> [please use reply-all to include the list. thanks!] > > On Jan 18, 2016, at 5:08 PM, Ben Kamen <bkamen at benjammin.net> wrote: >> >> (is the USBHID worth using?) > > - - - > > Sounds like you are on the right track with the text protocol. There are two different sscanf() format strings - it looks like yours follows similar conventions ('I' for input voltage, 'O' for output voltage, etc.). Yours might have been cut off, since it seems like the driver tries to read 35 bytes first, then an additional 23 if it does not succeed. Note that your result does not have 'S', which I would guess is status. >Yea, I'm gonna stick with serial. I think I'm going to re-write this a little maybe so it just waits for the string out the 0x0d so it's a little less length dependent and see. (so the routine still times out - but complains more about incomplete strings than delay of reception.) an ASCII translation mode sure would be nice. Hahahahah.. BRB... -Ben -- Ben Kamen - O.D.T., S.P. ---------------------------------------------------------------------- eMail: ben at benjammin.net http://www.benjammin.net Fortune says: Military secrets are the most fleeting of all. -- Spock, "The Enterprise Incident", stardate 5027.4 - - NOTICE: All legal disclaimers sent to benjammin.net/benkamen.net or any of it's affiliated domains are rendered null and void on receipt of communications and will be handled/considered as such.