Configure APC UPS with TrueNas

saNeurT

Dabbler
Joined
Jan 12, 2021
Messages
17
Hi everyone,
I recently bought this UPS from APC: https://www.apc.com/shop/us/en/prod...-USB-Type-C-and-A-charging-ports/P-BE850G2-GR
(BE850G2).

Which driver should I choose from `Services > UPS` menu in TrueNas? Is `APC ups 2 Back-UPS USB USB (usbhid-ups)` the correct one?

Also, what do I need to configure it? Should I connect a USB cable between the TrueNas hardware and the APC UPS?
What about the Data Line Protection port? Should I connect my TrueNas hardware to the RJ45 port in the UPS, which is then connected to my router?

Thanks in advance for the help
 
Joined
Jun 2, 2019
Messages
591
You need to buy the APC Serial to USB cable.


Screen Shot 2021-07-28 at 10.09.03 AM.png


TrueNAS uses NUT


Screen Shot 2021-07-28 at 10.04.47 AM.png
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
What about the Data Line Protection port? Should I connect my TrueNas hardware to the RJ45 port in the UPS, which is then connected to my router?
Absolutely not. That's to protect a phone line (dates back to when the data line was the phone line = dialup).
 
Joined
Jun 2, 2019
Messages
591
The manual implies it can be used for network surge suppression, but only up to 10/100 Mbps. Regardless, I would not use it except for an incoming DSL line.

Screen Shot 2021-07-28 at 11.42.14 AM.png


This is assuming the link in the OP is for the correct UPS and not this one. https://www.apc.com/shop/us/en/products/Back-UPS-850VA-2-USB-charging-ports/P-BE850G2. The OP linked to a 220 VAC unit for Great Britain (GB), but his profile lists in US. If the manual in the OP is incorrect, the UPS already comes with a USB-A to B cable and does not have a DSL surge protection connection.
 
Last edited:

saNeurT

Dabbler
Joined
Jan 12, 2021
Messages
17
The manual implies it can be used for network surge suppression, but only up to 10/100 Mbps. Regardless, I would not use it except for an incoming DSL line.

View attachment 48569

This is assuming the link in the OP is for the correct UPS and not this one. https://www.apc.com/shop/us/en/products/Back-UPS-850VA-2-USB-charging-ports/P-BE850G2. The OP linked to a 220 VAC unit for Great Britain (GB), but his profile lists in US. If the manual in the OP is incorrect, the UPS already comes with a USB-A to B cable and does not have a DSL surge protection connection.

The link I shared is the correct one. I own that specific model. I did not find any cable inside the package tho.
 
Joined
Jun 2, 2019
Messages
591

saNeurT

Dabbler
Joined
Jan 12, 2021
Messages
17
Also, regarding the AP9827 cable, they sell it on Amazon (APC Official Store) for 53,74 €, and for 60,99 € from the official APC.com shop... It's really a lot for a single cable.


I found an alternative: https://www.startech.com/en-us/cables/usbups06
They say: "The USBUPS06 6-foot Smart UPS Replacement USB Cable features 1 USB Type 'A' (male) connector and 1 10-Pin RJ45 male connector, allowing you to communicate from your computer, work station or server to your UPS power supply. Our affordable and cost-effective USB UPS cable can be used as a direct replacement to the AP9827, providing you with the same capabilities at an inexpensive price."

On Amazon is around 30€. Should I buy this one, or avoid it and go for the original APC one?
 
Joined
Jun 2, 2019
Messages
591
Thank you. What about the driver to choose in TrueNas? Also, what settings do you advice me to choose?

Read my previous post for driver. Pick the generic APC Back-UPS USB model, they all use the same driver


Default settings are acceptable, but you can increase the shutdown timer depending on the calculated UPS runtime based on your load.


If you want to receive alerts, you will need to set an email address in UPS services settings, and for the root account.

Code:
Services, UPS

Code:
Accounts, Users, root


And enable email notifications.

Code:
System, Email


You can set ups monitor user and password to enable other devices on your network to monitor the UPS and automatically shutdown if you install NUT on those clients.

 
Last edited:
Joined
Jun 2, 2019
Messages
591
On Amazon is around 30€. Should I buy this one, or avoid it and go for the original APC one?

There are several manufacturers of USB to serial chips (FTDI, Prolific, etc.) embedded in the cable, which should be supported by the Linux kernel TrueNAS runs on, and the RJ45 serial port pinout can vary between manufacturers (Cisco, APC, RS-232, etc.)

That alternative cable will likely work, but if want to eliminate uncertainty, go with the APC cable.
 

saNeurT

Dabbler
Joined
Jan 12, 2021
Messages
17
Thank you for the help!

What should I insert in `Shutdown Command`?
Also, is there a way to say to TrueNas to automatically start, after the UPS is not anymore on battery?
 
Joined
Jun 2, 2019
Messages
591
What should I insert in `Shutdown Command`?

I believe the default settings will already shutdown the system once the timer expires

Code:
root@NAS-1[/usr/local/etc/nut]# pwd
/usr/local/etc/nut
root@NAS-1[/usr/local/etc/nut]# cat upsmon.conf
MONITOR apcups@192.168.69.5:3493 1 apcups apcups SLAVE
NOTIFYCMD "/usr/local/sbin/upssched"
NOTIFYFLAG ONBATT SYSLOG+EXEC
NOTIFYFLAG LOWBATT SYSLOG+EXEC
NOTIFYFLAG ONLINE SYSLOG+EXEC
NOTIFYFLAG COMMBAD SYSLOG+EXEC
NOTIFYFLAG COMMOK SYSLOG+EXEC
NOTIFYFLAG REPLBATT SYSLOG+EXEC
NOTIFYFLAG NOCOMM SYSLOG+EXEC
NOTIFYFLAG FSD SYSLOG+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+EXEC
SHUTDOWNCMD "/sbin/shutdown -p now"
POWERDOWNFLAG /etc/nokillpower
HOSTSYNC 15


Also, is there a way to say to TrueNas to automatically start, after the UPS is not anymore on battery?

It's a delicate balance between setting a longer shutdown timer to avoid unnecessarily shutting down the system due to intermittent power loss due to storms, and how long your UPS will provide power to your NAS based on calculated run time.

1. If the NAS is shutdown, but UPS is still powered, you can enable WOL in the BIOS to allow you to send the magic WOL packets to the NAS from another client. https://www.howtogeek.com/70374/how-to-geek-explains-what-is-wake-on-lan-and-how-do-i-enable-it/. I've never actually used it.

2. If the NAS is shutdown and UPS has powered off, you can change the power state option in BIOS to power up the NAS back up once the UPS is powered. setup-computer-to-auto-power-on-after-power-outage. Some more advanced UPSs can be set to automatically power back up when AC power is restored.

My UPS is currently calculating 41 minutes run time, so I set the shutdown timer to 300 seconds (5 min) as I live in an area with frequent momentary power outages when severe thunderstorms are in the area. I set my UPS and NAS to not automatically power back up in the event power is extremely intermittent during a hurricane.
 
Top