Skip to content

Commit dd0896c

Browse files
Merge 3617ca5 into 66af085
2 parents 66af085 + 3617ca5 commit dd0896c

14 files changed

Lines changed: 3657 additions & 301 deletions

NEWS.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ https://github.com/networkupstools/nut/milestone/13
4444
- Second-level bullet points listed in this file will now use 4 spaces
4545
(not 3 like before) for easier initial indentation of new entries.
4646

47+
- Introduced an experimental `apcmicrolink` driver for devices with
48+
the APC Microlink protocol on serial port connections. Tested against
49+
APC Smart-UPS 750 (SMT750RMI2UC). [PR #3406]
50+
4751
- `apc_modbus` driver updates:
4852
* Fixed string join not doing zero termination. [PR #3413]
4953
* Decode `RunTimeCalibrationStatus_BF` into

data/driver.list.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"APC" "ups" "1" "Matrix-UPS" "" "apcsmart"
8181
"APC" "ups" "1" "Smart-UPS" "" "apcsmart"
8282
"APC" "ups" "1" "Smart-UPS SMT/SMX/SURTD" "Microlink models with RJ45 socket - they *require* AP9620 SmartSlot expansion card and smart cable" "apcsmart"
83+
"APC" "ups" "1" "Smart-UPS SMT/SMX Microlink" "Microlink serial driver" "apcmicrolink"
8384
"APC" "ups" "3" "Back-UPS Pro USB" "USB" "usbhid-ups"
8485
"APC" "ups" "3" "Back-UPS BK650M2-CH" "USB" "usbhid-ups" # https://github.com/networkupstools/nut/issues/1970
8586
"APC" "ups" "3" "Back-UPS (USB)" "USB" "usbhid-ups"

docs/man/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,7 @@ endif
983983
# (--with-serial)
984984
SRC_SERIAL_PAGES = \
985985
al175.txt \
986+
apcmicrolink.txt \
986987
apcsmart.txt \
987988
apcsmart-old.txt \
988989
bcmxcp.txt \
@@ -1037,6 +1038,7 @@ SRC_SERIAL_PAGES = \
10371038

10381039
INST_MAN_SERIAL_PAGES = \
10391040
al175.$(MAN_SECTION_CMD_SYS) \
1041+
apcmicrolink.$(MAN_SECTION_CMD_SYS) \
10401042
apcsmart.$(MAN_SECTION_CMD_SYS) \
10411043
apcsmart-old.$(MAN_SECTION_CMD_SYS) \
10421044
bcmxcp.$(MAN_SECTION_CMD_SYS) \
@@ -1155,6 +1157,7 @@ INST_HTML_SERIAL_MANS = \
11551157
upscode2.html \
11561158
ve-direct.html \
11571159
victronups.html \
1160+
apcmicrolink.html \
11581161
apcupsd-ups.html
11591162

11601163
if HAVE_LINUX_SERIAL_H

docs/man/apcmicrolink.txt

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
APCMICROLINK(8)
2+
===============
3+
4+
NAME
5+
----
6+
7+
apcmicrolink - Driver for APC Smart-UPS units using the Microlink serial protocol
8+
9+
SYNOPSIS
10+
--------
11+
12+
*apcmicrolink* -h
13+
14+
*apcmicrolink* -a 'UPS_NAME' ['OPTIONS']
15+
16+
NOTE: This man page documents the hardware-specific features of the
17+
*apcmicrolink* driver. For general information about NUT drivers, see
18+
linkman:nutupsdrv[8].
19+
20+
21+
DESCRIPTION
22+
-----------
23+
24+
The *apcmicrolink* driver talks the APC Microlink protocol used by newer
25+
serial-connected Smart-UPS families such as SMT and SMX units with the
26+
Microlink RJ45 serial port.
27+
28+
This driver is currently experimental. It discovers most values from the
29+
device descriptor blob at runtime and maps supported Microlink objects onto
30+
standard NUT variables where possible. Unknown descriptor fields can also be
31+
published for debugging and reverse-engineering.
32+
33+
34+
SUPPORTED HARDWARE
35+
------------------
36+
37+
This driver is intended for APC Smart-UPS models that expose the Microlink
38+
serial protocol, notably SMT and SMX units with the vendor Microlink serial
39+
cable.
40+
41+
Tested support currently targets:
42+
43+
* APC Smart-UPS SMT/SMX Microlink models
44+
45+
Other APC Microlink devices may work if they expose a compatible descriptor
46+
layout.
47+
48+
49+
CONFIGURATION
50+
-------------
51+
52+
The driver is configured via linkman:ups.conf[5].
53+
54+
A minimal configuration:
55+
56+
----
57+
[apc-microlink]
58+
driver = apcmicrolink
59+
port = /dev/ttyUSB0
60+
----
61+
62+
Optional settings
63+
~~~~~~~~~~~~~~~~~
64+
65+
*baudrate*='num'::
66+
Set the serial line speed. The default is `9600`.
67+
68+
*showinternals*='yes|no'::
69+
Publish additional internal Microlink runtime values. By default this follows
70+
the driver debug level and is enabled automatically when debug logging is on.
71+
72+
*showunmapped*='yes|no'::
73+
Publish descriptor values that do not currently map to a standard NUT variable.
74+
By default this follows the driver debug level and is enabled automatically
75+
when debug logging is on.
76+
77+
78+
IMPLEMENTED FEATURES
79+
--------------------
80+
81+
The driver publishes standard identity, status, runtime and outlet-group data
82+
when these objects are present in the Microlink descriptor.
83+
84+
Writable descriptor-backed variables are exposed as read-write NUT variables
85+
when the device reports them as modifiable. Depending on the connected model,
86+
this can include values such as:
87+
88+
* `ups.id`
89+
* `battery.testinterval`
90+
* `outlet.group.N.oncountdown`
91+
* `outlet.group.N.offcountdown`
92+
* `outlet.group.N.stayoffcountdown`
93+
* `outlet.group.N.minimumreturnruntime`
94+
* `outlet.group.N.lowruntimewarning`
95+
96+
Supported instant commands currently include:
97+
98+
* `test.battery.start`
99+
* `test.battery.stop`
100+
* `test.panel.start`
101+
* `test.panel.stop`
102+
103+
Driver-assisted shutdown is not yet implemented.
104+
105+
106+
CABLING
107+
-------
108+
109+
Use the APC Microlink serial cable appropriate for the UPS. USB-to-serial
110+
adapters can work if they present a standard TTY device to the operating
111+
system.
112+
113+
114+
AUTHORS
115+
-------
116+
117+
* Lukas Schmid <lukas.schmid@netcube.li>
118+
119+
120+
SEE ALSO
121+
--------
122+
123+
The core driver
124+
~~~~~~~~~~~~~~~
125+
126+
linkman:nutupsdrv[8], linkman:ups.conf[5]
127+
128+
Internet resources
129+
~~~~~~~~~~~~~~~~~~
130+
131+
The NUT (Network UPS Tools) home page: https://www.networkupstools.org/

docs/nut.dict

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
personal_ws-1.1 en 3749 utf-8
1+
personal_ws-1.1 en 3751 utf-8
22
AAC
33
AAS
44
ABI
@@ -708,6 +708,7 @@ LogMin
708708
LowBatt
709709
Loyer
710710
Luca
711+
Lukas
711712
Luxeon
712713
Lygre
713714
Lynge
@@ -1117,6 +1118,7 @@ RISC
11171118
RK
11181119
RMCARD
11191120
RMCPplus
1121+
RMI
11201122
RMXL
11211123
RNF
11221124
RNG
@@ -1270,6 +1272,7 @@ Salvia
12701272
Santinoli
12711273
Savia
12721274
Sawatzky
1275+
Schmid
12731276
Schmier
12741277
Schoch
12751278
Schonefeld
@@ -1646,6 +1649,7 @@ apc
16461649
apcc
16471650
apcd
16481651
apcevilhack
1652+
apcmicrolink
16491653
apcsmart
16501654
apctest
16511655
apcupsd
@@ -3223,6 +3227,8 @@ sha
32233227
shellcheck
32243228
shellenv
32253229
shm
3230+
showinternals
3231+
showunmapped
32263232
shutdownArguments
32273233
shutdowncmd
32283234
shutdowndelay
@@ -3411,6 +3417,7 @@ tempmax
34113417
tempmin
34123418
termios
34133419
testime
3420+
testinterval
34143421
testtime
34153422
testuser
34163423
testvar

drivers/Makefile.am

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ endif HAVE_LIBREGEX
147147
NUTSW_DRIVERLIST_DUMMY_UPS = dummy-ups$(EXEEXT)
148148
NUTSW_DRIVERLIST = $(NUTSW_DRIVERLIST_DUMMY_UPS) \
149149
clone clone-outlet failover apcupsd-ups skel
150-
SERIAL_DRIVERLIST = al175 bcmxcp belkin belkinunv bestfcom \
150+
SERIAL_DRIVERLIST = al175 apcmicrolink bcmxcp belkin belkinunv bestfcom \
151151
bestfortress bestuferrups bestups etapro everups \
152152
gamatronic genericups isbmex liebert liebert-esp2 liebert-gxe masterguard metasys \
153153
mge-utalk microdowell microsol-apc mge-shut nutdrv_hashx oneac optiups powercom powervar_cx_ser rhino \
@@ -234,6 +234,7 @@ upsdrvctl_LDADD = libdummy_upsdrvquery.la $(LDADD_COMMON)
234234

235235
# serial drivers: all of them use standard LDADD and CFLAGS
236236
al175_SOURCES = al175.c
237+
apcmicrolink_SOURCES = apcmicrolink.c apcmicrolink-maps.c apc_common.c
237238
apcsmart_SOURCES = apcsmart.c apcsmart_tabs.c
238239
apcsmart_LDADD = $(LDADD_DRIVERS_SERIAL) $(LIBREGEX_LIBS)
239240
apcsmart_old_SOURCES = apcsmart-old.c
@@ -459,7 +460,7 @@ adelsystem_cbi_LDADD = $(LDADD_DRIVERS) $(LIBMODBUS_LIBS)
459460
# APC Modbus driver (with support of modbus over different media)
460461
# Note that a version of libmodbus built with USB support is also needed
461462
# for USB connections. Legacy versions work for Serial and TCP links.
462-
apc_modbus_SOURCES = apc_modbus.c
463+
apc_modbus_SOURCES = apc_modbus.c apc_common.c
463464
apc_modbus_LDADD = $(LDADD_DRIVERS) $(LIBMODBUS_LIBS)
464465
if WITH_MODBUS_USB
465466
apc_modbus_SOURCES += hidparser.c
@@ -539,7 +540,7 @@ dist_noinst_HEADERS = \
539540
powercom.h powerpanel.h powerp-bin.h powerp-txt.h powervar_cx.h raritan-pdu-mib.h \
540541
safenet.h serial.h sms_ser.h snmp-ups.h solis.h tripplite.h tripplite-hid.h \
541542
upshandler.h usb-common.h usbhid-ups.h powercom-hid.h compaq-mib.h idowell-hid.h \
542-
apcsmart.h apcsmart_tabs.h apcsmart-old.h apcupsd-ups.h cyberpower-mib.h riello.h openups-hid.h \
543+
apcmicrolink-maps.h apcmicrolink.h apcsmart.h apcsmart_tabs.h apcsmart-old.h apcupsd-ups.h cyberpower-mib.h riello.h openups-hid.h \
543544
delta_ups-mib.h nutdrv_qx.h nutdrv_qx_bestups.h nutdrv_qx_blazer-common.h \
544545
nutdrv_qx_gtec.h nutdrv_qx_innovart31.h nutdrv_qx_innovart33.h nutdrv_qx_innovatae.h \
545546
nutdrv_qx_masterguard.h nutdrv_qx_mecer.h nutdrv_qx_ablerex.h \

0 commit comments

Comments
 (0)