UPS via USB... I think it's working?

Status
Not open for further replies.

shackrock

Explorer
Joined
Dec 21, 2011
Messages
95
Ok so I have FreeNAS 8.3.1 STABLE (latest version).

I've set up my UPS, and I've found that it's on port /dev/ugen1.1 -> I know this because I turn the service on and can successfully type "upsc ups@localhost" and it spits out a bunch of info. So, I shut down the computer, and start it back up (unrelated reason) - and now when I run that command it says "Error: Data stale"

hmmmm

So, I stop the service in the GUI, and start it again, and now I see all the data again!
Code:
[root@freenas] ~# upsc ups@localhost
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 20
battery.mfr.date: CPS
battery.runtime: 2760
battery.runtime.low: 300
battery.type: PbAcid
battery.voltage: 8.7
battery.voltage.nominal: 12
device.mfr: CPS
device.model: CP685AVRLCD-G
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ugen1.1
driver.version: 2.6.5
driver.version.data: CyberPower HID 0.3
driver.version.internal: 0.37
input.transfer.high: 140
input.transfer.low: 90
input.voltage: 121.0
input.voltage.nominal: 120
output.voltage: 121.0
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 21
ups.mfr: CPS
ups.model: CP685AVRLCD-G
ups.productid: 0501
ups.realpower.nominal: 390
ups.status: OL
ups.test.result: Done and passed
ups.timer.shutdown: -60
ups.timer.start: 0
ups.vendorid: 0764


So.... why doesn't it work on first boot, will I need to always stop and start the service every time I restart the server (i.e. after a power outage...)?

update - ok already I've gotten this message on the console:


Code:
Broadcast Message from root@freenas.local                                      
        (no tty) at 18:17 EDT...                                               
                                                                               
Communications with UPS ups lost          



and I continue to get this over and over....:

Code:
Apr  3 18:18:53 freenas kernel: ugen1.3: <CPS> at usbus1 (disconnected)
Apr  3 18:18:55 freenas upsmon[3825]: Poll UPS [ups] failed - Data stale
Apr  3 18:18:56 freenas kernel: ugen1.3: <CPS> at usbus1
Apr  3 18:19:00 freenas upsmon[3825]: Poll UPS [ups] failed - Data stale
Apr  3 18:19:03 freenas kernel: ugen1.3: <CPS> at usbus1 (disconnected)
Apr  3 18:19:05 freenas upsmon[3825]: Poll UPS [ups] failed - Data stale
Apr  3 18:19:05 freenas kernel: ugen1.3: <CPS> at usbus1
Apr  3 18:19:10 freenas upsmon[3825]: Poll UPS [ups] failed - Data stale
Apr  3 18:19:13 freenas kernel: ugen1.3: <CPS> at usbus1 (disconnected)
Apr  3 18:19:15 freenas upsmon[3825]: Poll UPS [ups] failed - Data stale
Apr  3 18:19:15 freenas kernel: ugen1.3: <CPS> at usbus1


Also, is there a way I can really test to see if it's working together? Is it simply to shut off the breaker, or is there a software-related test I can do to find out?

Thanks!
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Also, is there a way I can really test to see if it's working together? Is it simply to shut off the breaker, or is there a software-related test I can do to find out?

Thanks!

I've seen several other posts from people complaining of the same problem but it still seems to work. I don't notice it happening on mine.

The way to test it is just to unplug your UPS and see if the email warning gets sent. Don't forget to have your router and modem connected to the UPS also, or if they lose power the message won't be able to be sent.
 

shackrock

Explorer
Joined
Dec 21, 2011
Messages
95
Well what's even more weird, is that the messages that continue forever and ever on the console reference the wrong "port"
Code:
ugen1.3
- but I'm plugged into (and the plugin is set to)
Code:
/dev/ugen1.1
.... that doesn't make any sense does it?
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
.... that doesn't make any sense does it?
Actually it does. The usbhid-ups driver for most, possibly all, sub-drivers queries the USB ports for the UPS. I specified auto for the port value for my UPS and it works just fine.

- - - Updated - - -

Well what's even more weird, is that the messages that continue forever and ever on the console reference the wrong "port"
Code:
ugen1.3
Have you tried a different USB 2.0 port?
 

shackrock

Explorer
Joined
Dec 21, 2011
Messages
95
Actually it does. The usbhid-ups driver for most, possibly all, sub-drivers queries the USB ports for the UPS. I specified auto for the port value for my UPS and it works just fine.

Ah HA! That's the fix. I did not know that you could type anything into the port field, I thought I had to select from the list (and auto is not an options). I have now typed auto in there and started the service, and everything seems perfect! Awesome.

Let me ask, is it possible to make the server restart when power has been restored for X seconds?
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403

shackrock

Explorer
Joined
Dec 21, 2011
Messages
95
Did not test a reboot yet, I'll do that this weekend though.

Right now, I think I'm just shutting down FreeNAS when power is lost (After a delay of like 2 minutes). I'd like to also start FreeNAS back up (power up the PC again) once power is restored for X minutes.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I don't believe you can set it to power back up automatically with the UPS service. Once the server shuts down, the only 3 ways I know of to turn it back on is Wake-On-LAN, pressing the power button, and if your BIOS supports the power on at a particular time(but this doesn't help you for restoring from a loss of power).
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
Right now, I think I'm just shutting down FreeNAS when power is lost (After a delay of like 2 minutes).
Easily configured via the GUI.

I don't believe you can set it to power back up automatically with the UPS service.
This would be a function of the actual UPS. On non-broken UPS hardware, the UPS will wait until the battery charge is no longer critical before turning the load back on. However, this is considered a feature and most consumer UPS are sold as cheaply as possible.
 

anika200

Contributor
Joined
Mar 18, 2013
Messages
113
Did not test a reboot yet, I'll do that this weekend though.

Right now, I think I'm just shutting down FreeNAS when power is lost (After a delay of like 2 minutes). I'd like to also start FreeNAS back up (power up the PC again) once power is restored for X minutes.

This would imply some sort of intelligence on the part of the UPS that just does not exist yet.
 
Status
Not open for further replies.
Top