| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
| docs:guide-user:services:ups:software.nut [2018/09/12 10:24] – [nut_server Working Example] fix working example cshoredaniel | docs:guide-user:services:ups:software.nut [2018/12/12 08:01] – [Post 18.06.2 / Commmit c95a1d3 on openwrt-18.06 / Commit f48b060 on master] better title cshoredaniel |
|---|
| NUT was updated with more UCI in commit [[https://github.com/openwrt/packages/commit/a23c4e85c5f6c9f9dcf67743b93c492ba833e365|a23c4e85]], which appears in the 18.06 release. | NUT was updated with more UCI in commit [[https://github.com/openwrt/packages/commit/a23c4e85c5f6c9f9dcf67743b93c492ba833e365|a23c4e85]], which appears in the 18.06 release. |
| |
| <wrap lo> | ===== 18.06 and beyond ===== |
| In __older release(s)__ there's problem with some USB UPSes (e.g. EATON) that are not recognized by usbhid-ups. This is apparently a bug in libusb-compat, since libusb (0.1.4) can recognize them. | |
| | |
| You can work around this by installing Attitude Adjustment, manually installing packages __libusb-compat__ and **nut-driver-usbhid-ups**, then manualy remove __libusb-compat__ and install **libusb** istead (packages in trunk may break on having manually installed libusb) | |
| </wrap> | |
| | |
| ===== 18.06 / Commit a23c4e85 ===== | |
| |
| <color #ed1c24>NOTE: configuration has **changed**</color>: It's now all done through UCI (see below) (and the UCI is changed). | <color #ed1c24>NOTE: configuration has **changed**</color>: It's now all done through UCI (see below) (and the UCI is changed). |
| |
| | |
| | <WRAP center round tip 60%> |
| If you wish to use a 'standard' NUT config just remove the symlinks in /etc/nut and replace them with regular NUT configuration files. | If you wish to use a 'standard' NUT config just remove the symlinks in /etc/nut and replace them with regular NUT configuration files. |
| | </WRAP> |
| | ==== 18.06 / Commit a23c4e85 ==== |
| |
| <WRAP center round alert 60%> | <WRAP center round alert 60%> |
| Due to changes in procd (or the OpenWrt shell wrapper around starting and stopping services with procd) stopping/restarting NUT stopped working properly. Work is underway to remedy this. Unfortunately issues were not reported before the 18.06 release, so it's not clear which (if any) point release will get the fixes. | Due to changes in procd (or the OpenWrt shell wrapper around starting and stopping services with procd) stopping/restarting NUT stopped working properly. Work is underway to remedy this. Unfortunately issues were not reported before the 18.06 release. 18.06.1 has fixes for the most troublesome of the issues, and 18.06.2 should resolve the rest. |
| |
| See [[https://github.com/openwrt/packages/pull/6897|PR #6987]], [[https://github.com/openwrt/packages/issues/6997|Issue #6997]], [[https://github.com/openwrt/packages/issues/6966|Issue #6966]], and [[https://github.com/openwrt/packages/issues/6843|Issue #6843]] | [[https://github.com/openwrt/packages/pull/7638|PR #7638]] / [[https://github.com/openwrt/packages/commit/c95a1d3da89cb62eacc1d8217b861b36194d8838|Commmit c95a1d3]] Resolves these issues in the 18.06 branch. |
| | This should be in the next 18.06.x point release (18.06.2). |
| | |
| | See <del>[[https://github.com/openwrt/packages/pull/6897|PR #6987]], [[https://github.com/openwrt/packages/issues/6997|Issue #6997]], [[https://github.com/openwrt/packages/issues/6966|Issue #6966]], and [[https://github.com/openwrt/packages/issues/6843|Issue #6843]]</del> |
| | </WRAP> |
| | |
| | ==== Commit f48b060 on master ==== |
| | |
| | <WRAP center round important 60%> |
| | With [[https://github.com/openwrt/packages/commit/f48b060fa752fdf6556080dc1af221363f9b1ef4|Commit f48b060 on master]] all known issues are resolved. |
| | |
| | </WRAP> |
| | |
| | <WRAP center round important 60%> |
| | |
| | |
| | [[https://github.com/openwrt/packages/pull/7167/commits/8ff6a83a541b114437eab170a0760c1c04263aa2|Commit 8ff6a83]] adds building of serial drivers by default. |
| | |
| | [[https://github.com/openwrt/packages/pull/7167/commits/daa974cff0bef94c71277e703c32b3fd36f1411b|Commit daa974c]] completes the USB UPS hotplugging in which a USB UPS driver can be run as non-root and the USB device will be given the right permissions. |
| | |
| | [[https://github.com/openwrt/packages/pull/7592/commits/a5d06ce1106644b26a1b9d0ad87220d772d6b862|Commit a5d06ce]] adds hotplug support for serial UPSes when using a standare serial-to-USB cable. |
| </WRAP> | </WRAP> |
| |
| | nut | Required to enable the 'real' packages | | | nut | Required to enable the 'real' packages | |
| | nut-common | Required for all NUT packages | | | nut-common | Required for all NUT packages | |
| | nut-server | NUT server or standalone; only for the host attached directly to the UPS | | | nut-server | NUT server or standalone; only for the host attached directly to the UPS. Note will require a 'nut-dirver-xxx' driver to actually connect to the UPS. | |
| | nut-upsmon | Monitoring and/or triggering shutdown (e.g. client mode; can be on a server too and is in fact recommended on all hosts. Note will require a 'nut-dirver-xxx' driver to actually connect to the UPS | | | nut-upsmon | Monitoring and/or triggering shutdown (e.g. client mode; can be on a server too and is in fact recommended on all hosts). | |
| | nut-upsc | Command line client for querying UPS status | | | nut-upsc | Command line client for querying UPS status | |
| | nut-upscmd | Perform 'instant commands' on UPS (e.g. remote shutdown) if supported by UPS | | | nut-upscmd | Perform 'instant commands' on UPS (e.g. remote shutdown) if supported by UPS | |
| | nut-upsrw | Set variables on UPS (e.g. buzzer status) if supported by UPS | | | nut-upsrw | Set variables on UPS (e.g. buzzer status) if supported by UPS | |
| | nut-upssched | Schedule script actions from some time after a UPS event | | | nut-upssched | Schedule script actions from some time after a UPS event | |
| | nut-upsmon-sendmail-notify | Send an email via sendmail command on a UPS event. In 18.06, added in commit [[https://github.com/openwrt/packages/commit/c94e334c4e5251d09995e3f6c8b80d61928a451c#diff-4ea671be370e4ab06ffeb50e1312d11e|c94e334c4e5251d09995e3f6c8b80d61928a451c#diff-4ea671be370e4ab06ffeb50e1312d11e]] | | | nut-upsmon-sendmail-notify | Send an email via sendmail command on a UPS event. In 18.06, added in commit [[https://github.com/openwrt/packages/commit/c94e334c4e5251d09995e3f6c8b80d61928a451c#diff-4ea671be370e4ab06ffeb50e1312d11e|c94e334c4]] | |
| | nut-web-cgi | A 'web' (e.g. uhttpd) GUI for monitoring the UPS | | | nut-web-cgi | A 'web' (e.g. uhttpd) GUI for monitoring the UPS | |
| | nut-avahi-service | Advertise the UPS server via mDNS (avahi-daemon only) | | | nut-avahi-service | Advertise the UPS server via mDNS (avahi-daemon only) | |
| === UPS Drivers === | === UPS Drivers === |
| |
| == Serial == | <WRAP center round tip 60%> |
| | See [[https://networkupstools.org/stable-hcl.html|NUT Stable Hardware Compatibility List]] to match your UPS model to a driver. |
| | </WRAP> |
| |
| |
| | == Serial == |
| |
| | <WRAP group> |
| | <WRAP half column> |
| | <WRAP group> |
| | <WRAP half column> |
| * al175 | * al175 |
| * bcmxcp | * bcmxcp |
| * e-shut | * e-shut |
| * mge-utalk | * mge-utalk |
| | |
| | </WRAP> |
| | |
| | <WRAP half column> |
| * microdowell | * microdowell |
| * mge-shut | * mge-shut |
| * apcupsd-ups | * apcupsd-ups |
| * riello_ser | * riello_ser |
| | </WRAP> |
| | </WRAP> |
| | </WRAP> |
| |
| | <WRAP half column> |
| == SNMP == | == SNMP == |
| |
| * nutdrv_atcl_ | * nutdrv_atcl_ |
| * usb nutdrv_qx | * usb nutdrv_qx |
| | </WRAP> |
| | </WRAP> |
| ===== LuCI app ===== | ===== LuCI app ===== |
| |
| There was a Pull Request ([[https://github.com/openwrt/luci/pull/936|#936]]) for a LuCI app for the new configuration that sadly never made into 18.06, for complicated reasons that are non-technical, but is merged in a modified for into master. | There was a Pull Request ([[https://github.com/openwrt/luci/pull/936|#936]]) for a LuCI app for the new configuration that sadly never made into 18.06, for complicated reasons that are non-technical, but is merged in a modified form into master. |
| ===== 18.06.x+ UCI files ===== | ===== 18.06.x+ UCI files ===== |
| |
| |
| There can be more than one of each section (as appropriate) | There can be more than one of each section (as appropriate) |
| | |
| | |
| | === config driver_global === |
| | |
| | <WRAP center round important 60%> |
| | [[https://github.com/openwrt/packages/commit/44e57d4bdfe93214e9c031f181533bb0e4ef25ca|Commit 44e57d4]] (adds the following variables) and [[https://github.com/openwrt/packages/commit/f48b060fa752fdf6556080dc1af221363f9b1ef4| Commit f48b060]] (fixes synchronous setting) |
| | </WRAP> |
| | |
| | ^ Option ^ Type ^ Required ^ Default ^ Description ^ |
| | ^ chroot | string | no | //none// | chroot directory | |
| | ^ driverpath | string | no | /lib/nut | Where to search for drivers | |
| | ^ maxstartdelay | integer | no | //none// | Override default for UPSes not specifying this field | |
| | ^ maxretry | integer | no | 1 | Number of time to retry loading driver (apart from procd's respawn) initially | |
| | ^ retrydelay | integer | no | 5 | Number of seconds between retries | |
| | ^ pollinterval | integer | no | 2 | Maximum number of seconds between UPS status refresh | |
| | ^ synchronous | boolean string | no | no | Whether reading from UPS has to empty pipe before more data written | |
| | ^ user | string | no | nut | If run as root, user to which to drop privileges | |
| |
| === config driver 'upsname' === | === config driver 'upsname' === |
| | |
| | **NB**: From 18.06 |
| |
| The config section name (e.g. 'upsname' above) will be used a the ups name. | The config section name (e.g. 'upsname' above) will be used a the ups name. |
| |
| ^ Option ^ Type ^ Required ^ Default ^ Description ^ | ^ Option ^ Type ^ Required ^ Default ^ Description ^ |
| ^ driver | string | yes | //none// | Driver for the model of UPS (see list above and [[https://networkupstools.org/stable-hcl.html|NUT HCL for stable release]] | | ^ driver | string | yes | //none// | Driver for the model of UPS (see list above and [[https://networkupstools.org/stable-hcl.html|NUT HCL for stable release]]) | |
| ^ port | string | yes | ? (shouldn't rely on anyway) | Port on which the UPS is attached (or auto for auto-detection with USB) | | ^ port | string | yes | ? (shouldn't rely on anyway) | Port on which the UPS is attached (or auto for auto-detection with USB) | |
| ^ other | string | varies | //none// | see HCL above | | ^ other | string | varies | //none// | see HCL above | |
| ^ runas | string | no | //none// | User as which to run the daemon (note that means the USB device has in /dev/bus/usb/xxxx has to be //writable// by this user | | ^ runas | string | no | //none// | User as which to run the daemon (note that means the USB device has in /dev/bus/usb/xxxx has to be //writable// by this user) | |
| | |
| | <WRAP center round important 60%> |
| | As of [[https://github.com/openwrt/packages/commit/ceff68837d4b8d5a9bd8bf1962e913b5203d95e5|ceff6883]] adding random parameters was removed and only pre-defined parameters are allowed. |
| | </WRAP> |
| | |
| | ^ Option ^ Type ^ Required ^ Default ^ Description ^ |
| | ^ mfr | string | no | //none// | Manufacturer description string | |
| | ^ model | string | no | //none// | Model description string | |
| | ^ serial | string | no | //none// | Serial number description string or regex match for serial number (depends on driver) | |
| | ^ sdtime | integer | no | //none// | Number of seconds for driver to sleep after sending shutdown signal | |
| | ^ offdelay | integer | no | 20 | Number of seconds UPS will wait before shutting down after receiving shutdown signal | |
| | ^ ondelay | integer | no | 30 | Number of seconds UPS will wait before powering up if still on mains after shutdown (must be less than ondelay) | |
| | ^ pollfreq | integer | no | 30 | How often driver will poll UPS for data | |
| | ^ vendor | string | no | //none// | regex to match USB vendor string | |
| | ^ product | string | no | //none// | regex to match USB product string | |
| | ^ bus | string | no | //none// | regex to match a specific USB bus or group of busses | |
| | ^ interruptonly | boolean | no | false | flag to driver to do no polling, only get data by interrupts (push) from UPS | |
| | ^ interruptsize | integer | no | //none// | limit interrupt data to given number of bytes; e.g. for some PowerCom units | |
| | ^ maxreport | boolean | no | false | With this option, the driver activates a tweak to workaround buggy firmware returning invalid HID report length. Some APC Back-UPS units are known to have this bug. | |
| | ^ vendorid | string | no | //none// | regex: Match only UPSes with this USB vendorid | |
| | ^ productid | string | no | //none// | regex: Match only UPSes with this USB productid | |
| | ^ community | string | no | public | For snmp-ups: community to poll UPS | |
| | ^ snmp_version | v1, v2c, or v3 | no | v1 | For snmp-ups: SNMP version | |
| | ^ snmp_retries | integer | no | 5 | Number of Net-SNMP tries | |
| | ^ snmp_timeout | integer | no | 1 | Number of seconds between Net-SNMP retries | |
| | ^ notransferoids | boolean | no | false | Disable the monitoring of the low and high voltage transfer OIDs in the hardware. This will remove input.transfer.low and input.transfer.high from the list of variables. This should only be used on APCC Symmetra equipment which has strangeness in the three-phase power reporting. | |
| | |
| | <WRAP center round important 60%> |
| | [[https://github.com/openwrt/packages/commit/44e57d4bdfe93214e9c031f181533bb0e4ef25ca|Commit 44e57d4]] (adds the following variables) |
| | </WRAP> |
| | |
| | |
| | ^ Option ^ Type ^ Required ^ Default ^ Description ^ |
| | ^ synchronous | yes or no | no | no | Whether UPS must read all data from UPS before getting new data | |
| | ^ maxstartdelay | integer | no | 45 | How long NUT waits for driver to start before giving up | |
| | ^ retrydelay | integer | no | 5 | How long NUT waits to retry starting driver | |
| | ^ override | list of strings | no | //none// | names of 'override' config sections (below) | |
| | ^ default | list of strings | no | //none// | names of 'default' config sections (below) | |
| | ^ other | list of strings | no | //none// | names of 'other' config sections (below) | |
| | ^ otherflags | list of strings | no | //none// | names of 'otherflag' config sections (below) | |
| | |
| | config override 'override_[variable_name]' |
| | |
| | e.g. ''config override 'override_battery_charge_low''' creates ups.conf entry for ''override.battery.charge.low = '' |
| | |
| | ^ Option ^ Type ^ Required ^ Default ^ Description ^ |
| | ^ value | varies | yes | //none// | Value driver 'pretends' UPS sent | |
| | |
| | config default 'default_[variable_name]' |
| | |
| | e.g. ''config default 'default_battery_charge_low''' creates ups.conf entry for ''default.battery.charge.low = '' |
| | ^ Option ^ Type ^ Required ^ Default ^ Description ^ |
| | ^ value | varies | yes | //none// | Value driver 'pretends' UPS sent unless UPS actually sends a value | |
| | |
| | config override 'other_[parameter]' |
| | |
| | e.g. ''config other 'other_parameter''' creates ups.conf entry for ''parameter = '' |
| | |
| | ^ Option ^ Type ^ Required ^ Default ^ Description ^ |
| | ^ value | varies | yes | //none// | A way to handle currently unknown (to UCI) parameters | |
| | |
| | config override 'otherflag_[parameter]' |
| | |
| | e.g. ''config override 'otherflag_extraflag''' creates ups.conf entry for ''extraflag'' |
| | |
| | ^ Option ^ Type ^ Required ^ Default ^ Description ^ |
| | ^ value | boolean | yes | false | A way to handle currently unknown (to UCI) flags | |
| |
| === config user === | === config user === |
| | |
| | **NB** From 18.06 |
| | |
| ^ Option ^ Type ^ Required ^ Default ^ Description ^ | ^ Option ^ Type ^ Required ^ Default ^ Description ^ |
| ^ username | string | yes | ? (probably not) | 'username' (NUT only) for accessing a this server with e.g. upsmon (local or remote) | | ^ username | string | yes | ? (probably not) | 'username' (NUT only) for accessing a this server with e.g. upsmon (local or remote) | |
| | |
| === config listen_address === | === config listen_address === |
| ^ Option ^ Type ^ Required ^ Default ^ Description ^ | ^ Option ^ Type ^ Required ^ Default ^ Description ^ |
| ^ address | IPv4 or IPv6 address | yes | ::1 | Address to which to bind server (can be a wildcard address such as 0.0.0.0) | | ^ address | IPv4 or IPv6 address | yes | ::1 | Address to which to bind server (can be a wildcard address such as 0.0.0.0) | |
| ^ port | tcp port | | yes | 3493 | Port on which to listen | | ^ port | tcp port | yes | 3493 | Port on which to listen | |
| |
| === config upsd 'upsd' === | === config upsd 'upsd' === |
| </code> | </code> |
| ===== Pre 18.06 ===== | ===== Pre 18.06 ===== |
| | |
| | <wrap lo> |
| | In __older release(s)__ there's problem with some USB UPSes (e.g. EATON) that are not recognized by usbhid-ups. This is apparently a bug in libusb-compat, since libusb (0.1.4) can recognize them. |
| | |
| | You can work around this by installing Attitude Adjustment, manually installing packages __libusb-compat__ and **nut-driver-usbhid-ups**, then manualy remove __libusb-compat__ and install **libusb** istead (packages in trunk may break on having manually installed libusb) |
| | </wrap> |
| |
| You will want to have packages **nut**, **nut-server** and **nut-client** packages installed to have main functionality. | You will want to have packages **nut**, **nut-server** and **nut-client** packages installed to have main functionality. |