[Nut-upsuser] Problems with Unitek Alpha 1000 Ps

Jordi Moreno jmoreno at cim.es
Tue Jan 27 10:47:51 UTC 2009


Arjen de Korte escribió:
> Citeren Jordi Moreno <jmoreno at cim.es>:
> 
>> I'm attaching usbsnoop.log.tgz. I've tried to keep the log as little 
>> as possible, only logging Winpower agent's start.
>>
>> I hope it will help...
> 
> It does. This looks like a Q1/megatec protocol UPS, unlike what I 
> expected based on earlier megatec logs:
> 
> out: 46 0d 4d 6f f1 cf 11 88
>      F  \r
> in : 23 32 33 30 2e 30 20 30 30 30 20 30 31 32 2e 30 20 35 30 2e 30 0d 
> 00 00
>      #  2  3  0  .  0  sp 0  0  0  sp 0  1  2  .  0  sp 5  0  .  0  \r
> 
> out: 51 31 0d 6f f1 cf 11 88
>      Q  1  \r
> in : 28 32 31 36 2e 30 20 32 31 38 2e 30 20 32 31 31 2e 30 20 30 30 30 
> 20 34
>      (  2  1  6  .  0  sp 2  1  8  .  0  sp 2  1  1  .  0  sp 0  0  0  sp 4
>      39 2e 39 20 31 33 2e 36 20 32 34 2e 30 20 30 30 30 30 31 30 30 30 
> 0d 00
>      9  .  9  sp 1  3  .  6  sp 2  4  .  0  sp 0  0  0  0  1  0  0  0  \r
> 
> So based on this log, I would have expected that the UPS would be 
> supported by the megatec_usb driver out of the box. Going back to your 
> first post, it looks like the megatec_usb driver only read the last 8 
> bytes of the answer to the Q1\r command. The reason could be the 
> somewhat dodgy way of reading the reply from the interrupt report in 
> this driver. It really doesn't handle unexpected lengths correctly. 
> Could you try the latest bleeding edge version from the SVN trunk 
> instead? There is a new driver (blazer_usb) that deals with this better.
> 
> Best regards, Arjen

Hi all,

Couldn't test SVN version. After downloading, autoreconf --install gives 
me the following output:

# autoreconf --install
aclocal: macro `NUT_OS_FUNCTIONS' required but not defined
aclocal: configure.in: 65: macro `AM_PROG_CC_C_O' not found in library
autoreconf: aclocal failed with exit status: 1

Maybe I'm missing something... However, I've tried last testing version 
(2.4.0-pre2), because it seems to include the same version of 
blazer_usb.c, blazer.c and blazer.h (checked with diff). At first, it 
seems to detect the UPS properly:

# bin/blazer_usb -a unitek -u root -x vendorid=0665 -x productid=5161 

Network UPS Tools - Megatec/Q1 protocol USB driver 0.02 (2.4.0-pre2)
Supported UPS detected with megatec protocol
Vendor information read in 1 tries

But if I try to send a shutdown command:

# bin/blazer_usb -a unitek -u root -x vendorid=0665 -x productid=5161 -k
Network UPS Tools - Megatec/Q1 protocol USB driver 0.02 (2.4.0-pre2)
Initiating UPS shutdown
instcmd: command [shutdown.return] failed
instcmd: command [shutdown.return] failed
instcmd: command [shutdown.return] failed

And giving more debug information:

# bin/blazer_usb -a unitek -u root -x vendorid=0665 -x productid=5161 
-DDDDD
Network UPS Tools - Megatec/Q1 protocol USB driver 0.02 (2.4.0-pre2)
debug level is '5'
...
Checking device (0665/5161) (003/003)
- VendorID: 0665
- ProductID: 5161
- Manufacturer: WayTech Development(S)
- Product: WayTech USB-RS232 Interface (V1.0)
Baud rate 2400bps
- Serial Number: unknown
- Bus: 003
Trying to match device
Device matches
Trying megatec protocol...
send: Q1
read: (218.0 216.0 187.0 000 49.9 13.6 24.0 00001000
send_to_all: SETINFO input.voltage "218.0"
send_to_all: SETINFO input.voltage.fault "216.0"
send_to_all: SETINFO output.voltage "187.0"
send_to_all: SETINFO ups.load "0"
send_to_all: SETINFO input.frequency "49.9"
send_to_all: SETINFO battery.voltage "13.60"
send_to_all: SETINFO ups.temperature "24.0"
send_to_all: SETINFO beeper.status "disabled"
send_to_all: SETINFO ups.type "offline / line interactive"
send_to_all: SETINFO ups.status "OL"
Status read in 1 tries
Supported UPS detected with megatec protocol
send: F
read: #230.0 000 012.0 50.0
send_to_all: SETINFO input.voltage.nominal "230"
send_to_all: SETINFO input.current.nominal "0.0"
send_to_all: SETINFO battery.packs "1"
send_to_all: SETINFO battery.voltage.nominal "12.0"
send_to_all: SETINFO input.frequency.nominal "50"
Ratings read in 1 tries
send: I
read: #UNITEK POWER    SCU8UPEG   V8.0
send_to_all: SETINFO ups.mfg "UNITEK"
send_to_all: SETINFO ups.model "POWER"
send_to_all: SETINFO ups.firmware "SCU8UPEG"
Vendor information read in 1 tries
send_to_all: SETINFO ups.delay.start "180"
send_to_all: SETINFO ups.delay.shutdown "30"
send_to_all: ADDCMD beeper.toggle
send_to_all: ADDCMD load.off
send_to_all: ADDCMD load.on
send_to_all: ADDCMD shutdown.return
send_to_all: ADDCMD shutdown.stayoff
send_to_all: ADDCMD shutdown.stop
send_to_all: ADDCMD test.battery.start
send_to_all: ADDCMD test.battery.start.deep
send_to_all: ADDCMD test.battery.start.quick
send_to_all: ADDCMD test.battery.stop
send_to_all: SETINFO ups.vendorid "0665"
send_to_all: SETINFO ups.productid "5161"
send: Q1
read: (222.0 224.0 189.0 000 49.9 13.6 24.0 00001000
send_to_all: SETINFO input.voltage "222.0"
send_to_all: SETINFO input.voltage.fault "224.0"
send_to_all: SETINFO output.voltage "189.0"
send_to_all: DATAOK
dstate_init: sock /var/state/ups/blazer_usb-unitek open on fd 5
send_to_all: SETINFO driver.version "2.4.0-pre2"
send_to_all: SETINFO driver.version.internal "0.02"
send_to_all: SETINFO driver.name "blazer_usb"
send_to_all: SETINFO driver.parameter.pollinterval "2"
send: Q1
read: (220.0 218.0 189.0 000 49.9 13.6 24.0 00001000
send_to_all: SETINFO input.voltage "220.0"
send_to_all: SETINFO input.voltage.fault "218.0"
send: Q1
read: (216.0 218.0 187.0 000 49.8 13.6 24.0 00001000
send_to_all: SETINFO input.voltage "216.0"
send_to_all: SETINFO output.voltage "187.0"
send_to_all: SETINFO input.frequency "49.8"
send: Q1
read: (218.0 218.0 201.0 000 49.8 13.6 24.0 00001000
send_to_all: SETINFO input.voltage "218.0"
send_to_all: SETINFO output.voltage "201.0"
send: Q1
read: (218.0 218.0 189.0 000 49.9 13.6 24.0 00001000
send_to_all: SETINFO output.voltage "189.0"
send_to_all: SETINFO input.frequency "49.9"
send: Q1
read: (218.0 220.0 183.0 000 49.9 13.6 24.0 00001000
send_to_all: SETINFO input.voltage.fault "220.0"
send_to_all: SETINFO output.voltage "183.0"
send: Q1
read: (220.0 220.0 187.0 000 49.9 13.6 24.0 00001000
send_to_all: SETINFO input.voltage "220.0"
send_to_all: SETINFO output.voltage "187.0"
...

And it seems to stand forever sending those Q1 commands...

Well, it seems we've advanced somehow... at least I can read some values 
from the UPS now. But I really need the shutdown command to work...

By the way, trying to execute upsd:

# /usr/local/ups/sbin/upsd
Network UPS Tools upsd 2.4.0-pre2
listening on 127.0.0.1 port 3493
Can't connect to UPS [unitek] (blazer_usb-unitek): No such file or directory

It doesn't seem to find blazer_usb binary... but it exists, and it's in 
the path:

# ls -al /usr/local/ups/bin/blazer_usb
-rwxr-xr-x 1 root staff 60599 2009-01-27 11:08 /usr/local/ups/bin/blazer_usb

# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/ups/bin:/usr/local/ups/sbin

Sorry for my looong mails... and thank you a lot for your help and for 
making NUT possible! It's a great tool! :D

Maybe we'll finally get working this little and silly UPS...



More information about the Nut-upsuser mailing list