UPS and NUT appears to work selecting any USB port? Odd Behavior

Status
Not open for further replies.

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I was unfortunately forced into reinstalling FreeNAS and rebuilding my pool from scratch (It was easier than figuring out what the heck was going on, long story!) and during my configuration setup I discovered something very odd and maybe this has been discussed, maybe not (a search didn't find it for me) but here is the deal...

I couldn't recall which USB port my UPS was reporting on so I picked one at random (/dev/ugen0.1) and popped into a shell and entered the following
Code:
[root@freenas] ~# upsc -l
ups
And then
Code:
[root@freenas] ~# uspc ups
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: 2001/09/25
battery.mfr.date: 2011/03/09
battery.runtime: 4192
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 27.3
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Back-UPS BR1000G
device.serial: 3B1111X16679
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ugen0.1
driver.version: 2.7.1
driver.version.data: APC HID 0.95
driver.version.internal: 0.38
input.sensitivity: medium
input.transfer.high: 147
input.transfer.low: 88
input.transfer.reason: input voltage out of range
input.voltage: 122.0
input.voltage.nominal: 120
ups.beeper.status: disabled
ups.delay.shutdown: 20
ups.firmware: 868.L2 .D
ups.firmware.aux: L2
ups.load: 15
ups.mfr: American Power Conversion
ups.mfr.date: 2011/03/09
ups.model: Back-UPS BR1000G
ups.productid: 0002
ups.realpower.nominal: 600
ups.serial: 3B1111X16679
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d

And as you can see it returned all my UPS data and it was communicating just fine with the UPS. So it looks like I got lucky. Oh, the driver is usbhid-ups for my particular unit.

But wait, too good to be true, so I reconfigured to port (/dev/ugen5.1) and it works as well. I reconfigured to six of the nine USB ports and they all worked fine. I just finished running to the basement and pulled the USB cord to find out what the port number really was (/dev/ugen0.2) and configured appropriately because I don't know if this is a fluke or something that will be supported from here on out.

Now I'm not complaining, I'm happy it's working like that but I want to know if this was intentional or am I in a unique situation.

My system specs are in my signature.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
It's because you bought AMD and that stuff is total crap! ;)

Ok, I kid. But honestly, I don't know. I'll be doing UPS stuff on my box a little later today so I'll try this on my system. ;)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
AMD, yea that's the ticket. Now if IPMI would magically appear I'd be set o_O

I'm curious what your results are. I thought you were not upgrading to 9.2.1.6, or at least not for a while, but then again this behavior could have been around before 9.2.1.6, I never tested it out.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
So, further data point, I unplugged everything today (I had a fan fail in the case, so I was replacing it), and when I put everything back in (keyboard, mouse, UPS, boot drive), I did so willy-nilly.

When the system came back up, the UPS was not reachable, and only the correct setting would communicate with it. So I can tell you on my box, it was the correct USB port, or nothing. So I do not experience this with my setup.

I'm on FreeNAS 9.2.0 with a SuperMicro X10SLM
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
DrKK,
Thanks for that information, it's a good data point as you said, and that doesn't surprise me at all. After all that is what we expect to see.

Cheers
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
Joe, I had a problem when I upgraded my consumer-class hardware to server-class mobo, ram and processor a few weeks ago. After upgrading the hardware and rebooting with the same 9.2.1.6 USB stick I was getting errors that FN kept dropping communication with the UPS. I eventually realized that FN was looking for the UPS on the old motherboard USB port; so I hot unplugged the USB and plugged it back into the same port while watching the screen to see which new port number this was. I then went in to the UPS settings and set that port. Did that work? NO! Why? I have no idea, I still got errors that the driver was wrong and that the communication kept dropping.

A week later I replaced a case fan; so I did a full shutdown. Before reboot I decided to unplug the UPS to try one last attempt at fixing this error. With FN back up I watched the ticker window at the bottom of the UI as I plugged the UPS into a different port. I took note of the port and made the appropriate changes, including reselecting the UPS model #. It worked! I just checked my logs and I haven't had any communication errors since the port change a week ago.

I suspect that a hot unplug/replug was not sufficient and that a reboot with a cold replug was required. I'm sure the new port helped too.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
@diedrichg,
Since you have things working now and are running 9.2.1.6, could you stop the UPS service and change the USB port to something different and then restart the UPS service? What happens? Also, which driver are you using? Maybe what I'm seeing is unique to the driver, I don't know.
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
I won't be home until Tuesday but I'll get back to you on both this and the sticker question.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
3656917-magic-spongebob-300x225.jpg


Seriously, though: This is so close to being creepy that I'm going to try it out when my UPS arrives.
 
Status
Not open for further replies.
Top