How to configure the UPS port?

Status
Not open for further replies.

Tekkie

Patron
Joined
May 31, 2011
Messages
353
I assume the problem lies with the driver configuration file written by the FreeNAS system and not the FreeBAS UPS driver or?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I suppose you could hook up some type of USB serial terminal emulator where the UPS should be and see what kind of stuff is coming out the other end. Maybe it's the default baud rate is wrong.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I'm curious if the UPS USB port shutdown works with FreeBSD. If it works (I suspect it does) that would put the issue with NanoBSD. Wish I were home to play with this.
 

Tekkie

Patron
Joined
May 31, 2011
Messages
353
upsc ups@localhost:
Code:
upsc ups@localhost
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: not set
battery.mfr.date: 2010/10/08
battery.runtime: 1545
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 13.6
battery.voltage.nominal: 12.0
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ugen0.2
driver.version: 2.4.1
driver.version.data: APC HID 0.93
driver.version.internal: 0.34
input.transfer.high: 256
input.transfer.low: 196
input.voltage: 240.0
input.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 871.O2 .I
ups.firmware.aux: O2
ups.load: 18
ups.mfr: APC
ups.mfr.date: 2010/10/08
ups.model: Back-UPS ES 700G
ups.productid: 0002
ups.serial: 5B1041T28630
ups.status: OL
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d
 

Tekkie

Patron
Joined
May 31, 2011
Messages
353
Running 'upsmon' gives this... notice the Warning and the Invalid flag
Code:
Network UPS Tools upsmon 2.4.1
UPS: ups (master) (power value 1)
Invalid notify flag: [EXECNOTIFYFLAG]

Warning: no shutdown command defined!


And there are more problems:
Code:
shrek# upsd -c reload
Network UPS Tools upsd 2.4.1

Broadcast Message from antoni@shrek.local
        (no tty) at 9:00 BST...

Communications with UPS ups lost


Broadcast Message from antoni@shrek.local
        (no tty) at 9:00 BST...

Communications with UPS ups established

The above happened when I re-started the service from the web UI, e.g. the upsd daemon is not started by the services tab in the UI.

Its safe to say that the UPS implementation done in 8.0.1 beta4 is not even alpha ready. :(
 

Tekkie

Patron
Joined
May 31, 2011
Messages
353
Stupid UI stomps over changes to config files!

:mad: I just lost all my nut/upsmon/upsd config changes when I stopped and started the UPS service from the UI!

I guess it proves it that the implementation is 'aware' of all the right config files but it doesn't put the right info into them!

Dev team please read this posting (http://www.networkupstools.org/docs/user-manual.chunked/ar01s06.html) and follow it to the letter, once you do that it all works!
 

RaynMan

Dabbler
Joined
Aug 12, 2011
Messages
12
Managed to sort it out (mostly)..

I posted my nasty hack job here.

Not ideal, but it works...At least my systems shutdown on power failure. Any more than that, is up in the air.

Ray
 

Tekkie

Patron
Joined
May 31, 2011
Messages
353
Thanks for posting that! I had the same config changes done and only lost them because I hit the stop/start UPS service in the UI.

Did you check if the hack stays in place after a shutdown? I have this suspicion it won't. :(
 

RaynMan

Dabbler
Joined
Aug 12, 2011
Messages
12
They do. I made sure of it. The changes remain after reboots and shutdowns. It's a clunky and nasty solution, but it gets the basics done. I'll have a look a little later to see if I can tidy it up and make it easier for people.

Ray
 

Tekkie

Patron
Joined
May 31, 2011
Messages
353
I will try to get my SVN setup done and take a look at the code and see if I can lend a hand to the devs on this. :)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I see Zippybr has added some code changes. I'm building it right now to see how they function, hopefully Zippy was done with the changes, doesn't help if only a few things were changed and not all of it planned. Will report back once I'm done. If I could only figure out how to force more processor time devoted to the build process... It never comes close to 20% CPU utilization and I have a SSD and it's not maxed out either. Someday I'll figure this out too.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
The UPS code has been changed twice by the Devs and I cannot get upsc ups@localhost to work anymore. I think we are working backwards. I also get connection refused. Using build 8r7246. Can someone try a new build (must be 7245 or greater) to see what they get. I doubt it's my machine but hey, you never know. I think I'll tinker some more.

-Mark

EDIT: I reverted back to an older version before the "Fixes" were put in and have been able to restore my connection to my UPS. So the UPS is not fix as of this posting. I tossed an email to William to let him know.
 

RaynMan

Dabbler
Joined
Aug 12, 2011
Messages
12
Been away for a few days and busy since then. Will have a look at last nights build and see what's what. Maybe I can see something.

Ray
 

RaynMan

Dabbler
Joined
Aug 12, 2011
Messages
12
Latest build: b7350
UPS is detected, everything loads without errors. Only changes made were to configure the driver and the USB port. No fiddling with permissions.
Unplug power and monitor detects power failure.
Plug in power and monitor detects power online.

System does not shutdown on power failure.
System does not send email.

Will keep looking.

Ray
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
The UPS code has been changed twice by the Devs and I cannot get upsc ups@localhost to work anymore. I think we are working backwards. I also get connection refused. Using build 8r7246. Can someone try a new build (must be 7245 or greater) to see what they get. I doubt it's my machine but hey, you never know. I think I'll tinker some more.

-Mark

EDIT: I reverted back to an older version before the "Fixes" were put in and have been able to restore my connection to my UPS. So the UPS is not fix as of this posting. I tossed an email to William to let him know.

I didnt get any mail FWIW.

I need logs of why it is not working. Just "stopped working" don't really helps...
 

RaynMan

Dabbler
Joined
Aug 12, 2011
Messages
12
Managed to get the system to shutdown. It seems that the upsmon app runs a child process as uucp and this user does not have rights to execute the shutdown command in the nut_notify.sh file in /var/tmp. changing the upsmon app to run purely as root works, but this isn't ideal.

One of the problems I am picking up is that the "shutdowncmd" is not running. When the UPS goes on battery it runs the nut_notify.sh file which runs an immediate shutdown. This basically means that the system begins a shutdown as soon as the upsmon app detects that the UPS has gone onto battery instead of after the designated period of time. I am not sure what the issue is there, because when I modify the nut_notify.sh file the shutdowncmd still doesn't run.

Any suggestions?

Ray
 

RaynMan

Dabbler
Joined
Aug 12, 2011
Messages
12
Okay...Shutdown when "UPS reaches low battery" works.

From what I have gathered (and I could be very wrong)"

1) Shutting down on "UPS reaches low battery" works fine. The system probably invokes the "shutdowncmd" correctly.
2) Shutting down on "UPS goes on battery" does not work. UPSMON child process runs as uucp and probably does not have permission to execute the shutdown command in /var/tmp/nut_notify.sh. If this restriction is bypassed then the system shuts down immediately and does not wait for the prescribed period as per the web config. I would suspect that the option to shut down on "UPS goes on battery" should also invoke the "shutdowncmd", but does not. In my view, /var/tmp/nut_notify.sh should purely be there to send a notification email on UPS events and not used to shut the system down.
3) Notification emails are still not being sent. Test emails work fine however. I am not sure if there is any other configuration that needs to be done.

Ray
 

andrew0401

Dabbler
Joined
Aug 19, 2011
Messages
21
Our Freenas 801RC1 box is working fine - but it is in a cabinet with a large networked APC SmartUPS protecting the whole cabinet - is there anyway to get network connections working rather than just USB/Serial?

Thanks

Andrew
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
Our Freenas 801RC1 box is working fine - but it is in a cabinet with a large networked APC SmartUPS protecting the whole cabinet - is there anyway to get network connections working rather than just USB/Serial?

Thanks

Andrew

Same.... I did open ticket #258 but it was closed as fixed even though it isn't.

Although getting UPS support to work reliably with USB/serial may be the first priority, with network support to follow? Like you, until the latter is added UPS support in FreeNAS 8 is a complete no go.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
UPS doesn't work with RC1 but does work on the nightly builds. There is a drop down box for devices, not sure if network is one of them. You might try the nightly to see how it goes in a VM.
 
Status
Not open for further replies.
Top