Skip to content

Commit 5a3d7ef

Browse files
Merge 8418030 into 66af085
2 parents 66af085 + 8418030 commit 5a3d7ef

14 files changed

Lines changed: 4067 additions & 333 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: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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+
*cmdsrc*='rj45|usb|localuser|smartslot1|internalnetwork1'::
78+
Select the Microlink command source used for outgoing command writes. The
79+
default is `rj45`.
80+
81+
82+
IMPLEMENTED FEATURES
83+
--------------------
84+
85+
The driver publishes standard identity, status, runtime and outlet-group data
86+
when these objects are present in the Microlink descriptor. Descriptor-backed
87+
values are interpreted as strings, hex identifiers, dates, times, fixed-point
88+
numbers, and enum or bitfield maps depending on the Microlink type reported by
89+
the device.
90+
91+
Writable descriptor-backed variables are exposed as read-write NUT variables
92+
when the device reports them as modifiable. Depending on the connected model,
93+
this can include values such as:
94+
95+
* `ups.id`
96+
* `ups.display.language`
97+
* `ups.test.interval`
98+
* `battery.date`
99+
* `input.transfer.delay`
100+
* `input.transfer.high`
101+
* `input.transfer.low`
102+
* `outlet.group.N.timer.shutdown`
103+
* `outlet.group.N.timer.reboot`
104+
* `outlet.group.N.timer.start`
105+
* `outlet.group.N.delay.shutdown`
106+
* `outlet.group.N.delay.reboot`
107+
* `outlet.group.N.delay.start`
108+
* `outlet.group.N.minimumreturnruntime`
109+
* `outlet.group.N.lowruntimewarning`
110+
* `outlet.group.N.name`
111+
112+
Supported instant commands currently include:
113+
114+
* `test.battery.start`
115+
* `test.battery.stop`
116+
* `test.panel.start`
117+
* `test.panel.stop`
118+
119+
Driver-assisted shutdown is not yet implemented.
120+
121+
122+
CABLING
123+
-------
124+
125+
Use the APC Microlink serial cable appropriate for the UPS. USB-to-serial
126+
adapters can work if they present a standard TTY device to the operating
127+
system.
128+
129+
130+
AUTHORS
131+
-------
132+
133+
* Lukas Schmid <lukas.schmid@netcube.li>
134+
135+
136+
SEE ALSO
137+
--------
138+
139+
The core driver
140+
~~~~~~~~~~~~~~~
141+
142+
linkman:nutupsdrv[8], linkman:ups.conf[5]
143+
144+
Internet resources
145+
~~~~~~~~~~~~~~~~~~
146+
147+
The NUT (Network UPS Tools) home page: https://www.networkupstools.org/

docs/nut.dict

Lines changed: 13 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 3761 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
@@ -1763,6 +1767,7 @@ bigups
17631767
bindir
17641768
binfmt
17651769
binutils
1770+
bitfield
17661771
bitmapped
17671772
bitmask
17681773
bitness
@@ -1882,6 +1887,7 @@ cmdline
18821887
cmdname
18831888
cmdparam
18841889
cmds
1890+
cmdsrc
18851891
cmdvartab
18861892
cnf
18871893
codebase
@@ -2400,6 +2406,7 @@ integrations
24002406
intel
24012407
intelliSenseMode
24022408
intercharacter
2409+
internalnetwork
24032410
internet
24042411
interoperability
24052412
interoperate
@@ -2589,6 +2596,7 @@ localhost
25892596
localip
25902597
localport
25912598
localtime
2599+
localuser
25922600
lockf
25932601
logfacility
25942602
logfile
@@ -3223,6 +3231,8 @@ sha
32233231
shellcheck
32243232
shellenv
32253233
shm
3234+
showinternals
3235+
showunmapped
32263236
shutdownArguments
32273237
shutdowncmd
32283238
shutdowndelay
@@ -3247,6 +3257,7 @@ slaveid
32473257
slavesync
32483258
slibtool
32493259
sm
3260+
smartslot
32503261
smartups
32513262
smbus
32523263
sms
@@ -3411,6 +3422,7 @@ tempmax
34113422
tempmin
34123423
termios
34133424
testime
3425+
testinterval
34143426
testtime
34153427
testuser
34163428
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+
apc_common.h 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)