1APCSMART(8) NUT Manual APCSMART(8)
2
3
4
6 apcsmart - Driver for American Power Conversion Smart Protocol UPS
7 equipment
8
10 apcsmart -h
11
12 apcsmart -a UPS_NAME [-x option=value ...]
13
14 Note
15 This man page only documents the hardware-specific features of the
16 apcsmart driver. For information about the core driver, see
17 nutupsdrv(8).
18
20 The apcsmart driver should recognize (or at the very least, work with)
21 the majority of Smart-UPS models - which includes Smart-UPS, Matrix-UPS
22 and Back-UPS lineups, among few other ones.
23
24 Currently, we can roughly divide APC hardware into four groups (note
25 that the division isn’t strict by any means, and the borders between
26 those are pretty fuzzy):
27
28 [very] "old" models
29 These models usually have old APC logo, white color and no
30 programmable EEPROM; you won’t find them listed anywhere on APC’s
31 site either. The support for those will be usually based on
32 driver’s compatibility tables, or if the model (firmware) is not
33 listed in those - the driver will try to follow the very basic
34 subset of features, while still trying to remain useful. Despite
35 "smart" tagname, they often tend to behave in pretty dumb way (see
36 the section below about shutdown behaviour).
37
38 Example models:
39
40 · Smart-UPS 2000I
41
42 · Smart-UPS 900I
43
44 "new" models
45 These models usually come from late 1990s / pre-2009 times. They
46 are often referred as "3rd. gen". For the most part, they have
47 programmable EEPROM, report supported commands and capabilites, and
48 should work just fine with the apcsmart driver.
49
50 "microlink" models
51 WARNING: these are not natively supported by apcsmart (or apcupsd,
52 for that matter, if you’re wondering). Around 2007, APC (now APC
53 Schneider) decided to go back to its proprietry roots, and all the
54 new models (SMT, SMX, SURTD) use completely different protocol and
55 cables. If you purchased a new APC UPS - that uses cable with RJ45
56 on the one end, and DB-9 on the other - then you have such model.
57 Your only option to support it through NUT is to purchase a "legacy
58 communications card" - part #AP9620 (google 'AP9620' for more
59 details). Or if that’s not an option, rely on official software.
60
61 Microsol models
62 Several Microsol serial models sold in Brazil have been rebranded
63 as APC Back-UPS, and the model numbers tend to start with "BZ". If
64 you have one of these "Nobreaks", they will not work with the
65 apcsmart driver - please see the solis(8) driver instead.
66
67 Example models:
68
69 · Back-UPS BZ1200-BR
70
71 · Back-UPS BZ2200BI-BR
72
73 Another thing to remember is that Smart protocol is not USB protocol.
74 If you have UPS with both USB and serial ports, then depending on how
75 you connect it, you will need either apcsmart or usbhid-ups driver.
76
78 This driver expects to see a 940-0024C cable or a clone by default. You
79 can switch to the 940-0095B dual-mode cable support with the 'cable='
80 definition described below.
81
82 If your 940-xx24X cable is broken or missing, use this diagram to build
83 a clone:
84
85 http://www.networkupstools.org/cables.html#_940_0024c_clone
86
87 Note
88 The "xx" is either "00" for a short cable, or the number of feet of
89 a longer cable. The "X" is a letter representing the minor revision
90 of the physical cable and its connectors ("C" and "E" are commonly
91 found revisions). All minor revisions should use the same pin-outs
92 and wiring.
93
94 You can specify alternate cable in ups.conf(5):
95
96 cable=940-0095B
97
98 Alternatively, you can also provide it on the command line using:
99
100 -x cable=940-0095B
101
103 By default the driver works in canonical mode, but it proved to be a
104 problem in Windows systems. Furthermore there’s a possibility of some
105 obscure serial cards or serial-USB converters that could cause problems
106 as well. You can use 'ttymode=' option to force non-canonical
107 discipline in ups.conf(5):
108
109 ttymode=raw
110
111 Alternatively, you can also provide it on the command line using:
112
113 -x ttymode=raw
114
115 Note
116 Any other value will make the driver work in the canonical mode.
117
119 APC hardware supports a lot of shutdown methods, that themselves can
120 differ in behaviour quite a bit, depending on the model.
121
122 S (soft hibernate)
123 This is most basic command present in probably all APC models. It
124 will hibernate the UPS, and subsequently wake it up when the mains
125 supply returns. The command doesn’t work if the UPS is running on
126 mains.
127
128 "old" models
129 The behaviour here is unfortunately pretty primitive - when the
130 power returns, the UPS just wakes up. No grace periods, no min.
131 battery charge condition, etc. This is probably not what you
132 want.
133
134 "new" models
135 The behaviour here is as expected - the power is cut off after
136 the EEPROM defined grace period. The UPS will wake up when the
137 power returns, after the EEPROM defined delay AND if the EEPROM
138 defined min. battery charge level is met. The delay is counted
139 from the power's return.
140
141 CS (aka "force OB hack")
142 This is a trick to make UPS power down even if it's running on
143 mains. Immediately before issuing S, "simulate power failure" is
144 issued. The remaining behaviour is as in S case.
145
146 The name came from APC CS models, where such trick was used to
147 power down UPSes in consistent fashion using only S. It's better to
148 use @nnn command if your UPS supports it (and is not too old, see
149 below).
150
151 @nnn (hard hibernate)
152 This is basic command used to hibernate UPS regardless if it's
153 running on batteries or on mains. The option takes 3 digits
154 argument which can be used to specify additional wakeup delay (in 6
155 minute units).
156
157 "old" models
158 The behaviour is - unfortunately - similary primitive to S. The
159 UPS unconditionally wakes up after nnn*6 minutes - it doesn't
160 care if the power returned ! If nnn = 000, then UPS will do
161 precisely nothing. On those models you're better specifying nnn
162 > 0, if you can estimate the kind of power problems that might
163 be happening in your environment. Another thing to consider
164 with "old" models - you might lose the connection with the UPS,
165 until it wakes up (with S, the serial connection is kept
166 alive).
167
168 "new" models
169 All the usual variables defined in EEPROM are respected (see
170 S). Additionally, if nnn > 0, the nnn*6 minutes are added to
171 EEPROM defined delay. UPS will not power up if it's running on
172 batteries, contrary to what "old" models used to do - the
173 combined delay is counted from the moment of power return.
174
175 Supposedly there exist models that take 2 digits instead of 3. Just
176 in case, NUT also supports such variation. You have to provide
177 exactly 2 digits to trigger it (awd option, or argument to one of
178 the supported instant commands).
179
180 K (delayed poweroff)
181 This is permanent poweroff - the UPS will not wake up
182 automatically. On newer units, it will respect applicable EEPROM
183 variables.
184
185 Z (instant poweroff)
186 This is also permanent poweroff - the UPS will not wake up
187 automatically. The poweroff is executed immediately.
188
190 There are three options used to control the shutdown behaviour.
191
192 sdtype=[0-5]
193 This option takes a single digit (0-5) as an argument. See below
194 for details.
195
196 advorder=no|[0-4]+
197 This option takes string of digits as an argument. Methods listed
198 are tried in turn until one of them succeedes. Note that the
199 meaning of digits is different from sdtype. See below for details.
200
201 awd=[0-9]{1,3}
202 This option lets you specify additional wakeup delay used by @. If
203 you provide exactly 2 digits, the driver will try 2 digits
204 variation (see previous section for more info). Otherwise standard
205 3 digits variation is used. Note: the time unit is 6 minutes !
206
207 Keep in mind that sdtype and advorder are mutually exclusive. If
208 advorder is provided, sdtype is ignored. If advorder is set to 'no',
209 sdtype is used instead.
210
211 If nothing is provided, NUT will assume sdtype=0 - which is generally
212 fine for anything not too ancient or not too quirky.
213
214 SDTYPE
215 The values permitted are from 0 to 5. Only one can be specified.
216 Anything else will cause apcsmart to exit.
217
218 0
219 issue soft hibernate (S) if the UPS is running on batteries,
220 otherwise issue hard hibernate (@)
221
222 1
223 issue soft hibernate (S) (if on batteries), and if it fails (or on
224 mains) - try hard hibernate (@)
225
226 2
227 issue instant poweroff (Z)
228
229 3
230 issue delayed poweroff (K)
231
232 4
233 issue "force OB hack" (CS)
234
235 5
236 issue hard hibernate (@)
237
238 Note
239 Hard hibernate's additional wakeup delay can be provided by awd.
240
241 ADVORDER
242 The argument is either a word 'no', or a string of 1 - 5 digits in [0 -
243 4] range. Each digit maps to the one of shutdown methods supported by
244 APC UPSes. Methods listed in this way are tried in order, until one of
245 them succedes.
246
247 If advorder is undefined or set to 'no', sdtype is used instead.
248
249 The mapping is as follows:
250
251
252 0 soft hibernate (S)
253
254 1 hard hibernate (@)
255
256 2 delayed poweroff (K)
257
258 3 instant poweroff (Z)
259
260 4 "force OB hack" (CS)
261
262
263 Note
264 Hard hibernate's additional wakeup delay can be provided by awd.
265
267 APC units - even if they report LB mode - will not go into shutdown
268 automatically. This gives us even more control with reference to "when
269 to actually shutdown PSU". Since version 2.6.2, NUT supports ignorelb
270 option in driver’s section of ups.conf(5). When such option is in
271 effect, the core driver will ignore LB state as reported by specific
272 driver and start shutdown basing the decision only on two conditions:
273
274 battery.charge < battery.charge.low
275
276 OR
277
278 battery.runtime < battery.runtime.low
279
280 Of course - if any of the variables are not available, the appropriate
281 condition is not checked. If you want to explicitly disable one of the
282 conditions, simply override the right hand variable causing the
283 condition to always evaluate to false (you can even provide negative
284 numbers).
285
286 APC UPSes don’t have battery.charge.low - you will have to define it if
287 you want to use such condition (prefix the variable with override. or
288 default.).
289
290 "New" units have battery.runtime.low, but depending on battery quality,
291 firmware version, calibration and UPS load - this variable can be
292 underestimated quite a bit - especially right after going into OB
293 state. This in turn can cause LB to be asserted, which under normal
294 conditions will cause NUT to initiate the shutdown. You might want to
295 disable this condition entirely, when relying on ignorelb option (this
296 was actually the main motivation behind introduction of such feature).
297
298 Simple example:
299
300 [apc]
301 ignorelb
302 override.battery.charge.low = 15
303 override.battery.runtime.low = -1
304
305 This would cause apcsmart to go into shutdown only if detected battery
306 charge < 15%. Runtime condition is always false in this example.
307
308 You could ask - why bother ? Well, the reason is already hinted above.
309 APC units can be very picky about the batteries, and their firmware can
310 underestimate the remaining runtime (especially right after going into
311 OB state). ignorelb option and override.* let you remain in control of
312 the UPS, not UPS in control of you.
313
314 Furthermore, this allows to specify conditions similary to how it’s
315 done in apcupsd daemon, so it should be welcome by people used to that
316 software.
317
319 The apcsmart driver exposes following instant commands:
320
321 shutdown.return
322 executes soft hibernate
323
324 shutdown.return cs
325 executes "force OB hack"
326
327 shutdown.return at:<nbr>
328 executes "hard hibernate" with <nbr>*6 minutes additional wakeup
329 delay (<nbr> format is the same as of awd option)
330
331 shutdown.stayoff
332 executes "delayed poweroff"
333
334 load.off
335 executes "instant poweroff"
336
337 All the above commands must be issued 2nd time to have any effect (no
338 less than 3 seconds, and no more than 15 seconds after the initial
339 call). Those commands are mostly useful for manual testing, when your
340 machine is not powered by the UPS you're testing.
341
342 Other supported commands:
343
344 · load.on
345
346 · test.panel.start
347
348 · test.failure.start
349
350 · test.battery.start
351
352 · test.battery.stop
353
354 · bypass.start
355
356 · bypass.stop
357
358 · calibrate.start
359
360 · calibrate.stop
361
363 Previous driver is still available as apcsmart-old, should there be any
364 need to use earlier version (bugs, incompatiblities with new
365 functionality, etc.). In due time, apcsmart-old will be phased out
366 completely, but this won’t happen until the new version gets solid
367 exposure with no pending issues.
368
370 Some older APC UPS models return bogus data in the status register
371 during a front panel test. This is usually detected and discarded, but
372 some other unexpected values have occasionally slipped through.
373
374 APC UPS models with both USB and serial ports require a power cycle
375 when switching from USB communication to serial, and perhaps vice
376 versa.
377
379 Nigel Metheringham <Nigel.Metheringham@Intechnology.co.uk> (drawing
380 heavily on the original apcsmart driver by Russell Kroll). This driver
381 was called newapc for a time and was renamed in the 1.5 series. In
382 2.6.2 it was renamed to apcsmart-old, being superseded by updated
383 version with new features, which is maintained by Michal Soltys
384 <soltys@ziu.info>
385
387 nutupsdrv(8), ups.conf(5), usbhid-ups(8), solis(8)
388
389 Internet resources:
390 The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
391
392
393
394Network UPS Tools 2.7.3. 12/29/2015 APCSMART(8)