<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Looking at 'man blazer' I found out that there is a fourth subdriver
    - phoenix. Guess what - it works!<br>
    <br>
    First I changed my ups.conf to:<br>
    <blockquote type="cite">[myups]<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; driver = blazer_usb<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; port = /dev/ttyS0<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vendorid = 14f0<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; productid = 00c9<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; subdriver = phoenix<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; desc = "Local UPS"<br>
    </blockquote>
    <br>
    That worked!<br>
    <br>
    So I added this to 'drivers/blazer_ups.c':<br>
    <br>
    <blockquote type="cite">diff -Nur nut-2.6.0/drivers/blazer_usb.c
      nut-2.6.0-new/drivers/blazer_usb.c<br>
      --- nut-2.6.0/drivers/blazer_usb.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2010-12-24
      14:24:29.000000000 +0100<br>
      +++ nut-2.6.0-new/drivers/blazer_usb.c&nbsp; 2011-04-14
      13:59:17.074896771 +0200<br>
      @@ -294,6 +294,12 @@<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<br>
      &nbsp;}<br>
      <br>
      +static void *phoenix_subdriver(void)<br>
      +{<br>
      +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; subdriver_command = &amp;phoenix_command;<br>
      +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<br>
      +}<br>
      +<br>
      <br>
      &nbsp;static usb_device_id_t blazer_usb_id[] = {<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { USB_DEVICE(0x05b8, 0x0000), &amp;cypress_subdriver
      },&nbsp;&nbsp;&nbsp;&nbsp; /* Agiler UPS */<br>
      @@ -302,6 +308,7 @@<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { USB_DEVICE(0x0665, 0x5161), &amp;cypress_subdriver
      },&nbsp;&nbsp;&nbsp;&nbsp; /* Belkin F6C1200-UNV */<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { USB_DEVICE(0x06da, 0x0003), &amp;ippon_subdriver
      },&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Mustek Powermust */<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { USB_DEVICE(0x0f03, 0x0001), &amp;cypress_subdriver
      },&nbsp;&nbsp;&nbsp;&nbsp; /* Unitek Alpha 1200Sx */<br>
      +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { USB_DEVICE(0x14f0, 0x00c9), &amp;phoenix_subdriver
      },&nbsp;&nbsp;&nbsp;&nbsp; /* GE EP series */<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* end of list */<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {-1, -1, NULL}<br>
      &nbsp;};</blockquote>
    <br>
    Now I don't need to add 'vendorid', 'productid' and 'subdriver'
    options to ups.conf and it still works! :)<br>
    <br>
    &nbsp;Danilo<br>
    <br>
    PS: Mind you - I'm no programmer so all this is mostly guesswork...
    :)<br>
    <br>
    <br>
    <br>
    <br>
    On 04/14/2011 11:38 AM, Danilo Godec wrote:
    <blockquote cite="mid:4DA6C0A7.30702@agenda.si" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      Now I'm trying to get it working with USB (the UPS has both and
      it's getting harder to find machines with serial ports) - if it
      works with <b>blazer_ser</b>, should it also work with <b>blazer_usb</b>?<br>
      <br>
      When I plug the USB in, 'dmesg' shows this:<br>
      <br>
      <blockquote type="cite">[68527.748033] usb 4-1: new low speed USB
        device using uhci_hcd and address 3<br>
        [68527.922036] usb 4-1: New USB device found, idVendor=14f0,
        idProduct=00c9<br>
        [68527.922048] usb 4-1: New USB device strings: Mfr=3,
        Product=1, SerialNumber=0<br>
        [68527.922058] usb 4-1: Product: GE EP series UPS<br>
        [68527.922065] usb 4-1: Manufacturer: GE<br>
        [68527.922217] usb 4-1: configuration #1 chosen from 1 choice<br>
        [68527.939208] generic-usb 0003:14F0:00C9.0002: hiddev0,hidraw0:
        USB HID v1.11 Device [GE GE EP series UPS] on
        usb-0000:00:1d.2-1/input0</blockquote>
      <br>
      and <b>/dev/usb/hiddev0</b> appears.<br>
      <br>
      So I tried with this:<br>
      <br>
      [myups]<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; driver = blazer_usb<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; port = /dev/usb/hiddev0<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; desc = "Local UPS"<br>
      <br>
      <b>/usr/lib/ups/driver/blazer_usb -a myups</b><br>
      Network UPS Tools - Megatec/Q1 protocol USB driver 0.03 (2.6.0)<br>
      libusb couldn't open USB device /dev/bus/usb/001/001: Permission
      denied.<br>
      libusb requires write access to USB device nodes.<br>
      libusb couldn't open USB device /dev/bus/usb/002/001: Permission
      denied.<br>
      libusb requires write access to USB device nodes.<br>
      libusb couldn't open USB device /dev/bus/usb/003/001: Permission
      denied.<br>
      libusb requires write access to USB device nodes.<br>
      libusb couldn't open USB device /dev/bus/usb/004/001: Permission
      denied.<br>
      libusb requires write access to USB device nodes.<br>
      No supported UPS detected<br>
      <br>
      and <b>/dev/usb/hiddev0</b> disappears.<br>
      <br>
      I added the following to '/etc/udev/rules.d/52-nut-usbups.rules':<br>
      <br>
      # GE EP series<br>
      ATTR{idVendor}=="14f0", ATTR{idProduct}=="00c9", MODE="664",
      GROUP="daemon"<br>
      <br>
      I also edited the 'blazer_usb.c' file and added this:<br>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { USB_DEVICE(0x14f0, 0x00c9), &amp;krauler_subdriver },&nbsp;&nbsp;&nbsp;&nbsp;
      /* GE EP series */<br>
      <br>
      (also tried other subdrivers - cypress, ippon, ...).<br>
      <br>
      I also manually change permissions on '/dev/bus/usb/*/*' to 666,
      but it also didn't help.<br>
      <br>
      Anything else to try?<br>
      <br>
      <br>
      &nbsp; Danilo<br>
      <br>
      <br>
      <br>
      On 04/13/2011 12:39 AM, Danilo Godec wrote:
      <blockquote cite="mid:4DA4D4B5.7060200@agenda.si" type="cite">
        <meta content="text/html; charset=ISO-8859-1"
          http-equiv="Content-Type">
        <title></title>
        The short story - it seems that GE EP series is (somewhat)
        supported by the <b>blazer_ser</b> driver (haven't tried the
        USB connection yet). I had to use the 'cablepower = none' option
        as GE only uses TX and RX.<br>
        <br>
        <br>
        The longer story - I 'sniffed' the RS232 communication between
        the GE supplied Java software 'upspilot' and UPS. From that I
        found out the baud rate (2400) and I learned about a couple of
        commands (not knowing what they mean):<br>
        <ul>
          <li>CB24</li>
          <li>WH</li>
          <li>Q1</li>
          <li>Q4</li>
          <li>Q7<br>
          </li>
          <li>QS</li>
          <li>...</li>
        </ul>
        Then I user 'minicom' to try these commands out and this is what
        I got:<br>
        <br>
        Q1 -&gt; (232.0 140.0 220.0 001 50.0 2.27 31.0 00000000<br>
        Q4 -&gt; (232.0 243.0 000.0 001 220.0 49.9 001 50.0 342 343
        273.0 31.0 LM<br>
        Q7 -&gt; 07102218014 V_01<br>
        <br>
        OK, I'm getting somewhere - but I have to figure out what all of
        this means. So decide to unpack some .jar files and have a look
        in there. A friend helped by 'de-compiling' all .class files and
        using 'grep' I searched for these commands.<br>
        <br>
        There is a file named 'UpsProt.class', which (de-compiled)
        contains this:<br>
        <br>
        /*&nbsp; 25 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[0] = "Q";<br>
        /*&nbsp; 30 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[1] = "Q1";<br>
        /*&nbsp; 35 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[2] = "Q4";<br>
        /*&nbsp; 40 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[3] = "QF";<br>
        /*&nbsp; 45 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[4] = "MD";<br>
        /*&nbsp; 50 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[5] = "QP";<br>
        /*&nbsp; 55 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[6] = "PSmGnLpHqExxxxDxxx";<br>
        /*&nbsp; 60 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[7] = "PF";<br>
        /*&nbsp; 65 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[8] = "T";<br>
        /*&nbsp; 70 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[9] = "TL";<br>
        /*&nbsp; 75 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[10] = "T";<br>
        /*&nbsp; 80 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[11] = "S";<br>
        /*&nbsp; 85 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[12] = "SR";<br>
        /*&nbsp; 90 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[13] = "C";<br>
        /*&nbsp; 95 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[14] = "CT";<br>
        /* 100 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[15] = "CB";<br>
        /* 105 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[16] = "PE";<br>
        /* 110 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[17] = "PD";<br>
        /* 116 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[18] = "QMT";<br>
        /* 122 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[19] = "F";<br>
        /* 128 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[20] = "WH";<br>
        /* 134 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[21] = "Q2";<br>
        /* 140 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[22] = "WA";<br>
        /* 145 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[23] = "WH";<br>
        /* 150 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[24] = "QA";<br>
        /* 156 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[25] = "FLT";<br>
        /* 162 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[26] = "FLT,00";<br>
        /* 170 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[27] = "QS";<br>
        /* 176 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[28] = "CTL";<br>
        /* 182 */&nbsp;&nbsp;&nbsp;&nbsp; Santak1Class.command[29] = "LT?";<br>
        <br>
        A list of commands but no description. Interestingly, the Q7
        which produces some output is not mentioned. .<br>
        <br>
        Due to my limited programming skills I was soon stuck, so I
        decided to look at Nut drivers source to find out if there are
        any that use similar commands. After a bit of experimenting I
        found that 'blazer_ser' pretty much does what it's supposed to
        do. Also most of the 'upsc' output looks reasonable:<br>
        <br>
        battery.voltage: 252.00<br>
        battery.voltage.nominal: 240.0<br>
        beeper.status: disabled<br>
        device.type: ups<br>
        driver.name: blazer_ser<br>
        driver.parameter.cablepower: none<br>
        driver.parameter.pollinterval: 2<br>
        driver.parameter.port: /dev/ttyS0<br>
        driver.version: 2.6.0<br>
        driver.version.internal: 1.51<br>
        input.current.nominal: 27.0<br>
        input.frequency: 50.0<br>
        input.frequency.nominal: 50<br>
        input.voltage: 236.0<br>
        input.voltage.fault: 140.0<br>
        input.voltage.nominal: 220<br>
        output.voltage: 220.0<br>
        ups.delay.shutdown: 30<br>
        ups.delay.start: 180<br>
        ups.load: 1<br>
        ups.status: OL<br>
        ups.temperature: 31.5<br>
        ups.type: online<br>
        <br>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Danilo<br>
        <br>
        <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Nut-upsuser mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Nut-upsuser@lists.alioth.debian.org">Nut-upsuser@lists.alioth.debian.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser">http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser</a></pre>
      </blockquote>
      <br>
      <br>
      <pre class="moz-signature" cols="72">-- 
Danilo Godec, sistemska podpora / system administration

Predlog! Obiscite prenovljeno spletno stran <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.agenda.si">www.agenda.si</a> 

ODPRTA KODA IN LINUX 
STORITVE : POSLOVNE RESITVE : UPRAVLJANJE IT : INFRASTRUKTURA IT : IZOBRAZEVANJE : PROGRAMSKA OPREMA 

Visit our updated web page at <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.agenda.si">www.agenda.si</a> 

OPEN SOURCE AND LINUX 
SERVICES : BUSINESS SOLUTIONS : IT MANAGEMENT : IT INFRASTRUCTURE : TRAINING : SOFTWARE 
</pre>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Nut-upsuser mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nut-upsuser@lists.alioth.debian.org">Nut-upsuser@lists.alioth.debian.org</a>
<a class="moz-txt-link-freetext" href="http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser">http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser</a></pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Danilo Godec, sistemska podpora / system administration

Predlog! Obiscite prenovljeno spletno stran <a class="moz-txt-link-abbreviated" href="http://www.agenda.si">www.agenda.si</a> 

ODPRTA KODA IN LINUX 
STORITVE : POSLOVNE RESITVE : UPRAVLJANJE IT : INFRASTRUKTURA IT : IZOBRAZEVANJE : PROGRAMSKA OPREMA 

Visit our updated web page at <a class="moz-txt-link-abbreviated" href="http://www.agenda.si">www.agenda.si</a> 

OPEN SOURCE AND LINUX 
SERVICES : BUSINESS SOLUTIONS : IT MANAGEMENT : IT INFRASTRUCTURE : TRAINING : SOFTWARE 
</pre>
  </body>
</html>