Hi Danilo,<br><br>this mail is for Arjen:<br>I&#39;ve not gone through this thread, but is there any reason not to commit this patch (ie issues with phoenix that need more work)?<br><br>cheers,<br>Arno<br><br><div class="gmail_quote">
2011/4/14 Danilo Godec <span dir="ltr">&lt;<a href="mailto:danilo.godec@agenda.si">danilo.godec@agenda.si</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


  
    
  
  <div bgcolor="#ffffff" text="#000000">
    Looking at &#39;man blazer&#39; 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>
              driver = blazer_usb<br>
              port = /dev/ttyS0<br>
              vendorid = 14f0<br>
              productid = 00c9<br>
              subdriver = phoenix<br>
              desc = &quot;Local UPS&quot;<br>
    </blockquote>
    <br>
    That worked!<br>
    <br>
    So I added this to &#39;drivers/blazer_ups.c&#39;:<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      2010-12-24
      14:24:29.000000000 +0100<br>
      +++ nut-2.6.0-new/drivers/blazer_usb.c  2011-04-14
      13:59:17.074896771 +0200<br>
      @@ -294,6 +294,12 @@<br>
              return NULL;<br>
       }<br>
      <br>
      +static void *phoenix_subdriver(void)<br>
      +{<br>
      +       subdriver_command = &amp;phoenix_command;<br>
      +       return NULL;<br>
      +}<br>
      +<br>
      <br>
       static usb_device_id_t blazer_usb_id[] = {<br>
              { USB_DEVICE(0x05b8, 0x0000), &amp;cypress_subdriver
      },     /* Agiler UPS */<br>
      @@ -302,6 +308,7 @@<br>
              { USB_DEVICE(0x0665, 0x5161), &amp;cypress_subdriver
      },     /* Belkin F6C1200-UNV */<br>
              { USB_DEVICE(0x06da, 0x0003), &amp;ippon_subdriver
      },       /* Mustek Powermust */<br>
              { USB_DEVICE(0x0f03, 0x0001), &amp;cypress_subdriver
      },     /* Unitek Alpha 1200Sx */<br>
      +       { USB_DEVICE(0x14f0, 0x00c9), &amp;phoenix_subdriver
      },     /* GE EP series */<br>
              /* end of list */<br>
              {-1, -1, NULL}<br>
       };</blockquote>
    <br>
    Now I don&#39;t need to add &#39;vendorid&#39;, &#39;productid&#39; and &#39;subdriver&#39;
    options to ups.conf and it still works! :)<br><font color="#888888">
    <br>
     Danilo<br>
    </font><br>
    PS: Mind you - I&#39;m no programmer so all this is mostly guesswork...
    :)<div><div></div><div class="h5"><br>
    <br>
    <br>
    <br>
    <br>
    On 04/14/2011 11:38 AM, Danilo Godec wrote:
    <blockquote type="cite">
      
      Now I&#39;m trying to get it working with USB (the UPS has both and
      it&#39;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, &#39;dmesg&#39; 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>
              driver = blazer_usb<br>
              port = /dev/usb/hiddev0<br>
              desc = &quot;Local UPS&quot;<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&#39;t open USB device /dev/bus/usb/001/001: Permission
      denied.<br>
      libusb requires write access to USB device nodes.<br>
      libusb couldn&#39;t open USB device /dev/bus/usb/002/001: Permission
      denied.<br>
      libusb requires write access to USB device nodes.<br>
      libusb couldn&#39;t open USB device /dev/bus/usb/003/001: Permission
      denied.<br>
      libusb requires write access to USB device nodes.<br>
      libusb couldn&#39;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 &#39;/etc/udev/rules.d/52-nut-usbups.rules&#39;:<br>
      <br>
      # GE EP series<br>
      ATTR{idVendor}==&quot;14f0&quot;, ATTR{idProduct}==&quot;00c9&quot;, MODE=&quot;664&quot;,
      GROUP=&quot;daemon&quot;<br>
      <br>
      I also edited the &#39;blazer_usb.c&#39; file and added this:<br>
      <br>
             { USB_DEVICE(0x14f0, 0x00c9), &amp;krauler_subdriver },    
      /* GE EP series */<br>
      <br>
      (also tried other subdrivers - cypress, ippon, ...).<br>
      <br>
      I also manually change permissions on &#39;/dev/bus/usb/*/*&#39; to 666,
      but it also didn&#39;t help.<br>
      <br>
      Anything else to try?<br>
      <br>
      <br>
        Danilo<br>
      <br>
      <br>
      <br>
      On 04/13/2011 12:39 AM, Danilo Godec wrote:
      <blockquote type="cite">
        
        
        The short story - it seems that GE EP series is (somewhat)
        supported by the <b>blazer_ser</b> driver (haven&#39;t tried the
        USB connection yet). I had to use the &#39;cablepower = none&#39; option
        as GE only uses TX and RX.<br>
        <br>
        <br>
        The longer story - I &#39;sniffed&#39; the RS232 communication between
        the GE supplied Java software &#39;upspilot&#39; 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 &#39;minicom&#39; 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&#39;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 &#39;de-compiling&#39; all .class files and
        using &#39;grep&#39; I searched for these commands.<br>
        <br>
        There is a file named &#39;UpsProt.class&#39;, which (de-compiled)
        contains this:<br>
        <br>
        /*  25 */     Santak1Class.command[0] = &quot;Q&quot;;<br>
        /*  30 */     Santak1Class.command[1] = &quot;Q1&quot;;<br>
        /*  35 */     Santak1Class.command[2] = &quot;Q4&quot;;<br>
        /*  40 */     Santak1Class.command[3] = &quot;QF&quot;;<br>
        /*  45 */     Santak1Class.command[4] = &quot;MD&quot;;<br>
        /*  50 */     Santak1Class.command[5] = &quot;QP&quot;;<br>
        /*  55 */     Santak1Class.command[6] = &quot;PSmGnLpHqExxxxDxxx&quot;;<br>
        /*  60 */     Santak1Class.command[7] = &quot;PF&quot;;<br>
        /*  65 */     Santak1Class.command[8] = &quot;T&quot;;<br>
        /*  70 */     Santak1Class.command[9] = &quot;TL&quot;;<br>
        /*  75 */     Santak1Class.command[10] = &quot;T&quot;;<br>
        /*  80 */     Santak1Class.command[11] = &quot;S&quot;;<br>
        /*  85 */     Santak1Class.command[12] = &quot;SR&quot;;<br>
        /*  90 */     Santak1Class.command[13] = &quot;C&quot;;<br>
        /*  95 */     Santak1Class.command[14] = &quot;CT&quot;;<br>
        /* 100 */     Santak1Class.command[15] = &quot;CB&quot;;<br>
        /* 105 */     Santak1Class.command[16] = &quot;PE&quot;;<br>
        /* 110 */     Santak1Class.command[17] = &quot;PD&quot;;<br>
        /* 116 */     Santak1Class.command[18] = &quot;QMT&quot;;<br>
        /* 122 */     Santak1Class.command[19] = &quot;F&quot;;<br>
        /* 128 */     Santak1Class.command[20] = &quot;WH&quot;;<br>
        /* 134 */     Santak1Class.command[21] = &quot;Q2&quot;;<br>
        /* 140 */     Santak1Class.command[22] = &quot;WA&quot;;<br>
        /* 145 */     Santak1Class.command[23] = &quot;WH&quot;;<br>
        /* 150 */     Santak1Class.command[24] = &quot;QA&quot;;<br>
        /* 156 */     Santak1Class.command[25] = &quot;FLT&quot;;<br>
        /* 162 */     Santak1Class.command[26] = &quot;FLT,00&quot;;<br>
        /* 170 */     Santak1Class.command[27] = &quot;QS&quot;;<br>
        /* 176 */     Santak1Class.command[28] = &quot;CTL&quot;;<br>
        /* 182 */     Santak1Class.command[29] = &quot;LT?&quot;;<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 &#39;blazer_ser&#39; pretty much does what it&#39;s supposed to
        do. Also most of the &#39;upsc&#39; output looks reasonable:<br>
        <br>
        battery.voltage: 252.00<br>
        battery.voltage.nominal: 240.0<br>
        beeper.status: disabled<br>
        device.type: ups<br>
        <a href="http://driver.name" target="_blank">driver.name</a>: 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>
              Danilo<br>
        <br>
        <pre><fieldset></fieldset>
_______________________________________________
Nut-upsuser mailing list
<a href="mailto:Nut-upsuser@lists.alioth.debian.org" target="_blank">Nut-upsuser@lists.alioth.debian.org</a>
<a href="http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser</a></pre>
      </blockquote>
      <br>
      <br>
      <pre cols="72">-- 
Danilo Godec, sistemska podpora / system administration

Predlog! Obiscite prenovljeno spletno stran <a href="http://www.agenda.si" target="_blank">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 href="http://www.agenda.si" target="_blank">www.agenda.si</a> 

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

Predlog! Obiscite prenovljeno spletno stran <a href="http://www.agenda.si" target="_blank">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 href="http://www.agenda.si" target="_blank">www.agenda.si</a> 

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

<br>_______________________________________________<br>
Nut-upsuser mailing list<br>
<a href="mailto:Nut-upsuser@lists.alioth.debian.org">Nut-upsuser@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser</a><br></blockquote></div><br>