What's new

Entware Asus Merlin Entware NUT Server

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Also, what kernel modules do you load before starting NUT? There are three additional kernel modules that I had to load.

I tried appending my start up script, but the site is blocking on keyword search. I can do a paste bin if you like.

The kernel modules are


KERN=$(uname -r)
/lib/modules/${KERN}/kernel/drivers/input/input-core.ko
/lib/modules/${KERN}/kernel/drivers/hid/hid.ko
/lib/modules/${KERN}/kernel/drivers/hid/usbhid/usbhid.ko
 
Also, what kernel modules do you load before starting NUT? There are three additional kernel modules that I had to load.

I tried appending my start up script, but the site is blocking on keyword search. I can do a paste bin if you like.

The kernel modules are


KERN=$(uname -r)
/lib/modules/${KERN}/kernel/drivers/input/input-core.ko
/lib/modules/${KERN}/kernel/drivers/hid/hid.ko
/lib/modules/${KERN}/kernel/drivers/hid/usbhid/usbhid.ko
Hi,

So running as my user gives the same results.
Which file do I add those lines to? I've only configured the files from the first post in the forum....

Thanks alot for your help....
 
You have to load the kernel modules before you start any of the nut services. For that reason, I wrote my own startup script to replace the one that Entware installs.

Try shutting down all of the NUT stuff, then run the following script. After which try to start NUT again and see what happens. If it resolves the issue

Code:
#!/bin/sh
KERN=$(uname -r)
lsmod /lib/modules/${KERN}/kernel/drivers/input/input-core.ko
lsmod /lib/modules/${KERN}/kernel/drivers/hid/hid.ko
lsmod /lib/modules/${KERN}/kernel/drivers/hid/usbhid/usbhid.ko
 
Here is my startup script, if you are interested

 
@Jeffrey Young Hope you're keeping well.

I'm trying to get NUT to work in a slightly different way. My setup is as follows:

1) ASUS AC88U router with NUT installed
2) I've connected the router to a LiPo Battery pack which keeps the Router and ONT available during long power outages
3) NUT on the router connects to an APC Backups Pro 900 UPS
4) The UPS is connected to a NUC and a Windows File Server which I'd like to gracefully shutdown when a power outage occurs

Currently, NUT works-ish as in it sends notifications when the UPS is in battery mode, but executing the shutdown script fails, in fact trying to run anything from SHUTDOWNCMD fails. At the moment, I've just connected a lightbulb to the UPS. When I pull the power and the battery goes below 95% I receive an email, but the shutdown script does not work. (I'd like to shutdown the UPS using /opt/sbin/upsdrvctl shutdown. I receive the following error in the router logs though:

upsmon[2700]: Unable to call shutdown command: /opt/sbin/upsdrvctl shutdown

Is there anything else I need to do to fix this?

Hi @Michael Schemmer ,

Just an FYI, NUT 2.8 has been released on Entware. Perhaps the issue in 2.7 has now been resolved.
 
on your router, ssh in, run amtm, install entware with "ep"

Setup NUT on Asus Merlin as per here:

need to change start upsd on asus to your login user as there is no root, tell the ASUS to load the UPS driver during boot and listen to the right IP.

my router 192.168.1.2, Merlin 386.1
```
Add/edit the following lines in these files.
/jffs/scripts/service-event
/tmp/mnt/32gb/entware/sbin/upsdrvctl -u admin start

/opt/etc/nut/
nut.conf
MODE=standalone

ups.conf
[ups]
driver = usbhid-ups
port = auto
pollinterval = 10

upsd.conf
LISTEN 127.0.0.1 3493
LISTEN 192.168.1.2 3493

upsd.users
[admin]
password = pass
actions = SET
instcmds = ALL
actions = fsd

[upsmon]
password = pass
upsmon master

upsmon.conf
RUN_AS_USER admin
MONITOR ups@localhost 1 upsmon pass master

/opt/etc/init.d/
S15upsmon
ARGS="-u admin -p"

S15upsd
ARGS="-u admin"
What im missing in here is the upsd driver, that 1 must be running also to get all the readings.

/opt/sbin/upsd -B -u admin

Without that the web-cgi is also not working. (running in lighttp instead of the mini-http)
I have put it in the service-event script.
 
What im missing in here is the upsd driver, that 1 must be running also to get all the readings.

/opt/sbin/upsd -B -u admin

Without that the web-cgi is also not working. (running in lighttp instead of the mini-http)
I have put it in the service-event script.

What driver do you need? Running opkg list | grep nut-driver yields..

Code:
ClientAdmin@RTAX88U:/tmp/home/root# opkg list | grep nut-driver
nut-driver-al175 - 2.8.0-2 - Driver for Eltek UPS models with AL175 alarm module
nut-driver-apcsmart - 2.8.0-2 - Driver for American Power Conversion Smart Protocol UPS equipment
nut-driver-apcsmart-old - 2.8.0-2 - Driver for American Power Conversion Smart Protocol UPS equipment
nut-driver-apcupsd-ups - 2.8.0-2 - Driver for apcupsd client access
nut-driver-bcmxcp - 2.8.0-2 - Driver for UPSes supporting the serial BCM/XCP protocol
nut-driver-bcmxcp_usb - 2.8.0-2 - Experimental driver for UPSes supporting the BCM/XCP protocol over USB
nut-driver-belkin - 2.8.0-2 - Driver for Belkin serial UPS equipment
nut-driver-belkinunv - 2.8.0-2 - Driver for Belkin "Universal UPS" and compatible
nut-driver-bestfcom - 2.8.0-2 - Driver for Best Power Fortress/Ferrups
nut-driver-bestfortress - 2.8.0-2 - Driver for old Best Fortress UPS equipment
nut-driver-bestuferrups - 2.8.0-2 - Driver for Best Power Micro-Ferrups
nut-driver-bestups - 2.8.0-2 - Driver for Best Power / SOLA (Phoenixtec protocol) UPS equipment
nut-driver-blazer_ser - 2.8.0-2 - Driver for Megatec/Q1 protocol serial based UPS equipment
nut-driver-blazer_usb - 2.8.0-2 - Driver for Megatec/Q1 protocol USB based UPS equipment
nut-driver-clone - 2.8.0-2 - UPS driver clone
nut-driver-dummy-ups - 2.8.0-2 - Driver for multi-purpose UPS emulation
nut-driver-etapro - 2.8.0-2 - Driver for ETA UPS equipment
nut-driver-everups - 2.8.0-2 - Driver for Ever UPS models
nut-driver-gamatronic - 2.8.0-2 - Driver for Gamatronic UPS equipment
nut-driver-genericups - 2.8.0-2 - Driver for contact-closure UPS equipment
nut-driver-isbmex - 2.8.0-2 - Driver for ISBMEX UPS equipment
nut-driver-ivtscd - 2.8.0-2 - Driver for the IVT Solar Controller Device
nut-driver-liebert - 2.8.0-2 - Driver for Liebert contact-closure UPS equipment
nut-driver-liebert-esp2 - 2.8.0-2 - Driver for Liebert UPS
nut-driver-masterguard - 2.8.0-2 - Driver for Masterguard UPS equipment
nut-driver-metasys - 2.8.0-2 - Driver for Meta System UPS equipment
nut-driver-mge-shut - 2.8.0-2 - Driver for SHUT Protocol UPS equipment
nut-driver-mge-utalk - 2.8.0-2 - Driver for MGE UPS SYSTEMS UTalk protocol equipment
nut-driver-microdowell - 2.8.0-2 - Driver for Microdowell Enterprise UPS series
nut-driver-netxml-ups - 2.8.0-2 - Driver for NetXML based UPS equipment
nut-driver-nutdrv_atcl_usb - 2.8.0-2 - Driver for ATCL FOR UPS equipment
nut-driver-nutdrv_qx - 2.8.0-2 - Driver for Q* protocol serial and USB based UPS equipment
nut-driver-oneac - 2.8.0-2 - Driver for Oneac UPS equipment
nut-driver-optiups - 2.8.0-2 - Driver for Opti-UPS (Viewsonic) UPS and Zinto D (ONLINE-USV) equipment
nut-driver-powercom - 2.8.0-2 - Driver for serial Powercom/Trust/Advice UPS equipment
nut-driver-powerpanel - 2.8.0-2 - Driver for PowerPanel Plus compatible UPS equipment
nut-driver-rhino - 2.8.0-2 - Driver for Brazilian Microsol RHINO UPS equipment
nut-driver-richcomm_usb - 2.8.0-2 - Driver for UPS equipment using Richcomm dry-contact to USB solution
nut-driver-riello_ser - 2.8.0-2 - Driver for Riello UPS Protocol UPS equipment
nut-driver-riello_usb - 2.8.0-2 - Driver for Riello UPS Protocol UPS equipment via USB
nut-driver-safenet - 2.8.0-2 - Driver for SafeNet compatible UPS equipment
nut-driver-snmp-ups - 2.8.0-2 - Multi-MIB Driver for SNMP UPS equipment
nut-driver-solis - 2.8.0-2 - Driver for Brazilian Microsol SOLIS UPS equipment
nut-driver-tripplite - 2.8.0-2 - Driver for Tripp-Lite SmartPro UPS equipment
nut-driver-tripplite_usb - 2.8.0-2 - Driver for older Tripp Lite USB UPSes (not PDC HID)
nut-driver-tripplitesu - 2.8.0-2 - Driver for Tripp-Lite SmartOnline (SU) UPS equipment
nut-driver-upscode2 - 2.8.0-2 - Driver for UPScode II compatible UPS equipment
nut-driver-usbhid-ups - 2.8.0-2 - Driver for USB/HID UPS equipment
nut-driver-victronups - 2.8.0-2 - Driver for IMV/Victron UPS unit Match
ClientAdmin@RTAX88U:/tmp/home/root#

The driver nut-driver-usbhid-ups covers most generic USB type UPSs
 
Thanks for putting this together.
I am wanting to get this going on an AIMesh node (RT-AC88U).
UPS is an APC BN600G.

I do have some questions I'll come back to but I think I am close.
WinNut is connecting but showing:
Connection to Nut Host 192.168.2.38:3493 Failed: Value cannot be null.
Parameter name: value

Any ideas?

I've also tried an APC BN650M1 (that people have reported working with NUT) but the same error.
I've tried both usbhid-ups and apcupsd-ups
 
Last edited:
Nevermind :)

Looks like it's a problem with WinNut. Started playing around with the other commands directly in putty and I was getting expected values back. Tried to connect it in Home Assistant and it pulled it all in.

Thanks again!
 
Glad you got it working.
 
Thanks but looks like I spoke too soon. Still close though.

Something still isn't working for startup and looks like it was working in Home Assistant because of me manually running the commands.

I rebooted and HA could no longer read the data.

Connected via Putty and ran
Code:
upsc routerups
and got
Code:
Error: Driver not connected

I then ran
Code:
upsdrvctl -u john
Followed that up with
Code:
upsc routerups
and I got all the data back.
Restarted the integration in HA and it's pulling data now.

I've gone through the OP multiple times and am not seeing what I am missing.
Any suggestions on where to look?
 
Where are you starting your script from on router start? Should be called from post-mount or a custom script created in the entware unit.d directory (replacing the entware installed scripts).
 
That sounds like it may be my problem :)

From the OP comment of "tell the ASUS to load the UPS driver during boot and listen to the right IP." I assumed that was taken care of after doing those steps either via the two files where I modified the ARGS in /opt/etc/init.d/ or possibly /jffs/scripts/service-event.

Even after doing those, I am still missing a step though?
 
Looks like opt/etc/init.d/ is the same as tmp/mnt/rt-ac88u/entware/etc/init.d/ so the S15upsd and S15upsmon are updated there as well with my ARGS values of
Code:
ARGS="-u john"
and
Code:
ARGS="-u john -p"
respectively
 
Just so I can keep up, which instructions are you using? My script is in post 24. I call it from a custom startup script in the unit.d directory (deleting the entware installed scripts). Or using another OP instructions? Just so I know where to look.
 
Sorry - I am only doing the steps in the first post of this thread.
I am happy to try anything. If I need to change anything that I did via the first post before implementing yours, please let me know. I don't mess with this stuff often so I have to relearn it each time.
 
I would change /jffs/scripts/service-event to /jffs/scripts/post-mount
 
Looks like that did it. Thanks!

I deleted service-event and added the content from it (last line below) to the existing post-mount:

Code:
#!/bin/sh
swapon /tmp/mnt/rt-ac88u/myswap.swp # Added by amtm
. /jffs/addons/diversion/mount-entware.div # Added by amtm


/tmp/mnt/rt-ac88u/entware/sbin/upsdrvctl -u john start
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Members online

Top