Koozali.org: home of the SME Server

NUT Problems with new unit

Offline ddougan

  • *
  • 155
  • +0/-0
    • http://www.DouganConsulting.com
NUT Problems with new unit
« on: March 06, 2011, 12:25:44 AM »
I recently replaced an APC SmartUPS 1500 with a new unit of the same model. However, the new unit has a USB connection instead of the old serial one. I have reconfigured the server to use the USB device; I see the device in dmesg, but it is not showing up correctly:

# upsc UPS
Error: Driver not connected

# config show nut |grep -vi Pass
nut=service
    Model=usbhid-ups
    status=enabled

# dmesg|grep UPS
hiddev96: USB HID v1.00 Device [American Power Conversion Smart-UPS 1500 FW:COM 02.1 / UPS.05.D] on usb-0000:00:1d.2-1

I'd appreciate any thoughts as to why the driver isn't being recognized.

Thanks,

Des
Des Dougan

Offline byte

  • *
  • 2,183
  • +2/-0
Re: NUT Problems with new unit
« Reply #1 on: March 07, 2011, 11:40:24 AM »
What version of SME Server are you running? Any additional contribs or custom templates?

Can you show the result of:

cat /etc/ups/ups.conf

?

How exactly did you remove the old serial parameters and what commands did you use to try with the new UPS?
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline ddougan

  • *
  • 155
  • +0/-0
    • http://www.DouganConsulting.com
Re: NUT Problems with new unit
« Reply #2 on: March 07, 2011, 04:50:16 PM »
Byte,

Thanks for your reply.

# cat /etc/ups/ups.conf
#------------------------------------------------------------
#              !!DO NOT MODIFY THIS FILE!!
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http://www.contribs.org/development/
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------
[UPS]
        driver = usbhid-ups
        port = /var/lib/ups/hiddev0

# more /etc/redhat-release
SME Server release 7.5.1

In terms of contribs, only openvpn and php5 (in an i-bay) have been added.

I removed the old parameters by using the setprop commands in the NUT article in the contribs.org Wiki. As far as I can see, the NUT configuration is as it would be after a clean installation followed by enabling the service per the Wiki how-to. I installed 7.5.1 on a test box here and confirmed the settings on the client machine were as expected (i.e. all the config files in /etc/ups, as well as the config db entry).


Thanks,

Des
Des Dougan

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: NUT Problems with new unit
« Reply #3 on: March 07, 2011, 05:03:35 PM »
How exactly did you remove the old serial parameters and what commands did you use to try with the new UPS?

Des, PLEASE answer this question, thank you

Offline ddougan

  • *
  • 155
  • +0/-0
    • http://www.DouganConsulting.com
Re: NUT Problems with new unit
« Reply #4 on: March 07, 2011, 05:32:49 PM »
Byte,

Apologies. From the history, I did:

config setprop nut Model usbhid-ups
config setprop nut status disabled
config delprop nut Device
config setprop nut status enabled
signal-event post-upgrade; signal-event reboot

Then with the new UPS, I ran:

# upsc -l   
upsc.c:170: Error: Connection failure: Connection refused

#  upsc UPS@localhost
Error: Connection failure: Connection refused

I also then checked dmesg and the configuration db (config show nut).

Des
Des Dougan

Offline byte

  • *
  • 2,183
  • +2/-0
Re: NUT Problems with new unit
« Reply #5 on: March 07, 2011, 07:00:56 PM »
Thanks, only thing I see you didn't do is expand the templates, but running post-upgrade;reboot should have taken care of that.

After running the config db I would have done:

expand-template /etc/sysconfig/ups
expand-template /etc/ups/ups.conf
expand-template /etc/ups/upssched.conf
expand-template /etc/ups/upsmon.conf
expand-template /etc/ups/upsd.users
expand-template /etc/ups/upsd.conf

then:

service nut restart

Does that work? If not, unplug the device from the USB port and plug it back in, then check the /var/log/messages to see the output from plugging in the USB Device.

Also, show the out put of:

ll /var/lib/ups/hiddev0

?

Also, what does this out put return:

usbhid-ups -u root -DD -a UPS

?
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline ddougan

  • *
  • 155
  • +0/-0
    • http://www.DouganConsulting.com
Re: NUT Problems with new unit
« Reply #6 on: March 08, 2011, 07:45:16 AM »
Byte,

Thanks for your help with this - it looks like we're getting somewhere. I expanded the templates and restarted NUT with the same results.

# ll /var/lib/ups/hiddev0
crw-r--r--  1 nut nut 180, 96 Sep 22  2006 /var/lib/ups/hiddev0

I then ran the driver command:

# usbhid-ups -u root -DD -a UPS
Network UPS Tools: 0.28 USB communication driver 0.28 - core 0.30 (2.2.0-)

debug level is '2'
Checking device (0000/0000) (005/001)
- VendorID: 0000
- ProductID: 0000
- Manufacturer: Linux 2.6.9-89.0.25.ELsmp uhci_hcd
- Product: UHCI Host Controller
- Serial Number: 0000:00:1d.3
- Bus: 005
Trying to match device
Device does not match - skipping
Checking device (051D/0003) (004/002)
- VendorID: 051d
- ProductID: 0003
- Manufacturer: American Power Conversion
- Product: Smart-UPS 1500 FW:COM 02.1 / UPS.05.D
- Serial Number: AS1044214380 
- Bus: 004
Trying to match device
This APC device (051d/0003) is not (or perhaps not yet) supported
by usbhid-ups. Please make sure you have an up-to-date version of NUT. If
this does not fix the problem, try running the driver with the
'-x productid=0003' option. Please report your results to the NUT user's
mailing list <nut-upsuser@lists.alioth.debian.org>.

# usbhid-ups -u root -DD -a UPS -x productid=0003
Network UPS Tools: 0.28 USB communication driver 0.28 - core 0.30 (2.2.0-)

debug level is '2'
Checking device (0000/0000) (005/001)
- VendorID: 0000
- ProductID: 0000
- Manufacturer: Linux 2.6.9-89.0.25.ELsmp uhci_hcd
- Product: UHCI Host Controller
- Serial Number: 0000:00:1d.3
- Bus: 005
Trying to match device
Device does not match - skipping
Checking device (051D/0003) (004/002)
- VendorID: 051d
- ProductID: 0003
- Manufacturer: American Power Conversion
- Product: Smart-UPS 1500 FW:COM 02.1 / UPS.05.D
- Serial Number: AS1044214380 
- Bus: 004
Trying to match device
Device matches
failed to claim USB device, trying 2 more time(s)...
detaching kernel driver from USB device...
trying again to claim USB device...
HID descriptor retrieved (Reportlen = 425)
Report descriptor retrieved (Reportlen = 425)
Found HID device
Report Descriptor size = 425
Detected a UPS: American Power Conversion/Smart-UPS 1500 FW:COM 02.1 / UPS.05.D
Using subdriver: APC/CyberPower HID 0.9
Path: UPS.PowerSummary.iProduct, Type: Feature, ReportID: 0x01, Offset: 0, Size: 8, Value: 2.000000
Path: UPS.PowerSummary.iSerialNumber, Type: Feature, ReportID: 0x02, Offset: 0, Size: 8, Value: 3.000000
Path: UPS.PowerSummary.iManufacturer, Type: Feature, ReportID: 0x03, Offset: 0, Size: 8, Value: 1.000000
Path: UPS.PowerSummary.iOEMInformation, Type: Feature, ReportID: 0x04, Offset: 0, Size: 8, Value: 1.000000
Path: UPS.PowerSummary.iDeviceChemistry, Type: Feature, ReportID: 0x05, Offset: 0, Size: 8, Value: 4.000000
Path: UPS.PowerSummary.Rechargeable, Type: Feature, ReportID: 0x06, Offset: 0, Size: 8, Value: 1.000000
Path: UPS.PowerSummary.CapacityMode, Type: Feature, ReportID: 0x06, Offset: 8, Size: 8, Value: 2.000000
Path: UPS.PowerSummary.DesignCapacity, Type: Feature, ReportID: 0x0e, Offset: 0, Size: 8, Value: 100.000000
Path: UPS.PowerSummary.FullChargeCapacity, Type: Feature, ReportID: 0x0e, Offset: 8, Size: 8, Value: 100.000000
Path: UPS.PowerSummary.RemainingCapacity, Type: Input, ReportID: 0x0c, Offset: 0, Size: 8, Value: 100.000000
Path: UPS.PowerSummary.RemainingCapacity, Type: Feature, ReportID: 0x0c, Offset: 0, Size: 8, Value: 100.000000
Path: UPS.PowerSummary.CapacityGranularity1, Type: Feature, ReportID: 0x10, Offset: 0, Size: 8, Value: 1.000000
Path: UPS.PowerSummary.CapacityGranularity2, Type: Feature, ReportID: 0x10, Offset: 8, Size: 8, Value: 1.000000
Path: UPS.PowerSummary.WarningCapacityLimit, Type: Feature, ReportID: 0x0f, Offset: 0, Size: 8, Value: 50.000000
Path: UPS.PowerSummary.RemainingCapacityLimit, Type: Feature, ReportID: 0x11, Offset: 0, Size: 8, Value: 10.000000
Path: UPS.PowerSummary.ManufacturerDate, Type: Feature, ReportID: 0x09, Offset: 0, Size: 16, Value: 15710.000000
Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x0d, Offset: 0, Size: 16, Value: 2460.000000
Path: UPS.PowerSummary.RunTimeToEmpty, Type: Feature, ReportID: 0x0d, Offset: 0, Size: 16, Value: 2460.000000
Path: UPS.PowerSummary.DelayBeforeShutdown, Type: Feature, ReportID: 0x12, Offset: 0, Size: 16, Value: -1.000000
Path: UPS.PowerSummary.DelayBeforeReboot, Type: Feature, ReportID: 0x13, Offset: 0, Size: 24, Value: -1.000000
Path: UPS.PowerSummary.RemainingTimeLimit, Type: Input, ReportID: 0x08, Offset: 0, Size: 24, Value: 1380.000000
Path: UPS.PowerSummary.RemainingTimeLimit, Type: Feature, ReportID: 0x08, Offset: 0, Size: 24, Value: 1380.000000
Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, ReportID: 0x0a, Offset: 0, Size: 16, Value: 24.000002
Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: 0x0b, Offset: 0, Size: 16, Value: 27.000002
Path: UPS.PowerSummary.AudibleAlarmControl, Type: Input, ReportID: 0x14, Offset: 0, Size: 8, Value: 2.000000
Path: UPS.PowerSummary.AudibleAlarmControl, Type: Feature, ReportID: 0x14, Offset: 0, Size: 8, Value: 2.000000
Path: UPS.PowerSummary.PresentStatus.Charging, Type: Input, ReportID: 0x07, Offset: 0, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.Charging, Type: Feature, ReportID: 0x07, Offset: 0, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Input, ReportID: 0x07, Offset: 1, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Feature, ReportID: 0x07, Offset: 1, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Input, ReportID: 0x07, Offset: 2, Size: 1, Value: 1.000000
Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Feature, ReportID: 0x07, Offset: 2, Size: 1, Value: 1.000000
Path: UPS.PowerSummary.PresentStatus.BatteryPresent, Type: Input, ReportID: 0x07, Offset: 3, Size: 1, Value: 1.000000
Path: UPS.PowerSummary.PresentStatus.BatteryPresent, Type: Feature, ReportID: 0x07, Offset: 3, Size: 1, Value: 1.000000
Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Input, ReportID: 0x07, Offset: 4, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Feature, ReportID: 0x07, Offset: 4, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.ShutdownRequested, Type: Input, ReportID: 0x07, Offset: 5, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.ShutdownRequested, Type: Feature, ReportID: 0x07, Offset: 5, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.ShutdownImminent, Type: Input, ReportID: 0x07, Offset: 6, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.ShutdownImminent, Type: Feature, ReportID: 0x07, Offset: 6, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Input, ReportID: 0x07, Offset: 7, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Feature, ReportID: 0x07, Offset: 7, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.CommunicationLost, Type: Input, ReportID: 0x07, Offset: 8, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.CommunicationLost, Type: Feature, ReportID: 0x07, Offset: 8, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Input, ReportID: 0x07, Offset: 9, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Feature, ReportID: 0x07, Offset: 9, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.Overload, Type: Input, ReportID: 0x07, Offset: 10, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.Overload, Type: Feature, ReportID: 0x07, Offset: 10, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.VoltageNotRegulated, Type: Input, ReportID: 0x07, Offset: 11, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.VoltageNotRegulated, Type: Feature, ReportID: 0x07, Offset: 11, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.ff860080, Type: Input, ReportID: 0x07, Offset: 12, Size: 1, Value: 0.000000
Path: UPS.PowerSummary.PresentStatus.ff860080, Type: Feature, ReportID: 0x07, Offset: 12, Size: 1, Value: 0.000000
Can't find object UPS.ff8600fd
Path: UPS.ff8600fd, Type: Input, ReportID: 0x89, Offset: 0, Size: 8
Can't find object UPS.ff8600fc
Path: UPS.ff8600fc, Type: Output, ReportID: 0x90, Offset: 0, Size: 8
Can't find object UPS.Battery.ConfigVoltage
Can't find object UPS.Battery.Temperature
Can't find object UPS.Battery.ManufacturerDate
Can't find object UPS.PowerSummary.APCBattReplaceDate
Can't find object UPS.Battery.APCBattReplaceDate
Can't find object UPS.Output.PercentLoad
Can't find object UPS.PowerConverter.PercentLoad
Can't find object UPS.Output.DelayBeforeStartup
Can't find object UPS.Battery.Test
Can't find object UPS.Output.Test
Can't find object UPS.ManufacturerDate
Can't find object UPS.Output.ConfigActivePower
Can't find object UPS.PowerSummary.Charging
Can't find object UPS.PowerSummary.Discharging
Can't find object UPS.PowerSummary.ACPresent
Can't find object UPS.PowerSummary.BelowRemainingCapacityLimit
Can't find object UPS.PowerSummary.ShutdownImminent
Can't find object UPS.PowerSummary.APCStatusFlag
Can't find object UPS.PowerSummary.PresentStatus.FullyCharged
Can't find object UPS.Output.Overload
Can't find object UPS.Output.Boost
Can't find object UPS.Input.Voltage
Can't find object UPS.Input.ConfigVoltage
Can't find object UPS.Input.LowVoltageTransfer
Can't find object UPS.Input.HighVoltageTransfer
Can't find object UPS.Output.Voltage
Can't find object UPS.Output.ConfigVoltage
Can't find object UPS.BatterySystem.Battery.Test
Can't find object UPS.BatterySystem.Battery.Test
Can't find object UPS.BatterySystem.Battery.Test
Can't find object UPS.APCPanelTest
Can't find object UPS.APCPanelTest
Can't find object UPS.PowerSummary.APCPanelTest
Can't find object UPS.PowerSummary.APCPanelTest
Can't find object UPS.APCGeneralCollection.APCDelayBeforeShutdown
Can't find object UPS.Output.DelayBeforeShutdown
Can't find object UPS.PowerSummary.DelayBeforeStartup
Can't find object UPS.Output.DelayBeforeStartup
Can't find object UPS.APCGeneralCollection.APCForceShutdown
Can't find object UPS.APCGeneralCollection.APCDelayBeforeShutdown
Can't find object UPS.Output.DelayBeforeShutdown
upsdrv_updateinfo...
dstate_init: sock /var/run/nut/usbhid-ups-UPS open on fd 5
upsdrv_updateinfo...
Waiting for notifications...
upsdrv_updateinfo...
Waiting for notifications...

From what I can see above, it was able to communicate. However, I created a custom template that resulted in this ups.conf:

# more /etc/ups/ups.conf
#------------------------------------------------------------
#              !!DO NOT MODIFY THIS FILE!!
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http://www.contribs.org/development/
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------
[UPS]
        driver = usbhid-ups
        port = /var/lib/ups/hiddev0
        productid = 0003

However, the driver wouldn't load again after stopping and starting the service. (I added the productid to ups.conf based on a thread I found when Googling for the device code (051d/0003)).

It's getting late - I'll do more on this tomorrow. Thanks for your help.


Des
Des Dougan

Offline byte

  • *
  • 2,183
  • +2/-0
Re: NUT Problems with new unit
« Reply #7 on: March 08, 2011, 11:55:47 AM »
I'd actually use vendorid = 051d instead of productid.
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: NUT Problems with new unit
« Reply #8 on: March 08, 2011, 02:23:44 PM »
Guys, please move this thread to the bug tracker.

Des, you've been around long enough to know this:

Don't report problems here
- Please report bugs and potential bugs in the bug tracker

Offline byte

  • *
  • 2,183
  • +2/-0
Re: NUT Problems with new unit
« Reply #9 on: March 08, 2011, 02:42:32 PM »
Guys, please move this thread to the bug tracker.

Des, you've been around long enough to know this:

My fault, I would have said but felt this isn't a bug with the SME Server software but more of the case a nut bug issue as it seems the usbhid-ups doesn't directly support this type of APC Smart UPS (USB type).

On the other hand we would have had a bug report even though it would have been closed wontfix.

To the bug tracker please Des, and could you note the bug reference in this thread once you've opened a ticket.

Thanks.
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline ddougan

  • *
  • 155
  • +0/-0
    • http://www.DouganConsulting.com
Re: NUT Problems with new unit
« Reply #10 on: March 09, 2011, 05:29:38 AM »
Des Dougan