[Nut-upsuser] GE EP series UPS
Danilo Godec
danilo.godec at agenda.si
Thu Apr 14 12:19:19 UTC 2011
Looking at 'man blazer' I found out that there is a fourth subdriver -
phoenix. Guess what - it works!
First I changed my ups.conf to:
> [myups]
> driver = blazer_usb
> port = /dev/ttyS0
> vendorid = 14f0
> productid = 00c9
> subdriver = phoenix
> desc = "Local UPS"
That worked!
So I added this to 'drivers/blazer_ups.c':
> diff -Nur nut-2.6.0/drivers/blazer_usb.c
> nut-2.6.0-new/drivers/blazer_usb.c
> --- nut-2.6.0/drivers/blazer_usb.c 2010-12-24 14:24:29.000000000
> +0100
> +++ nut-2.6.0-new/drivers/blazer_usb.c 2011-04-14 13:59:17.074896771
> +0200
> @@ -294,6 +294,12 @@
> return NULL;
> }
>
> +static void *phoenix_subdriver(void)
> +{
> + subdriver_command = &phoenix_command;
> + return NULL;
> +}
> +
>
> static usb_device_id_t blazer_usb_id[] = {
> { USB_DEVICE(0x05b8, 0x0000), &cypress_subdriver }, /*
> Agiler UPS */
> @@ -302,6 +308,7 @@
> { USB_DEVICE(0x0665, 0x5161), &cypress_subdriver }, /*
> Belkin F6C1200-UNV */
> { USB_DEVICE(0x06da, 0x0003), &ippon_subdriver }, /*
> Mustek Powermust */
> { USB_DEVICE(0x0f03, 0x0001), &cypress_subdriver }, /*
> Unitek Alpha 1200Sx */
> + { USB_DEVICE(0x14f0, 0x00c9), &phoenix_subdriver }, /* GE
> EP series */
> /* end of list */
> {-1, -1, NULL}
> };
Now I don't need to add 'vendorid', 'productid' and 'subdriver' options
to ups.conf and it still works! :)
Danilo
PS: Mind you - I'm no programmer so all this is mostly guesswork... :)
On 04/14/2011 11:38 AM, Danilo Godec wrote:
> 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
> *blazer_ser*, should it also work with *blazer_usb*?
>
> When I plug the USB in, 'dmesg' shows this:
>
>> [68527.748033] usb 4-1: new low speed USB device using uhci_hcd and
>> address 3
>> [68527.922036] usb 4-1: New USB device found, idVendor=14f0,
>> idProduct=00c9
>> [68527.922048] usb 4-1: New USB device strings: Mfr=3, Product=1,
>> SerialNumber=0
>> [68527.922058] usb 4-1: Product: GE EP series UPS
>> [68527.922065] usb 4-1: Manufacturer: GE
>> [68527.922217] usb 4-1: configuration #1 chosen from 1 choice
>> [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
>
> and */dev/usb/hiddev0* appears.
>
> So I tried with this:
>
> [myups]
> driver = blazer_usb
> port = /dev/usb/hiddev0
> desc = "Local UPS"
>
> */usr/lib/ups/driver/blazer_usb -a myups*
> Network UPS Tools - Megatec/Q1 protocol USB driver 0.03 (2.6.0)
> libusb couldn't open USB device /dev/bus/usb/001/001: Permission denied.
> libusb requires write access to USB device nodes.
> libusb couldn't open USB device /dev/bus/usb/002/001: Permission denied.
> libusb requires write access to USB device nodes.
> libusb couldn't open USB device /dev/bus/usb/003/001: Permission denied.
> libusb requires write access to USB device nodes.
> libusb couldn't open USB device /dev/bus/usb/004/001: Permission denied.
> libusb requires write access to USB device nodes.
> No supported UPS detected
>
> and */dev/usb/hiddev0* disappears.
>
> I added the following to '/etc/udev/rules.d/52-nut-usbups.rules':
>
> # GE EP series
> ATTR{idVendor}=="14f0", ATTR{idProduct}=="00c9", MODE="664",
> GROUP="daemon"
>
> I also edited the 'blazer_usb.c' file and added this:
>
> { USB_DEVICE(0x14f0, 0x00c9), &krauler_subdriver }, /* GE
> EP series */
>
> (also tried other subdrivers - cypress, ippon, ...).
>
> I also manually change permissions on '/dev/bus/usb/*/*' to 666, but
> it also didn't help.
>
> Anything else to try?
>
>
> Danilo
>
>
>
> On 04/13/2011 12:39 AM, Danilo Godec wrote:
>> The short story - it seems that GE EP series is (somewhat) supported
>> by the *blazer_ser* driver (haven't tried the USB connection yet). I
>> had to use the 'cablepower = none' option as GE only uses TX and RX.
>>
>>
>> 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):
>>
>> * CB24
>> * WH
>> * Q1
>> * Q4
>> * Q7
>> * QS
>> * ...
>>
>> Then I user 'minicom' to try these commands out and this is what I got:
>>
>> Q1 -> (232.0 140.0 220.0 001 50.0 2.27 31.0 00000000
>> Q4 -> (232.0 243.0 000.0 001 220.0 49.9 001 50.0 342 343 273.0 31.0 LM
>> Q7 -> 07102218014 V_01
>>
>> 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.
>>
>> There is a file named 'UpsProt.class', which (de-compiled) contains this:
>>
>> /* 25 */ Santak1Class.command[0] = "Q";
>> /* 30 */ Santak1Class.command[1] = "Q1";
>> /* 35 */ Santak1Class.command[2] = "Q4";
>> /* 40 */ Santak1Class.command[3] = "QF";
>> /* 45 */ Santak1Class.command[4] = "MD";
>> /* 50 */ Santak1Class.command[5] = "QP";
>> /* 55 */ Santak1Class.command[6] = "PSmGnLpHqExxxxDxxx";
>> /* 60 */ Santak1Class.command[7] = "PF";
>> /* 65 */ Santak1Class.command[8] = "T";
>> /* 70 */ Santak1Class.command[9] = "TL";
>> /* 75 */ Santak1Class.command[10] = "T";
>> /* 80 */ Santak1Class.command[11] = "S";
>> /* 85 */ Santak1Class.command[12] = "SR";
>> /* 90 */ Santak1Class.command[13] = "C";
>> /* 95 */ Santak1Class.command[14] = "CT";
>> /* 100 */ Santak1Class.command[15] = "CB";
>> /* 105 */ Santak1Class.command[16] = "PE";
>> /* 110 */ Santak1Class.command[17] = "PD";
>> /* 116 */ Santak1Class.command[18] = "QMT";
>> /* 122 */ Santak1Class.command[19] = "F";
>> /* 128 */ Santak1Class.command[20] = "WH";
>> /* 134 */ Santak1Class.command[21] = "Q2";
>> /* 140 */ Santak1Class.command[22] = "WA";
>> /* 145 */ Santak1Class.command[23] = "WH";
>> /* 150 */ Santak1Class.command[24] = "QA";
>> /* 156 */ Santak1Class.command[25] = "FLT";
>> /* 162 */ Santak1Class.command[26] = "FLT,00";
>> /* 170 */ Santak1Class.command[27] = "QS";
>> /* 176 */ Santak1Class.command[28] = "CTL";
>> /* 182 */ Santak1Class.command[29] = "LT?";
>>
>> A list of commands but no description. Interestingly, the Q7 which
>> produces some output is not mentioned. .
>>
>> 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:
>>
>> battery.voltage: 252.00
>> battery.voltage.nominal: 240.0
>> beeper.status: disabled
>> device.type: ups
>> driver.name: blazer_ser
>> driver.parameter.cablepower: none
>> driver.parameter.pollinterval: 2
>> driver.parameter.port: /dev/ttyS0
>> driver.version: 2.6.0
>> driver.version.internal: 1.51
>> input.current.nominal: 27.0
>> input.frequency: 50.0
>> input.frequency.nominal: 50
>> input.voltage: 236.0
>> input.voltage.fault: 140.0
>> input.voltage.nominal: 220
>> output.voltage: 220.0
>> ups.delay.shutdown: 30
>> ups.delay.start: 180
>> ups.load: 1
>> ups.status: OL
>> ups.temperature: 31.5
>> ups.type: online
>>
>>
>> Danilo
>>
>>
>> _______________________________________________
>> Nut-upsuser mailing list
>> Nut-upsuser at lists.alioth.debian.org
>> http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
>
>
> --
> Danilo Godec, sistemska podpora / system administration
>
> Predlog! Obiscite prenovljeno spletno stran www.agenda.si
>
> ODPRTA KODA IN LINUX
> STORITVE : POSLOVNE RESITVE : UPRAVLJANJE IT : INFRASTRUKTURA IT : IZOBRAZEVANJE : PROGRAMSKA OPREMA
>
> Visit our updated web page at www.agenda.si
>
> OPEN SOURCE AND LINUX
> SERVICES : BUSINESS SOLUTIONS : IT MANAGEMENT : IT INFRASTRUCTURE : TRAINING : SOFTWARE
>
>
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
--
Danilo Godec, sistemska podpora / system administration
Predlog! Obiscite prenovljeno spletno stran www.agenda.si
ODPRTA KODA IN LINUX
STORITVE : POSLOVNE RESITVE : UPRAVLJANJE IT : INFRASTRUKTURA IT : IZOBRAZEVANJE : PROGRAMSKA OPREMA
Visit our updated web page at www.agenda.si
OPEN SOURCE AND LINUX
SERVICES : BUSINESS SOLUTIONS : IT MANAGEMENT : IT INFRASTRUCTURE : TRAINING : SOFTWARE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20110414/435fe8d4/attachment.htm>
More information about the Nut-upsuser
mailing list