[Plugin] NUT v2 - Network UPS Tools


dmacias

Recommended Posts

Hi !

 

I have a problem from few time ago.

 

My UPS does not appear anymore on NUT Unraid and NUT pluging always stay on status : Stopped

 

My UPS is a Eaton Evolution S 3000VA  and i have setted up the plugin with : Standalone, usbhid-ups but plugin always stay Stopped

In my Log I can see this

 

Oct 3 17:58:27 NAS kernel: usb 1-1.2: new low-speed USB device number 4 using ehci-pci
Oct 3 17:58:44 NAS kernel: usbhid 1-1.2:1.0: can't add hid device: -32
Oct 3 17:58:44 NAS kernel: usbhid: probe of 1-1.2:1.0 failed with error -32
Oct 3 17:58:44 NAS kernel: usb 1-1-port2: disabled by hub (EMI?), re-enabling...
Oct 3 17:58:44 NAS kernel: usb 1-1.2: USB disconnect, device number 4

 

 

Any tip to fix it ?

 

Thanks.

Edited by Kx2000
Link to comment
4 hours ago, Pirate said:

I did try a USB to serial, but had no luck with either Nut or Native APC UPS.

So i bought a internal com bracket to try to get serial connection to work but no luck with that either.

I got the ups to work in a windows machine with powercom:s own software and the USB to serial cable without any problems.

Everything i try in nut doesn´t work, if i edit the manual config with the values i found online, Nut doesn´t eaven start.

Maybe all the UPS driver isnt in this package only the USB ones?

Accordint to the Nut page, powercom should use custom powercom driver but when i assign it it says:

Tower upsd[5472]: Can't connect to UPS [ups] (powercom-ups): No such file or directory

Could you do some diagnostics as below link, first confirm Unraid could communicate to UPS, then NUT or APCUPSD

https://www.cyberciti.biz/hardware/5-linux-unix-commands-for-connecting-to-the-serial-console/

 

For serial access APC UPS, a ctrl key need to submit to activate first.

I know you are not use APC, but you should found a way to verify communication work or not, you may try APC access method to your UPS.

 

The init keypress should be "SHIFT + Y" ( 2400 buad )

 

Make sure that there is no application that is using the serial port. For testing you can use Putty and set the port settings to 2400-8-None-1-XOn/XOff. Once you are on the Putty screen press "Shift+Y", this should return an SM on the screen. Press "Shift+A" after seeing SM and this should produce a beep and the LEDs in front should flash once.

 

http://www.joeteck.com/apc.htm

 

But if APCUPSD or NUT not support Powercom's UPS, then you are no luck.

 

NUT should support

https://www.systutorials.com/docs/linux/man/8-powercom/

 

Edited by Benson
Link to comment
2 hours ago, Benson said:

Could you do some diagnostics as below link, first confirm Unraid could communicate to UPS, then NUT or APCUPSD

https://www.cyberciti.biz/hardware/5-linux-unix-commands-for-connecting-to-the-serial-console/

 

For serial access APC UPS, a ctrl key need to submit to activate first.

I know you are not use APC, but you should found a way to verify communication work or not, you may try APC access method to your UPS.

 

The init keypress should be "SHIFT + Y" ( 2400 buad )

 

Make sure that there is no application that is using the serial port. For testing you can use Putty and set the port settings to 2400-8-None-1-XOn/XOff. Once you are on the Putty screen press "Shift+Y", this should return an SM on the screen. Press "Shift+A" after seeing SM and this should produce a beep and the LEDs in front should flash once.

 

http://www.joeteck.com/apc.htm

 

But if APCUPSD or NUT not support Powercom's UPS, then you are no luck.

 

NUT should support

https://www.systutorials.com/docs/linux/man/8-powercom/

 

Thanks for the help, tried to go back to USB converter, but still bashing my head.

 

nut.conf:

MODE=standalone

 

ups.conf:

[powercom]    
driver = powercom
port = /dev/ttyUSB0
type = BNT
numOfBytesFromUPS = 16
methodOfFlowControl = no_flow_control
validationSequence = {{11,0x42},{8,0},{8,0}}
shutdownArguments = {{1,30},y}

What happens when i try to start it:

 

root@Tower:/etc/rc.d# rc.nut start
Writing nut config
Updating permissions...
Network UPS Tools - UPS driver controller 2.7.4.1
Network UPS Tools - PowerCom protocol UPS driver 0.18 (2.7.4.1)
data receiving error (validation check)
data receiving error (validation check)
Network UPS Tools upsd 2.7.4.1
fopen /var/run/nut/upsd.pid: No such file or directory
listening on 127.0.0.1 port 3493
listening on ::1 port 3493
Connected to UPS [powercom]: powercom-powercom
Network UPS Tools upsmon 2.7.4.1
fopen /var/run/nut/upsmon.pid: No such file or directory
UPS: powercom@localhost (master) (power value 1)
Warning: no shutdown command defined!
 

am i missing something in my config?

Link to comment
On 10/3/2019 at 6:15 PM, Benson said:

Could you do some diagnostics as below link, first confirm Unraid could communicate to UPS, then NUT or APCUPSD

https://www.cyberciti.biz/hardware/5-linux-unix-commands-for-connecting-to-the-serial-console/

 

For serial access APC UPS, a ctrl key need to submit to activate first.

I know you are not use APC, but you should found a way to verify communication work or not, you may try APC access method to your UPS.

 

The init keypress should be "SHIFT + Y" ( 2400 buad )

 

Make sure that there is no application that is using the serial port. For testing you can use Putty and set the port settings to 2400-8-None-1-XOn/XOff. Once you are on the Putty screen press "Shift+Y", this should return an SM on the screen. Press "Shift+A" after seeing SM and this should produce a beep and the LEDs in front should flash once.

 

http://www.joeteck.com/apc.htm

 

But if APCUPSD or NUT not support Powercom's UPS, then you are no luck.

 

NUT should support

https://www.systutorials.com/docs/linux/man/8-powercom/

 

 

On 10/3/2019 at 4:56 PM, TechMed said:

Hi @Pirate,

 

I realize this is not a direct answer, but I am having similar problems but with a CyberPower unit. I have dome everything but witchcraft to try to make NUT talk to it; including buying the $100 network card. I think it may have something to do with remnants of NUT files, from previous install attempts of NUT, floating around that I cannot find and they need to be removed for a clean reinstall of NUT. I follow this thread so maybe if you find answer, would you be so kind as to post it? I have three servers i would love to use NUT with... but cannot. -Thanks!

Was tinkering a bit with the USB to Serial converter but never manage to get it going, switched back to Serial and actual got it working this time.

 

Settings as follow:

 

nut.conf

MODE = standalone

ups.conf:

[ups]    
driver = powercom
port = /dev/ttyS0
type = BNT-other
#numOfBytesFromUPS = 16
#methodOfFlowControl = no_flow_control
#validationSequence = {{8,0},{8,0},{8,0}}
#shutdownArguments = {{1,30},y}
#frequency = {0.00027778,0.0000}
#loadPercentage = {1.0000,0.0,1.0000,0.0}
#batteryPercentage = {1.0000,0.0000,0.0000,1.0000,0.0000}
#voltage = {2.0000,0.0000,2.0000,0.0000}

I did use the # settings 1 time and after that the ups worked, after i got it working i added# and it still worked.

 

upsmon.conf

MONITOR ups@localhost 1 monuser monpass master

The weird thing is that i used those settings earlier and they didnt work, might have been that i newer rebooted after installing nut, cause while i was tinkering i got it working (used terminal and started and stopped nut manually between each edit so i could see what it did).

But it didnt display any nut detail or ups status, thou after a restart its all working.

Thanks for the help Benson.

 

ups.JPG

Edited by Pirate
  • Like 1
Link to comment
10 minutes ago, TechMed said:

Making me crazy I've got three servers, this honking UPS, and cannot do anything with it.

If you can't get the existing machines to talk directly to the UPS, you do have other options. Perhaps you could use a raspberry pi to talk directly to the UPS and then relay the information over the network, or you could get a very cheap UPS that will connect to the server with USB,  use that to do your shutdown timing, and don't even plug anything critical into the power portion.

  • Like 1
Link to comment
14 minutes ago, TechMed said:

Hi @Pirate,

 

Thanks for sharing your config. I need to do a deep dive into this over the weekend. Making me crazy I've got three servers, this honking UPS, and cannot do anything with it. Congrats on getting it figured out though!!! 👏

 

Have a good one!

 

Easiest is to start and stop nut in cli, so u see what error it reports.

 

/etc/rc.d/rc.nut start and rc.nut stop

 

So change settings, start nut in cli and see what it says.

  • Like 1
Link to comment
On 10/3/2019 at 11:49 PM, Kx2000 said:

Hi !

 

I have a problem from few time ago.

 

My UPS does not appear anymore on NUT Unraid and NUT pluging always stay on status : Stopped

 

My UPS is a Eaton Evolution S 3000VA  and i have setted up the plugin with : Standalone, usbhid-ups but plugin always stay Stopped

In my Log I can see this

 

Oct 3 17:58:27 NAS kernel: usb 1-1.2: new low-speed USB device number 4 using ehci-pci
Oct 3 17:58:44 NAS kernel: usbhid 1-1.2:1.0: can't add hid device: -32
Oct 3 17:58:44 NAS kernel: usbhid: probe of 1-1.2:1.0 failed with error -32
Oct 3 17:58:44 NAS kernel: usb 1-1-port2: disabled by hub (EMI?), re-enabling...
Oct 3 17:58:44 NAS kernel: usb 1-1.2: USB disconnect, device number 4

 

 

Any tip to fix it ?

 

Thanks.

I haven't idea what error means -32, but message seems show the device was disable by Hub ( or other device ). It also show abnormal "low-speed USB" and "EMI". Pls try different USB port.

 

Oct 3 17:58:44 NAS kernel: usb 1-1-port2: disabled by hub (EMI?), re-enabling...

 

Or it may be some old version PL2303 chip not support, then you need another one.

http://www.prolific.com.tw/US/newsdetail.aspx?news_id=35 ( I have this one and confirm no problem in current ver Unraid )

 

 

Below is my one dmesg output when plug in Unraid

 

[   51.593250] usb 1-7: USB disconnect, device number 2
[   57.923000] usb 1-7: new full-speed USB device number 4 using xhci_hcd
[   58.053294] usbcore: registered new interface driver pl2303
[   58.053298] usbserial: USB Serial support registered for pl2303
[   58.053302] pl2303 1-7:1.0: pl2303 converter detected
[   58.053984] usb 1-7: pl2303 converter now attached to ttyUSB0
 

Edited by Benson
Link to comment
5 hours ago, Pirate said:

Was tinkering a bit with the USB to Serial converter but never manage to get it going, switched back to Serial and actual got it working this time.

I belive the problem of converter not work is because those converter native was TTL signal level ( 0v, 3.3/5v ), but RS232 was ( +12v -12v ). You need a voltage shifter or the converter have build in voltage shifter.

 

Below is the one I have which build-in voltage shifter ( also PL2303 )

https://www.aten.com/global/en/products/usb-&-thunderbolt/usb-converters/uc232a/

Edited by Benson
Link to comment
7 hours ago, Benson said:

I belive the problem of converter not work is because those converter native was TTL signal level ( 0v, 3.3/5v ), but RS232 was ( +12v -12v ). You need a voltage shifter or the converter have build in voltage shifter.

 

Below is the one I have which build-in voltage shifter ( also PL2303 )

https://www.aten.com/global/en/products/usb-&-thunderbolt/usb-converters/uc232a/

The converter worked in windows though.

But i got it working with serial so im pleased with that.  

Link to comment

Nothing append when I plug USB on my laptop Windows

Nothing append on NAS too when i re plug USB on any 4 ports.

 

Device not listed in "system Devices" section on Unraid.

 

I also have a console RS232 cable... how to install my  UPS by this way on unraid ?

 

Thanks.

Link to comment
4 hours ago, Kx2000 said:

What is dmesg ?

At console or terminal, type 'dmesg', post any message when plug or unplug UPS with USB.

Does you try Windows communicate with UPS ?

 

7 hours ago, Kx2000 said:

I also have a console RS232 cable...

You need confirm does your UPS support serial access first.

 

If according NUT support list, your Eaton UPS seems only support USB access method.

https://networkupstools.org/stable-hcl.html

Edited by Benson
Link to comment

Yes I have both options, USB or Console RS232 port via RJ45

 

dmesg not show anything when i Plug the USB cable

 

And Yes, i've tried on Windows but it not detect anything too...

 

The only thing that i never do is to power off and on the UPS itself, I need to shutdown all my network to do this, i will try soon.

 

 

Link to comment
9 hours ago, Kx2000 said:

The only thing that i never do is to power off and on the UPS itself, I need to shutdown all my network to do this, i will try soon.

Sound good.

 

If not work, I think you shoud try a different or shorter USB cable or insert a USB hub in between.

https://askubuntu.com/questions/966070/eaton-mge-5e-ups-driver-not-working

 

For serial access (RJ45), you may try MGE DB9-RJ45 cable

https://networkupstools.org/cables.html#_mge_office_protection_systems

 

 

And need change the drive too

https://networkupstools.org/docs/man/mge-shut.html

 

Evolution S 1250/1750/2500/3000 VA
USB port

usbhid-ups

 

Evolution S 1250/1750/2500/3000 VA
Serial port

mge-shut or oldmge-shut

 

Edited by Benson
Link to comment

AMAZING!!!

@jonathanm AND @Pirate

 

Thanks for the help.

 

On 10/4/2019 at 3:38 PM, Pirate said:

Easiest is to start and stop nut in cli, so u see what error it reports.

 

/etc/rc.d/rc.nut start and rc.nut stop

 

So change settings, start nut in cli and see what it says.

I used the START and STOP as suggested and kept getting nothing but errors, all of which were PORT related. I tried scoping out the USB ports and then tried a SERIAL connection... same thing. Weird part is, in APCUPSD both the USB and SERIAL worked fine!?

 

Ergo, more research.

The LAST thing I wanted to do was buy more hardware! (I really do want to play with some of the ODROID's and R-Pi's though!)

Then like the proverbial slap upside the head, it hit me... I have two other (smaller) CyberPower (CP) units runiing the modem, router, etc. I've tried everything else, why not try Jonathanm's suggestion about the "very cheap UPS?"

On 10/4/2019 at 3:36 PM, jonathanm said:

If you can't get the existing machines to talk directly to the UPS, you do have other options. Perhaps you could use a raspberry pi to talk directly to the UPS and then relay the information over the network, or you could get a very cheap UPS that will connect to the server with USB,  use that to do your shutdown

timing, and don't even plug anything critical into the power portion.

IT WORKED!!!!

I plugged the USB cable into the one smaller CP unit.

Now the servers and the "very cheap UPS" (VCUPS) are chatting like old ladies playing Canasta! hahahaha

 

Thanks to you both for the assist in FINALLY getting this up and running.

 

Now, I would like to ask for a 'math check'

The big CP OR2200LCDRTXL2U, under normal load, has a max of 45 minutes run time.

The VCUPS has a run time of 100 minutes under normal load.

Since the VCUPS is the 'master' in this setup, if I set it (master), and the 'slave' to both shutdown at "Run time left to initiate shutdown (minutes)" of 75, then that should give me an ~20 minute buffer for the servers to shutdown, correct?

So:

VCUPS gets to 75 minutes

The big CP unit is at about 20 minutes

 

Does this sound about right?

 

 

Link to comment
2 minutes ago, TechMed said:

Does this sound about right?

I would not use time or capacity remaining as my benchmark for shutdown. Unless you have alternate major power available like a back up generator, it's much better for the equipment to get things shut down in an orderly fashion ASAP after you determine it's not a minor blip. Around here, if the power is out more than a minute or so, it's going to be out much longer than my battery backups can handle (roughly 1 hour)

 

Here is how I work things. All my hosted VM's and various other non critical machines start shutdown at Power loss + 3 minutes. The servers start staggered shutdown based on priority about 3 minutes later. The main server starts shutdown at power loss + 10, hopefully everything is shut down in an orderly fashion by power loss + 20. That leaves roughly 60% capacity left in my batteries, which for typical SLA that are in my UPS is about optimal for long life. Running those types of batteries below 30% remaining or so is very hard on them. Also, when the power returns, I'm confident I can start the equipment back up pretty much right away, if you drain the batteries below 50% you may not have enough charge if the power goes out again. It takes most battery backups about 10X the outage time to recharge, so if you run on batteries for 30 minutes, you probably won't be at full charge until 5 hours or more.

Link to comment
10 hours ago, TechMed said:

All very good points; I didn't really think about the battery longevity either.

 

So set everything to zero, but "Time on battery before shutdown (seconds)" should be set to xx seconds, yy seconds, zz seconds, etc.

 

Yes?

Yep. What I would do is run through the scenario of what sequence you would shut down if you knew power was going to be cut dead in exactly 30 minutes. Keep in mind the whole network infrastructure must stay powered the entire time until every managed device is successfully shut down, and the server broadcasting the info must stay up until all those devices have committed to shutdown.

 

The cool thing about managing things this way is that it's easy to test your plan. Plug the signalling UPS into a power strip so you can cut the power without unplugging it, transfer all the loads on it to another power source, turn off the power to the UPS and watch your automation in action. Hopefully it all gracefully shuts down while sending you status messages along the way, but if it doesn't you can troubleshoot. With a single broadcast controlling everything it's easy to stagger shutdowns so each process can be monitored.

Link to comment
17 hours ago, Kx2000 said:

I have tried to reboot UPS without success I will try a different USB Cable

And try to install it with mge-shut... but I need a how-to... add driver on nut.

 

Thanks.

 

On 10/6/2019 at 10:48 AM, Benson said:

Evolution S 1250/1750/2500/3000 VA
USB port

usbhid-ups

 

Evolution S 1250/1750/2500/3000 VA
Serial port

mge-shut or oldmge-shut

Pls note, when use USB then driver was "usbhid-ups", if Serial then try "mge-shut". If use Serial you also need build a cable and change the driver in NUT config page as below.

 

nut.thumb.PNG.b0b9a2f129077140ff149a37b9c55cc0.PNG

 

You should got something like below when start NUT service. ( For Serial mge-shut )

 

Writing nut config
Updating permissions...
Network UPS Tools - UPS driver controller 2.7.4.1
Network UPS Tools - Generic HID driver 0.53 (2.7.4.1)
SHUT communication driver 0.93
Warning: This is an experimental driver.
Some features may not function correctly.

No matching HID UPS found
Driver failed to start (exit status=1)

 

Best you could fix the USB problem, this make thing more simple.

Edited by Benson
Link to comment

I've tried to replace USB cable without success... There is always nothing appear in log or listed USB devices.

 

I try to use USB-RS232 (Cisco) cable but when I set port=ttyS0

and when I run nut start script. there is a

Unable to open ttyS0: No such file or directory

Things to try:

 - Check 'port=' in ups.conf

 - Check owner/permissions of all parts of path

 

Do I need to reboot server before ?

 

 

Link to comment
5 hours ago, Kx2000 said:

I've tried to replace USB cable without success... There is always nothing appear in log or listed USB devices.

 

I try to use USB-RS232 (Cisco) cable but when I set port=ttyS0

and when I run nut start script. there is a

Unable to open ttyS0: No such file or directory

Things to try:

 - Check 'port=' in ups.conf

 - Check owner/permissions of all parts of path

 

Do I need to reboot server before ?

 

 

Cisco RJ45-DB9 (rs232, serial, console) cable is not pin compatible with Eaton / APC / Tripp-lite / et cetera. You need to make your own or buy a correct one.

 

Sad truth is every maker makes their own version not pin compatible with others.

 

Other important thing is that baud rate is correct, because some ups wont respond to incorrect baud (such as APC) 

Edited by fireflower
Link to comment
  • Rysz featured this topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.