Page 2
19 Resetting settings to defaults 20 Specifications 21 Open source code 22 Technical support 23 Limited five year warranty Index 1 Overview Congratulations on selecting the DLI Universal Input PDU, a 80-240VAC rack PDU with WiFi. DLI V222 User’s Guide: 1.15.2.0...
Page 3
The firmware is based on open-source code which is provided to give you the option to build totally custom firmware. Please contact technical support in case of any problems. We offer a limited five-year warranty on these units. DLI V222 User’s Guide: 1.15.2.0...
• Universal Input PDU \productPackageAnnotation. \productPackageAccessories • RP-SMA WiFi Antenna. Please contact the freight carrier immediately if your package appears opened or damaged in transit. Call DLI at (408) 330-5599 for tech support, service, and hardware upgrades. DLI V222 User’s Guide: 1.15.2.0...
IP, such as 192.168.0.50. 4.3.1 Windows IP setup Before adding an IP, close all programs and browsers. After the link is established, you can enable DHCP. DLI V222 User’s Guide: 1.15.2.0...
Page 6
• In the search box on the taskbar, type control panel, and then select it. • Select Network and Sharing Center. • Change Adapter Settings. • Right click on your connected network and select Properties. • Proceed to step 2 DLI V222 User’s Guide: 1.15.2.0...
Page 7
9. Press the "Add" button; this new IP is added the list. 10. Close all windows for the configuration to take effect. 11. Start your Browser and type 192.168.0.100 in the URL field. The default user name and password are "admin" (lower case) and "1234". DLI V222 User’s Guide: 1.15.2.0...
Page 8
Note that in this and many other pages, logical blocks can be collapsed by clicking in their right-hand corner, and later expanded by clicking 4.6 Common page layout You can navigate the menu links to access the controller's features: DLI V222 User’s Guide: 1.15.2.0...
Browser logout is automatic when a session is closed or after a time-out period. You can use a menu link to log-out in advance. 5 LCD and keypad The LCD has 2 lines, 16 character positions each. The displayed data depends on the mode, and possibly also on user scripting. The keypad has 5 keys: DLI V222 User’s Guide: 1.15.2.0...
Page 10
• (OFF). During normal operation, the V222 LCD and keypad interface can be in one of the following modes: • Outlet mode, which displays status of and allows to manipulate the unit's outlets; • Meter mode, which allows to read measurements of the V222 meters ;...
In Meter mode, the keys allow to choose the selected meter. 5.3 Network mode Network mode In Network mode, the keys allow to select the network parameter. Network configuration submode The following parameters are present: DLI V222 User’s Guide: 1.15.2.0...
Page 12
Pressing saves the current value and starts network reconfiguration if needed. The display isn't updated in- stantly, and you need to refresh it by pressing . You can cancel editing at any time by pressing DLI V222 User’s Guide: 1.15.2.0...
A delay of 60 seconds is suggested for server applications. You may also enter a screen refresh delay in this section. If "Enable screen refresh" is checked, and a delay value is entered, your browser should periodically update the status screen. DLI V222 User’s Guide: 1.15.2.0...
Page 14
You may link to other power controllers, your own web pages, or remote web sites by entering up to four URLs and descriptions in the Setup page. For example, enter "Site Two Power Controller" in the description field with a URL of "http://192.168.0.250/". These links appear on every page of the main web UI. DLI V222 User’s Guide: 1.15.2.0...
You can limit the severity of the locally recorded log messages by setting a minimal severity. Note that the local log is circular, with old messages being replaced by newer ones; messages aren't persisted across reboots. For DLI V222 User’s Guide: 1.15.2.0...
DNS servers; rather, after the unit obtains a DHCP lease, the parameters will be displayed for reference. It is recommended to configure the DHCP server to provide a static lease for the V222 using its MAC address (also displayed).
You may press the "protect" button to lock the network settings (this will also affect the external API settings). Once locked, the network settings cannot be changed except by pressing the physical reset button on the front of the unit. DLI V222 User’s Guide: 1.15.2.0...
Page 18
Notice the outlet numbering difference for non-administrative users vs the previous generations of EPCR/LPC con- trollers. In V222, non-administrative users see all outlets accessible to them numbered consecutively starting from 1; previously the indices used to match those seen by the administrator. Naive outlet state manipulation links like http://192.168.0.100/outlet?3=ON...
6.7 HTTPS certificate generation and renewal HTTPS clients rely on certificates to ensure the server's identity. Operating as an HTTPS server, the V222 is capable of generating self-signed certificates or obtaining certificates from third parties, such as certificate authorities (CAs).
Page 20
HTTPS certificate settings Identity of the server is protected by a private key, which must be kept secret. V222 currently supports RSA private keys only; the number of bits can be configured. A key is generated by default; you can create a new one by pressing the "Generate"...
Page 21
Unlike the key, a certificate is public, not secret, and assures that its holder indeed is the entity it claims to be as long as the client trusts the certificate's issuer. To configure what your V222 claims to be, the following certificate signing request (CSR) fields need to be filled: •...
Let's Encrypt, Buypass, ZeroSSL and others. The current implementation only supports the http-01 challenge, so the V222 (or the network it is on) needs to be configured so that HTTP requests to the names and addresses specified and port 80 are routed to the unit's HTTP port.
On its own, a power switch isn't very smart. Programmers can easily add custom functionality by using the built-in Lua-based scripting language in power controllers. 7.1 Hardware requirements Lua-based scripting is available in all V222 controllers. Beeper, backlight, LCD, voltage and current monitoring functions are limited to products with appropriate hardware installed. 7.2 Configuration...
Page 24
Local functions declared this way must be placed before any function that uses it. If you want to move the definition elsewhere and don't need to call the function before the definition, you can use the following structure: local my_internal_function ... functions that use my_internal_function in bodies ... function my_internal_function() ... statements go here ... DLI V222 User’s Guide: 1.15.2.0...
Page 25
(such actions cannot be taken at script load time). 7.4 Snippets Snippets are script fragments not part of the main script, stored for later use or shipped with the device. DLI V222 User’s Guide: 1.15.2.0...
Page 26
... statements go here ... and then start it with the web UI, its origin is the "my_function" string. Threads created by other threads inherit their parent's origin, which can be useful when stopping a group of threads. DLI V222 User’s Guide: 1.15.2.0...
Page 27
— serial number; – — firmware version; – — system time/date; – — MAC address of the power controller; – — IP address of the power controller; – — IP network mask; – — IP gateway; DLI V222 User’s Guide: 1.15.2.0...
Page 28
This extension is only available in the user scripting environment at the moment (i.e. not in OS-level scripts notification rules or sinks). Additionally, points to the sandbox environment. Unlike most APIs, core Lua functions are available in the global context. DLI V222 User’s Guide: 1.15.2.0...
Page 29
1 on at 8:00 and off at 17:00. while true do local event=wait_until({hour=8,min=0},{hour=17,min=0}) if event==1 then ON(1) else -- event==2 OFF(1) delay (120) We match with minute precision here and wait for 2 minutes to avoid double matching. DLI V222 User’s Guide: 1.15.2.0...
Page 30
LCD rows (or nil for regular operation of said row). This offers more fine-grained control than the DISPLAY command above. As follows from the above, the number of LCD rows is # ui.line . Use ui.column_count to retrieve the number of LCD columns (usually 16). DLI V222 User’s Guide: 1.15.2.0...
Page 31
To store arbitrary data between script edits, you can create entries in the global sticky table, like this: DLI V222 User’s Guide: 1.15.2.0...
Page 32
0)+1 sticky.global_var=(sticky.global_var or 0)+1 Variables created this way are not persisted across reboots; see below for those that are. DLI V222 User’s Guide: 1.15.2.0...
Page 33
. Only numbers, strings and booleans can be stored (or nil can be written to erase a value). Some of these limitations may be raised in future. All keys of persistent can be enumerated if necessary using pairs() DLI V222 User’s Guide: 1.15.2.0...
Page 34
• meter.values[key].custom : boolean indicating if the value is custom (user-defined); • meter.values[key].bus : always nil for V222; • meter.values[key].internal : boolean indicating if the value is internal (and should not appear in the web UI); • : function which can be called to obtain historical data points.
Page 35
: maximum consecutive reboot count; • autoping.pings_before_enabling : pings before enabling; • autoping.resume_without_retrial : activate enabled entries immediately when service is re- stored; • autoping.handle_failures_immediately : handle explicit failures immediately instead of waiting for timeout. DLI V222 User’s Guide: 1.15.2.0...
Page 36
For example, the following code event.send("coil 1 energized",{coil_index=1,coil_state=true}) will send an event that can be matched by, among others, the following notification rules: DLI V222 User’s Guide: 1.15.2.0...
Page 37
. Additionally, objects may not receive change notifications for properties you haven't previously read or written. The following example function can be used to attempt to mirror physical state of outlet 1 to outlet 2: DLI V222 User’s Guide: 1.15.2.0...
Page 38
UTC time with event.utc_time which has no corresponding wait_until option. Events have a timestamp and a property table as components; the property table contains the following fields: • index : the condition's number in the argument list; DLI V222 User’s Guide: 1.15.2.0...
Page 39
You can also just use thread.kill if you don't need the looping thread at all any longer. DLI V222 User’s Guide: 1.15.2.0...
Page 40
• , in which case the child process receives /dev/null for that descriptor; or DLI V222 User’s Guide: 1.15.2.0...
Page 41
SIGSTOP • "usr1" or "usr2": the SIGUSR1 SIGUSR2 signals, which can be handled by the process in an application- specific way but but result in process termination by default. DLI V222 User’s Guide: 1.15.2.0...
Page 42
To help that, util.json.encode accepts an optional second argument, which is an "empty array table", that is, a table with keys corresponding to empty Lua tables in the input which represent empty JSON arrays. For example, DLI V222 User’s Guide: 1.15.2.0...
Page 43
It could be implemented as: util.argunpack=function(tbl) return unpack(tbl,1,tbl.n) In combination, allow perfect function argument forwarding in presence util.argpack util.argunpack arguments. Unlike most APIs, utility functions are available in the global context. DLI V222 User’s Guide: 1.15.2.0...
Even with the scripting step delays, it is possible to create a script which will rapidly cycle a relay. This rapid cycling could result in a over current condition, tripped breaker, or stress to the power controller or attached equipment. Please be reasonable! DLI V222 User’s Guide: 1.15.2.0...
It's important to note that rules are processed linearly: adjustment of properties doesn't cause preceding rules to be re-examined. Additionally, different event types have more specific properties. All event properties can be checked for or adjusted. The following convenience severity level constants are defined: DLI V222 User’s Guide: 1.15.2.0...
Page 46
<none> Context engine ID Context name SNMP v3 inform Privacy passphrase Privacy protocol <none> Security engine ID Security name Default trap OID Notification target configuration Other target properties depend on the kind of the target. DLI V222 User’s Guide: 1.15.2.0...
Page 47
CA root certificates (it may point to a single file listing all of them, or to a directory containing the certificate files in OpenSSL format, and defaults to /etc/ssl/certs DLI V222 User’s Guide: 1.15.2.0...
Page 48
Its OID is 1.3.6.1.4.1.45770.0.1; this can be specified directly for SNMPv2c or SNMPv3, or as an enterprise-specific (generic trap type=6) DLI ("enterprise OID"=45770) trap #1 (specific trap type=1). Security settings SNMPv1 and SNMPv2c use the 'community' security model which essentially identifies users by a shared secret which is sent over the network in plain text ('public' and 'private' being the most popular 'secrets').
Page 49
• default specific trap type (number 0..2147483647). SNMP v1 accepts snmp_enterprise_oid snmp_generic_trap_type snmp_specific_ trap_type event properties to override the trap OID; they must be integers or string representations thereof. It also accepts the snmp_values event property as described above. DLI V222 User’s Guide: 1.15.2.0...
Page 50
SNMP v3 TRAPs and INFORMs accept an snmp_trap_oid event property to override the trap OID; it must be a string. They also accept the snmp_values event property as described above. DLI V222 User’s Guide: 1.15.2.0...
Page 51
(i.e. should a particular be encoded as a JSON array or an object) in payload For instance, if a sink named "admin" is configured as a JSON webhook, the following action: DLI V222 User’s Guide: 1.15.2.0...
Page 52
1 outlet==1 notify("admin") 2 severity>=CRITICAL Submit Notification rule configuration A condition is a Lua expression, while rules are Lua blocks (may contain several statements). Roughly, the condition/action table is equivalent to: DLI V222 User’s Guide: 1.15.2.0...
Page 53
Underlined items (both in the message and in the 'extra properties' column) specify properties which can be checked for. You can hover them for more detailed descriptions. 9 Customization page The customization page allows the administrator to configure some user interface aspects of controller behavior. DLI V222 User’s Guide: 1.15.2.0...
You can choose which units to display temperature, illuminance and energy values in. This affects both textual and graphical web UI display. Note that it's a presentation option only; values are internally stored, and transferred via REST-like API in standard SI units (degrees Kelvin, lux and joules, respectively) regardless of the customization. DLI V222 User’s Guide: 1.15.2.0...
Page 55
Browsers can normally issue GET and POST requests with URL-encoded or multipart content types; you can tick the corresponding "relax ... checks" checkboxes to skip the checks in cases where the method or content type indicates that the request couldn't have been sent by a browser without JavaScript. DLI V222 User’s Guide: 1.15.2.0...
Page 56
"percent-encoded" (regular) byte. Depth-limited queries are not implemented; however, you can use the matrix URI mechanism to extract just the keys of a container to browse the hierarchy shallowly. DLI V222 User’s Guide: 1.15.2.0...
Page 57
The 'invoke' subcommand is intended for calling object methods; it is similar to a 'POST' request; however, the argument list is specified as a number of positional arguments (as is common in shell scripts) instead of a JSON array. uom invoke <uom/path> [arg [arg ...]] DLI V222 User’s Guide: 1.15.2.0...
Page 58
If you maintain nontrivial command-line scripts, you may want to store them under the directory, which /storage is reserved for the unit administrator and is persisted across upgrades. Refer to the REST-style API reference for details. DLI V222 User’s Guide: 1.15.2.0...
Page 59
• uom.copy(obj) uom.equals(a,b) uom.merge(to,from) utility functions perform deep copying, equality check and merging of tables (including object model entities); DLI V222 User’s Guide: 1.15.2.0...
Page 60
Note that attempts to change a table after it has been assigned to an object model field or inserted into an object model container will not work as expected: DLI V222 User’s Guide: 1.15.2.0...
Page 61
'empty array table' consulted to resolve the Lua empty table encoding ambiguity (i.e. should a particular be encoded as a JSON array or an object). For instance, local array={} local object={} print(uom.json.encode({array,object},{[array]=true})) DLI V222 User’s Guide: 1.15.2.0...
Page 62
If you maintain nontrivial OS-level Lua scripts, you may want to store them under the directory, which /storage is reserved for the unit administrator and is persisted across upgrades. Refer to the REST-style API reference for details. DLI V222 User’s Guide: 1.15.2.0...
The unit's outlets can be exposed via UPnP as devices with different profiles. The currently supported profile is a Belkin WeMo socket. Additional XML information elements can be exposed in the discovery responses for outlets under the device ele- ment, if enabled: <root ...> DLI V222 User’s Guide: 1.15.2.0...
('.'). A leading dot may be used to emphasize that it's an absolute OID; however, all of the OIDs configurable in V222 are absolute unless otherwise stated explicitly, and the leading dot is not needed, therefore, it's not supported.
Page 65
'public' community string coming from the same subnet will be served as the 'powerReader' user. 10.9 SNMP extensions The Net-SNMP agent included in V222 has built-in support for several well-known MIBs, e.g. the System group (RFC 3418) with the root at 1.3.6.1.2.1.1, enabling access to which may be required for integrating with management stations.
Page 66
• , followed by the OID to write to, and a string with the type and value to write; • an empty line, which indicates a graceful shutdown request. Additionally, the following commands are DLI extensions: • TRAITS trait_mask , to which a TRAITS trait_mask response is expected;...
Page 67
OID tree if you choose to place them there. The following member functions are provided on make_server results: DLI V222 User’s Guide: 1.15.2.0...
Page 68
In the default configuration, the security level for accessing the energy object MIB subtree is high. You can set the access level to 'Minimal' to interact with the device using SNMPv2c and SNMPv1, or use SNMPv3 instead, which is the recommended and more secure alternative. DLI V222 User’s Guide: 1.15.2.0...
Page 69
10.11 SNMP sample commands These examples assume you have your V222 at 192.168.0.100 with SNMPv3 user configured with powerAdmin SHA1 for authentication and AES for encryption, with password powerAdminPassword for both authentication and encryption. Requests with the private community string are assumed to be serviced as though they were made by the user.
Page 70
General MQTT settings V222 can function as an MQTT client, so you need to have a configured MQTT broker which it could connect to; then, other MQTT clients connected to the same broker could communicate with it (multi-broker configurations are also possible but out of scope of this document).
Page 71
MQTT payload format is not defined by a standard, so we explicitly define it here. Everything that can be controlled via MQTT in V222 is an outlet state, which can be ON or OFF. We encode ON as '1' (the single ASCII character '1') and OFF as '0'.
Page 72
These examples assume you have an MQTT broker at 192.168.0.5, it doesn't require authentication and you have the V222 set up like shown on screenshots above. You'll need the mosquitto MQTT client to run these samples; analogous commands should be available for other clients.
The setting backup/restore system operates on a file level. It allows saving and restoring most configuration items, including those which have been done manually, e.g. via SSH. Settings can be backed up and restored selectively. DLI V222 User’s Guide: 1.15.2.0...
Page 74
Files are restored one by one, unless they logically form an indivisible group. A file's state consists of its presence, access bits and content. Each file or group to be restored is analyzed from the point of view of four states: • the current state; DLI V222 User’s Guide: 1.15.2.0...
Page 75
'keep' or 'overwrite' default action, uses the same action for all files and groups. DLI V222 User’s Guide: 1.15.2.0...
Configure update process Beep during upgrade Blink during upgrade Preserve user-installed packages on upgrade Save Firmware update configuration page You may protect the current firmware from modification. Pressing the hardware reset button will be required to unlock. DLI V222 User’s Guide: 1.15.2.0...
Page 78
Post-firmware upgrade initialization indication 13 Date/time The Date / Time page allows the administrator to set the internal clock and time zone. The clock may be set within the browser or synchronized with an NTP server. DLI V222 User’s Guide: 1.15.2.0...
Total times to attempt reboot: tries. (1-255, or 0 for no limit) Device reboot delay: seconds. (1-43200) Handle failures immediately instead of waiting for timeout: Activate enabled entries without trial on service restoration: Apply Common AutoPing settings DLI V222 User’s Guide: 1.15.2.0...
Page 80
To actually use AutoPing, add one or more AutoPing targets (IP addresses) to the list. The button is used to remove a target from the list. Below is an example AutoPing configuration with four targets: DLI V222 User’s Guide: 1.15.2.0...
Page 81
You can select a scripting action to perform when the AutoPing item triggers (by default the selected outlets are cycled). The action must be a function defined in the scripting server, like function action_to_perform() or e.g. DLI V222 User’s Guide: 1.15.2.0...
Page 82
A similar situation will occur if you reconfigure the controller to use a new IP network from which old addresses are unreachable. Use the link:// scheme to check for local link loss. DLI V222 User’s Guide: 1.15.2.0...
Page 83
(when an outage occurred after a request has been sent) The events associated with item trial before enabling are self-explanatory: • item ... (addresses...) enable approved • item ... (addresses...) enable cancelled • item ... (addresses...) trial restarted due to address list changes DLI V222 User’s Guide: 1.15.2.0...
Temperature Minimal value: Width: Height: Pointer color: Scale: linear Number of decimal places: Save Basic meter configuration The basic meter properties include: • the title; • the width in pixels; • the height in pixels; DLI V222 User’s Guide: 1.15.2.0...
Page 85
The sector properties include: • the name of the sector (currently unused); • the maximum value for the sector (and also the minimum value for the next sector); • the sector color, in hex web notation without '#'. DLI V222 User’s Guide: 1.15.2.0...
Page 86
The basic meter properties include: • the title; • the width in pixels; • the height in pixels. The rest of meter configuration is centered around axes and plot lines which are drawn on them. DLI V222 User’s Guide: 1.15.2.0...
Page 87
Line kind: Lines only Line type: Solid Line width: Marker type: Plus Marker size: 0 Base axes: X1, Y1 Save Configuration of a plot line Each plot line can be one of the following styles: DLI V222 User’s Guide: 1.15.2.0...
Page 88
This will open the interval alert configuration page for it. Every measured value is a just a number, or 'none' for some meters on some devices which are detachable, so it makes sense to say there's no value. DLI V222 User’s Guide: 1.15.2.0...
Page 89
The exception is the lowest interval which has no threshold point (but still has a level and a period). The "none" value is considered so distinct from all regular values that no hysteresis is possible, so it is also characterized by a level and a period only. The above sample configuration might look like this: DLI V222 User’s Guide: 1.15.2.0...
Page 90
16 User-installable packages Installing third-party packages allows the administrator to improve connectivity and simplify administration of the controller. 16.1 Obtaining package lists To download the lists of packages available for installation, run: # opkg update DLI V222 User’s Guide: 1.15.2.0...
Package versions in the DLI repository are directly linked to the firmware version; on an upgrade, the version of the re-downloaded manually installed package will match the new firmware version. 16.3 WireGuard-based VPNs Several modern VPN packages based on WireGuard are available, which provide encrypted mesh networking.
Page 92
Please do the SSO login in your browser. If your browser didn't open automatically, use this URL to log in: https://login.netbird.io/activate?user_code=ABCD-EFGH This should get your device online. Check with # ifconfig wt0 Refer to NetBird documentation for self-hosting. DLI V222 User’s Guide: 1.15.2.0...
Page 93
# opkg install innernet Innernet coordination server needs to be hosted on a node with a public IP. If you wish to run the coordination server on a DLI unit, instead run: # opkg install innernet-server It's important that the two above packages are mutually exclusive:...
Page 94
EtherIP, L2TPv3, Cisco VPN Routers and MS-SSTP VPN. Install the components you need: # opkg install softethervpn-server and/or # opkg install softethervpn-client and/or # opkg install softethervpn-bridge 16.6.2 Mikrotik EoIP tunnel support eoip package can create ethernet tunnels compatible with Mikrotik EoIP tunnel: # opkg install eoip DLI V222 User’s Guide: 1.15.2.0...
Page 95
# opkg install openssh-server 16.9 MQTT-related packages To install the Mosquitto MQTT broker, run: # opkg install mosquitto If you're interested in sending and receiving MQTT messages from the command line, run: # opkg install mosquitto-client DLI V222 User’s Guide: 1.15.2.0...
# opkg install screen 16.13 Terminal session recording The traditional script scriptreplay utilities are available in the script-utils package: # opkg install script-utils DLI V222 User’s Guide: 1.15.2.0...
The following operations available to the administrator pose an increased risk and can be protected: • changing administrator credentials; • changing networking settings; • changing notification settings; • backing up private settings (passwords, keys, etc.); • restoring settings from backup; • upgrading firmware; • entering maintenance mode. DLI V222 User’s Guide: 1.15.2.0...
Page 98
, or short presses of the reset button, to select a reset mode. A description of the currently selected mode is displayed on the second LCD line. The following reset modes are available: 1. Clear lock bits: Clear protection bits only. Other settings are preserved. DLI V222 User’s Guide: 1.15.2.0...
Purchasing a TLA and signing an NDA from Atheros are highly recommended before attempting any custom devel- opment; however, they aren't required to build the firmware (only the bootloader). DLI cannot provide warranty or technical support for modified units; this includes units with custom firmware. 22 Technical support Please register.
DLI. DLI's entire liability and exclusive remedy as to defective hardware shall be, at DLI's option, either (a) return of the purchase price or (b) replacement or repair of the hardware that does not meet DLI's quality control standards and has been returned through proper RMA procedures. DLI's liability for repair or replacement is to DLI's customer ONLY.
Page 102
Index AutoPing, Backing up and restoring settings, Basic setup and use, Customization page, Date/time, Energy monitor, Event notification, External APIs, Firmware upgrade, LCD and keypad, Limited five year warranty, Locking down the controller, Open source code, Overview, Package contents, Product features, Resetting settings to defaults, Scripting, Setup page,...
Need help?
Do you have a question about the V222 and is the answer not in the manual?
Questions and answers