# Problems with nut and UPS [solved]

## at

Hi,

I am trying to make sys-power/nut to work with Newpoint UPS. Newpoint UPS is supposed to be supported by 'powercom' driver.

The UPS has a USB connection. here is the outpu of 'lsusb':

```
Bus 002 Device 006: ID 0d9f:0001 Powercom Co., Ltd 

Bus 002 Device 005: ID 04b3:301b IBM Corp. 

Bus 002 Device 004: ID 04b3:301a IBM Corp. 

Bus 002 Device 003: ID 046d:c03d Logitech, Inc. 

Bus 002 Device 001: ID 0000:0000  

Bus 001 Device 001: ID 0000:0000
```

I can see '/usr/dev/usb/hiddev0' device.

```
ls -l /dev/usb/hiddev0

crw-rw-rw- 1 root root 180, 96 Sep  7 20:07 /dev/usb/hiddev0
```

If I do 'cat /dev/usb/hiddev0', something is coming out of it.

So I made the following entry in /etc/nut/ups.conf file:

```
[Newpoint]

        driver = powercom

        port = /dev/usb/hiddev0

        desc = "Newpoint Surge Protector 525VA 20877"
```

But when I execute '/usr/l/usr/sbin/upsdrvctl start', I get the following error:

```
Network UPS Tools - UPS driver controller 2.0.3

Network UPS Tools - PowerCom and similars protocol UPS driver $ Revision: 0.5 $ (2.0.3)

tcgetattr(/dev/usb/hiddev0): Invalid argument

Driver failed to start (exit status=1)
```

Thank you for your help.Last edited by at on Fri Sep 22, 2006 1:47 am; edited 1 time in total

----------

## Xaid

I don't have that UPS, but try setting the port to auto and see if it makes a difference.

Good luck.

----------

## at

Thank you.

I tried to change port to "auto", but now I am getting

```
/usr/include/usr/sbin/upsdrvctl start

Network UPS Tools - UPS driver controller 2.0.3

Network UPS Tools - PowerCom and similars protocol UPS driver $ Revision: 0.5 $ (2.0.3)

Unable to open auto: No such file or directory

Things to try:

 - Check 'port=' in ups.conf

 - Check owner/permissions of all parts of path

Fatal error: unusable configuration

Driver failed to start (exit status=1)
```

I am doing it as root, so permissions shouldn't be a problem.

Do you guys have any suggestions?

Thank you

----------

## Xaid

Hi at,

I wasn't paying attention, the "auto" option for port only works if you are using the newhidups driver.

I googled a bit, and it seems the powercom driver is only for serial UPSes, and I'm assuming you have a USB UPS (since you mentioned /dev/usb/hiddev0)

so using that driver is incorrect, and you should try using the newhidups driver to see if that works.

I suggest subscribing to the NUT dev mailing list and offering help in testing patches and workarounds, I found an interesting thread that you might want to take a look at:

http://www.mail-archive.com/nut-upsuser@lists.alioth.debian.org/msg01115.html

Try with the following for now:

```

[Newpoint]

        driver = newhidups

        port =  auto

        desc = "Newpoint Surge Protector 525VA 20877"

```

Make sure you emerged nut with the usb USE flag and I suggest trying the latest ~x86 Nut to see if it helps.

Good luck.

----------

## drew_kay

Best thing to run is nut-2.0.4-r1 w/ libusb-0.1.12 if you can. I haven't had a chance to test the earlier 2.0.* ebuilds with libusb-0.1.12 (it's on my list for this weekend) but I'll be reporting my results once that's done.

I suggest this because I spent some time debugging an issue in nut that is caused by libusb and fixed in v0.1.12. What was happening was that prior to 0.1.12, libusb was interfacing with the ups through /sys (or /proc but I forget which off the top of my head). That meant the udev rules that nut used were not having any effect on the permissions/ownership of the usb device. The workaround was to manually change permissions/ownership of the relevant file/node. This was a nasty kludge, and dies everytime you reboot or unplug/replug the device. The solution was to use libusb v0.1.12, in which libusb attempts to use /dev first before falling back to /sys. This means that udev's rules created for nut actually do something instead of looking just looking pretty.

----------

## at

Hi guys,

Thank you very much for your input.

It was just getting too much for me - spending all this time trying to make something as simple as an UPS to work.

So the solution I found was very simple: return the pathetic Newpoint UPS and get APC instead. APC is a little pricier, but works much better.

By the way, did I mention, that Newpoint UPS manual comes just in 2 languages: English and Chinese? The English version does not have a single sentence without grammatical mistakes. One can only imagine how good that product is past its manual!

----------

