APC UPS - help needed!

Status
Not open for further replies.

McBrian

Dabbler
Joined
Oct 4, 2011
Messages
14
Ok, FreeNAS 7 and UPS is now a success. I am able to get a working UPS service in ALL versions of FreeNAS 7. This is done by inserting a newer version of usbhid-ups into /usr/local/libexec/nut, and replacing driver.list in usr/local/etc/nut.

Now FreeNAS 8 is something else altogether :D

I have ftp'ed myself into FreeNAS 8 as root, I have mounted it as writeable, and I am able to edit files. So far so good. But when I edit a file, i.e. driver.list located under /usr/local/etc/nut - my changes won't stick after a reboot. Again, I am not familiar with the workings of FreeBSD, but what is going on? Are those files running off a RAM disk, or/and is there a "master" file hidden somewhere that is being "unzipped" upon boot? How do I edit files and make changes stick? Sorry for asking the obvious.
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
Yes to the "unzipping" at boot (kind of). Have a look in /conf/base/ - it's the files in this directory tree that are used by a running system, make your changes there and they should survive a reboot (though sadly they won't survive an upgrade - so make a note of your changes!)
 

bjobol

Cadet
Joined
Oct 13, 2011
Messages
2
Ok, FreeNAS 7 and UPS is now a success. I am able to get a working UPS service in ALL versions of FreeNAS 7. This is done by inserting a newer version of usbhid-ups into /usr/local/libexec/nut, and replacing driver.list in usr/local/etc/nut.

Now FreeNAS 8 is something else altogether :D

I have ftp'ed myself into FreeNAS 8 as root, I have mounted it as writeable, and I am able to edit files. So far so good. But when I edit a file, i.e. driver.list located under /usr/local/etc/nut - my changes won't stick after a reboot. Again, I am not familiar with the workings of FreeBSD, but what is going on? Are those files running off a RAM disk, or/and is there a "master" file hidden somewhere that is being "unzipped" upon boot? How do I edit files and make changes stick? Sorry for asking the obvious.

Hello McBrian, I have exactly the same UPS model as you do.

Which version of the usbhid-ups are you using? You mentioned earlier that you had success with nut 2.6.0.

I'm using 0.7.2 Sabanda (revision 7903) which comes with nut 2.6.1. I've had no success with it.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Just an update here on the email script. Thanks to William and some poking around from me, he found a minor bug in the script we were discussing above and fixed it. He mentioned that they are working on trying to release 8.02, not sure how soon though. @McBrian, I'm not sure if that will solve your problem. Anyway, I'll compile the latest build with the email fix and PM everyone when I get it ready.

EDIT: Forget that, looks like 8.02 has just been announced! :)

UPS email works!
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
McBrian,

Have you compared the config files line by line between 7 & 8?

Maybe you could post those? If it works with NUT on 7 it should work on 8 also!
There are probably some minor differences in the config files, but that might give a clue.
 

McBrian

Dabbler
Joined
Oct 4, 2011
Messages
14
bjobol, grab these 3 files from FreeNAS version 0.7.2.5872:

usbhid-ups in folder /usr/local/libexec/nut

cmdvartab and driver.list in folder usr/local/etc/nut

and copy them into the same folders in your FreeNAS 7 version of choice.

Make sure you fill in the correct port in the UPS service, i.e. "/dev/ugen0", sometimes "auto" will do the trick. It is also possible to remove and reconnect the usb plug from the UPS, you will find the correct port in the log files.

If you still get an error message: In the UPS service leave auxil. parameters empty. If you still get an error message you may want to use "ups.conf" - then save and restart the service - before you once again empty auxil. parameters - and perform another save and restart service (!) This has worked in all the versions of FreeNAS 7 I tested. Good luck!

EDIT: bjobol, I did some more testing - you will only need the driver file - usbhid.ups - the two other files are not necessary. You also need to make a full install, on embedded the driver will be overwritten upon reboot.


@protosd: That is great news! I hope I get time to have a look at those config files tomorrow, but (un)fortunately my girlfriend is soon back from abroad, and my experience so far is that such events mix rather poorly.

On a sidenote, you did say something very interesting earlier in this thread:

I did get the 'Driver not connected' error, but when I double checked the UPS model in "Control Services" it had the wrong model even though I know I selected the correct UPS in the UPS Service configuration.

This is exactly the same error message that haunts me in FreeNAS 8. May I ask how did you fix this issue?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
This is exactly the same error message that haunts me in FreeNAS 8. May I ask how did you fix this issue?

In the 'Control Services' section on the left sidebar, select the little 'wrench' next to the UPS service. There is another drop down menu there where you can choose the type of UPS. I just picked my UPS again, made sure the other settings were ok, and clicked OK.

I hope I get time to have a look at those config files tomorrow, but (un)fortunately my girlfriend is soon back from abroad, and my experience so far is that such events mix rather poorly.

Sure, I understand, no problem, I'll be around here when you have time. Send me a PM if you need to.
 

McBrian

Dabbler
Joined
Oct 4, 2011
Messages
14
Ok I see, I've been to that 'wrench' 1000 times before and it doesn't help me. I am however going to try and compare those config files. Hopefully the answer is there, but first I will do the upgrade to 8.0.2 :D

Edit: Been looking at every config file connected to NUT and UPS, and comparing them to the working ones in FreeNAS 7. And altough I have altered them to match what works in 7 the driver doesn't connect. Obviously I might have overlooked something, but I am beginning to think that the driver itself - usbhid-ups - is responsible for my trouble. I tried to use the working driver from 7, but then the service doesn't start. I'm going to have a look at the user documentation for NUT: http://www.networkupstools.org/docs/user-manual.chunked/index.html

BTW, is there anyone out there with a working APC Back-UPS CS 650 in FreeNAS 8? Would be interesting to know.
 

McBrian

Dabbler
Joined
Oct 4, 2011
Messages
14
Ok I've done some more testing on FreeNAS 7. Here is the driver that works for my UPS:

Code:
driver.name: usbhid-ups
driver.parameter.port: /dev/ugen0
driver.version: 2.6.0
driver.version.data: APC HID 0.95
driver.version.internal: 0.35


With this driver everything works. I just inserted it into FreeNAS 0.7.2.8191. I didn't have to change any config files. It just works, to paraphrase the late mr Jobs. The email notification service, auto shutdown and so forth.

I am of course tempted to just keep this setup now. But I am still inclined to go for FreeNAS 8, mostly because it is built around a more mature version of ZFS. So I will give it another try, but my focus will be on the driver file. Again, thanks to everyone trying to help. Appreciate it.
 

bjobol

Cadet
Joined
Oct 13, 2011
Messages
2
Ok I've done some more testing on FreeNAS 7. Here is the driver that works for my UPS:

Code:
driver.name: usbhid-ups
driver.parameter.port: /dev/ugen0
driver.version: 2.6.0
driver.version.data: APC HID 0.95
driver.version.internal: 0.35


With this driver everything works. I just inserted it into FreeNAS 0.7.2.8191. I didn't have to change any config files. It just works, to paraphrase the late mr Jobs. The email notification service, auto shutdown and so forth.

I am of course tempted to just keep this setup now. But I am still inclined to go for FreeNAS 8, mostly because it is built around a more mature version of ZFS. So I will give it another try, but my focus will be on the driver file. Again, thanks to everyone trying to help. Appreciate it.

Looks like it's working for me as well after following your instruction.

Thanks!

I haven't done a real test by cutting the power, but the ups is definately communicating with Freenas now.

It would be great if there is a function which takes down Freenas when the UPS has, let's say 10% battery left.
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
It would be great if there is a function which takes down Freenas when the UPS has, let's say 10% battery left.

Shutdown mode: UPS reaches low battery?

Some implementations of UPS monitoring allow the user to specify the "low battery" threshold, ie. 10%, 20% etc. That might be a nice addition for FreeNAS (ReadyNAS has this facility).
 

cbray

Explorer
Joined
Jun 16, 2011
Messages
68
UPS service identifier bug ?

Hi youins,

While playing with setting up FN 8.0.2-64 again, I ran into a bug/idiosyncrasy.

When I change the IDENTIFIER field from 'ups' to 'APC UPS' my UPS service would no longer start.

So, if your UPS service won't start, check that Identifier field is 'ups'

Devs might want to look into it... :confused:

Thanks,

CB :)

I apologize in advance if someone already pointed this out, there's a lot of UPS related posts, too many to read 'em all.
 

zerg

Dabbler
Joined
Sep 26, 2011
Messages
16
NUT usbhid_ups driver from 2.4.3 version of NUT needed

FreeNAS 8.02 still uses NUT 2.4.1 version of NUT and usb version of my Powercom BlackKnight is not supported in this version. But it is supported in 2.4.3 version.

Is it possible simply to change driver file or I should update whole NUT?
If so^ how to update NUT to 2.4.3?

P.S. Freenas AMD64 version
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
Hi youins,

While playing with setting up FN 8.0.2-64 again, I ran into a bug/idiosyncrasy.

When I change the IDENTIFIER field from 'ups' to 'APC UPS' my UPS service would no longer start.

So, if your UPS service won't start, check that Identifier field is 'ups'

Devs might want to look into it... :confused:

Thanks,

CB :)

I apologize in advance if someone already pointed this out, there's a lot of UPS related posts, too many to read 'em all.

Spaces are not allowed AFAIK.. did you try anything else, without spaces?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
FreeNAS 8.02 still uses NUT 2.4.1 version of NUT and usb version of my Powercom BlackKnight is not supported in this version. But it is supported in 2.4.3 version.

Is it possible simply to change driver file or I should update whole NUT?
If so^ how to update NUT to 2.4.3?

P.S. Freenas AMD64 version

Zerg, please read some of the earlier posts in this thread where it was discussed about updating NUT. I'll *try* and test it to see what happens, but it might have problems.
 

cbray

Explorer
Joined
Jun 16, 2011
Messages
68
Don't use spaces in the UPS 'identifier' field.

Thanks WG,

The spaces did cause the problem... 'upsAPC' worked fine.

Peace,
CB
 

Hi-Liter

Explorer
Joined
Oct 6, 2011
Messages
83
By now, FreeNAS 8.3.0 is released, and still the UPS module does not seem to be fixed!
Issue number 1 seems to be just a GUI problem:
When I select my UPS model in the UPS Service Options (APC ups 2 Back-UPS USB USB (usbhid-ups)), close the dialog by clicking 'Ok' and then immediately open the dialog again, a different model is selected (Tripp-Lite ups 2 smart2200RMXL2U USB, newer models (usbhid-ups)) - same driver though.

When I then try to start the service, I get the following in the console log:
Code:
Dec  7 19:21:18 Schnigges-NAS notifier: nut not running? (check /var/db/nut/upsd.pid).
Dec  7 19:21:18 Schnigges-NAS notifier: nut_upsmon not running? (check /var/db/nut/upsmon.pid).
Dec  7 19:21:19 Schnigges-NAS notifier: nut_upslog not running? (check /var/db/nut/upslog.pid).
Dec  7 19:21:19 Schnigges-NAS notifier: Will not 'restart' nut because nut_enable is NO.
Dec  7 19:21:19 Schnigges-NAS notifier: Will not 'restart' nut_upsmon because nut_upsmon_enable is NO.
Dec  7 19:21:19 Schnigges-NAS notifier: Will not 'restart' nut_upslog because nut_upslog_enable is NO.
Dec  7 19:21:28 Schnigges-NAS notifier: nut not running? (check /var/db/nut/upsd.pid).
Dec  7 19:21:28 Schnigges-NAS notifier: nut_upsmon not running? (check /var/db/nut/upsmon.pid).
Dec  7 19:21:28 Schnigges-NAS notifier: nut_upslog not running? (check /var/db/nut/upslog.pid).
Dec  7 19:21:28 Schnigges-NAS notifier: nut not running? (check /var/db/nut/upsd.pid).
Dec  7 19:21:29 Schnigges-NAS notifier: Using subdriver: APC HID 0.95
Dec  7 19:21:29 Schnigges-NAS notifier: Network UPS Tools - Generic HID driver 0.37 (2.6.5)
Dec  7 19:21:29 Schnigges-NAS notifier: USB communication driver 0.31
Dec  7 19:21:29 Schnigges-NAS notifier: libusb_get_report: Unknown error
Dec  7 19:21:29 Schnigges-NAS notifier: Can't initialize data from HID UPS
Dec  7 19:21:29 Schnigges-NAS notifier: Driver failed to start (exit status=1)
Dec  7 19:21:29 Schnigges-NAS notifier: Network UPS Tools - UPS driver controller 2.6.5
Dec  7 19:21:29 Schnigges-NAS root: /usr/local/etc/rc.d/nut: WARNING: failed precmd routine for nut
Dec  7 19:21:29 Schnigges-NAS notifier: /usr/local/etc/rc.d/nut: WARNING: failed precmd routine for nut
Dec  7 19:21:29 Schnigges-NAS notifier: nut_upsmon not running? (check /var/db/nut/upsmon.pid).
Dec  7 19:21:29 Schnigges-NAS notifier: Starting nut_upsmon.
Dec  7 19:21:29 Schnigges-NAS notifier: fopen /var/db/nut/upsmon.pid: No such file or directory
Dec  7 19:21:29 Schnigges-NAS notifier: UPS: ups (master) (power value 1)
Dec  7 19:21:29 Schnigges-NAS upsmon[83806]: UPS [ups]: connect failed: Connection failure: Connection refused


I have an APC Back-UPS 350 and am running FreeNAS-8.3.0-RELEASE-x64 (r12701M).
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I'd recommend you put in a ticket at support.freenas.org
 
Status
Not open for further replies.
Top