Hype Dark logo






Searched for

by SS at 8:06 pm on Friday 18th April

I recently purchased a cheap Plexus branded UPS from eBuyer - it works well enough for my needs but it's Linux support is sketchy and I had difficulty getting the provided program working.

A day and half of experimentation and lots of Googling, I was able to get it working with NUT (Network UPS Tools) - but unfortunately the package available for Ubuntu 7.10 (version 2.0.2 IIRC) does not include the version of the driver necessary. The latest version does.

I can't guarantee that this will work for any other version than what is specified here since it required some form of mild hackery. It should work for any distribution of Linux - you'll probably need to find another way of getting the packages at the beginning and to add the init script at the end.

To get it working:
- Download the 2.2.1 stable source version of NUT:
http://eu1.networkupstools.org/source.html

- Make sure you have the following packages installed:
sudo aptitude install libusb-dev gcc g++ make

- Following instructions here to install:
http://eu1.networkupstools.org/doc/2.2.0/INSTALL.html

But, note the following specifics:
Before Step 1
- Download the megatec.c file from here and replace the one in the drivers folder with it.

This file contains added information to enable NUT to recognise the UPS and to ignore the faulty OFF status reading it gives.

Step 1
- run ./configure with the added option --with-drivers=megatec_usb (as well as specifying a user and group) - this will load only the driver you need.

Steps 2 > 6
- nothing extra

Step 7
If your setup was like mine, then Ubuntu will have put your UPS at /dev/usb/hiddev0, so your UPS settings will look like this:
[someups]
driver = megatec_usb
port = /dev/usb/hiddev0
#This may also work:
#port = auto
desc = "Some UPS desc"
lowbatt = 50
ignoreoff

NB, the lowbatt is the percentage at which it will power down your computer. You should set this to a sufficient percentage to allow your pc to shutdown fully. You can experiment with this to your hearts content. set

Steps 8 > 12
You may need to run these commands as sudo.

Step 13
To setup the init.d script so that the upsd daemon runs on startup-

Download a simple init script from here.

Copy the file to /etc/init.d/nut.

Make executable:
sudo chmod 755 /etc/init.d/nut

Add the appropriate links using update-rc.d (so that it runs this on bootup):
sudo update-rc.d nut defaults

Finally
Follow the rest of the instructions as stated to allow automatic shutdown.

This is a lot of work, but it works fine and it's a LOT cheaper than some of the other models that are supported rather more easily. Hopefully they'll update the package provided soon and you won't need to compile from source - but until then!

You can test it by unplugging the power and checking the status of the UPS by running /usr/local/ups/bin/upsc someups@localhost to see the battery charge change.

Any issues, email linux at ss21k dot co dot uk

No comments yet
No comments yet!

Comments have been disabled. You can probably comment on this post on Geek On A Bicycle.