Running Mustek Powermust 600 UPS with nut

This post was written by eli on January 14, 2010
Posted Under: Linux,Software

Introduction

I have an old Mustek 600VA UPS with RS-232 connection. Since I change the battery every couple of years on my own, I find it pretty pointless to throw it away.

And my brand new computer (running Fedora 12) has an RS-232 port if one insists to use a connector on the motherboard. Needless to say, I had to steal the RS-232 cable from motherboard to panel from an old computer.

A simple male/female extension RS-232 cable connects between UPS and computer. PC to UPS communication goes through pin 3, and the other direction through pin 2. The cable should be completely transparent (i.e. not switch wires, in particular not pins 2 and 3).

In case you want to see if the UPS is alive with Putty (or some other terminal), go for 2400 baud, 8N1 (8 bits, no flow control and one stop bit). Type Q1 followed by a carriage return, and the UPS should respond with a line of status info. The protocol is described  here.

Linux driver

The right driver to run with the UPS is the Network UPS Tool, or nut for short.

# yum install nut

Configure the UPS.

# vi /etc/ups/ups.conf

Basically, add the following entry:

[PowerMust]
driver = megatec
port=/dev/ttyS0
desc = "Mustek PowerMust 600VA"
mfr = "Mustek"
model = "PowerMust 600"

Now we can kick off the driver which listens to the UPS (the response takes a few seconds):

# upsdrvctl start
Network UPS Tools - UPS driver controller 2.4.1
Network UPS Tools - Megatec protocol driver 1.6 (2.4.1)
Megatec protocol UPS detected.

If you happen to have an oscilloscope on the RS-232 lines (ha!), you should see some action every few seconds from now on.

Or, alternatively, if you want to see what’s running on the computer, I suggest

# ps aux | grep nut

It so happens, that during the installation, we got a new user, named “nut” under which most of the relevant processes are running. A process running /sbin/megatec should be found there.

Configure the monitor

# vi /etc/ups/upsmon.conf

Basically, there’s only one line to add (pretty much at the beginning):

MONITOR PowerMust@localhost 1 upsmon pass master

I’ve chosen to configure the monitor as master, since the I plan to put some virtualization guests, which may work as slaves. As for the “upsmon” and “pass”, these are user and password when connecting to upsd. Since no user nor password were configured in upsd.users, the attempt to login will fail, resulting in error messages when the monitor is started.

Now let’s test it. First, let’s remove the already running daemons:

# service ups stop
Stopping UPS monitor:                                      [FAILED]
Stopping upsd:                                             [  OK  ]
Shutting down upsdrvctl:                                   [  OK  ]

Stopping the UPS monitor failed, because it wasn’t running. And not kick it off:

# service ups start
Starting UPS driver controller:                            [  OK  ]
Starting upsd:                                             [  OK  ]
Starting UPS monitor (master):                             [  OK  ]

# ps aux | grep nut
nut       6578  0.0  0.0   6084   468 ?        Ss   02:51   0:00 /sbin/megatec -a PowerMust
nut       6582  0.0  0.0  40552   624 ?        Ss   02:51   0:00 /usr/sbin/upsd
nut       6586  0.0  0.0  38364   856 ?        S    02:51   0:00 /usr/sbin/upsmon
root      7509  0.0  0.0 102728   780 pts/0    R+   02:54   0:00 grep nut

Now let’s watch the relevant entries in /var/log/messages:

Jan 14 02:51:48 short megatec[6578]: Startup successful
Jan 14 02:51:48 short upsd[6581]: listening on 127.0.0.1 port 3493
Jan 14 02:51:48 short upsd[6581]: listening on ::1 port 3493
Jan 14 02:51:48 short upsd[6581]: Connected to UPS [PowerMust]: megatec-PowerMust
Jan 14 02:51:48 short upsd[6582]: Startup successful
Jan 14 02:51:48 short upsmon[6585]: Startup successful
Jan 14 02:51:48 short upsd[6582]: User upsmon@::1 logged into UPS [PowerMust]
Jan 14 02:51:48 short upsmon[6586]: Master privileges unavailable on UPS [PowerMust@localhost]
Jan 14 02:51:48 short upsmon[6586]: Response: [ERR ACCESS-DENIED]

The two last lines are a result of the lack of user and password in upsd. But that’s fine. The UPS in monitored even so.

The final step is to activate the service on boot, using chkconfig or some GUI tool (System->Administration->Services on my computer).

Checking out the UPS

Want to grab some info about the UPS? That’s what upsc is for (run while UPS was on battery):

# upsc PowerMust
battery.charge: 60.0
battery.voltage: 12.10
battery.voltage.nominal: 12.0
driver.name: megatec
driver.parameter.mfr: Mustek
driver.parameter.model: PowerMust 600
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ttyS0
driver.version: 2.4.1
driver.version.internal: 1.6
input.frequency: 50.0
input.frequency.nominal: 50.0
input.voltage: 0.0
input.voltage.fault: 0.0
input.voltage.maximum: 230.5
input.voltage.minimum: 230.0
input.voltage.nominal: 230.0
output.voltage: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 0
ups.delay.start: 2
ups.load: 14.0
ups.mfr: Mustek
ups.model: PowerMust 600
ups.serial: unknown
ups.status: OB
ups.temperature: 37.8
ups.type: standby

Reader Comments

Hi Eli.
I’m about to through out my mustek ups 600va, since it fails every two seconds with a bip (perhaps run down battery), but I saw this article, and I want to ask you how can I change the battery instead of buying a new ups. Can you help me? If you explain do it as if i’m 6yo :-) Thanks

#1 
Written By José on February 26th, 2010 @ 21:32

Hello,

I’m afraid there isn’t much to explain. Just open the screws and look inside. The battery is that big chunk in the middle. I suggest taking a photo or two, so you’ll remember how it was wired, and then disconnect it, take it to a descent electronics store and ask for a replacement. Connect it as it was before.

It really is that simple, once you open the hood. Just be sure not to get the plus and minus reversed. Possibly mark the wires while disconnecting.

Good luck.

#2 
Written By eli on February 26th, 2010 @ 21:52

Trackbacks

Add a Comment

required, use real name
required, will not be published
optional, your blog address