The K7NVH PoE PDU is a device designed to provide remote power control of PoE devices in an affordable, low power, and flexible package. Each port is rated to handle 1.2 amps, and can also measure the current and power flowing through each port.
A variety of features are available, including user defined overcurrent protection, automatic port control based on voltage thresholds, human readable and parseable status displays, port cycling with user defined delay, user defined port state on PDU startup, and user defined names for each port and the PDU itself.
Power is supplied to the device via a buck regulator tied to the MAIN bus.
The device is available to the host system as a USB serial device, which when accessed accepts a number of basic ASCII commands which can be entered manually, or via a user created script to automate control actions.
This repository contains the source code to be compiled with AVR-GCC, and uploaded to the device via ATMEL's FLIP programmer or the dfu-programmer utility.
The 'HELP' command will print a short message referencing the project page containing documentation.
The 'STATUS' command is designed to give an overview of the running state of each port on the PDU. The port numbers, any configured custom port names, and port state (ENABLED/DISABLED) will be displayed. Input voltage, board temperature, and per port current and power values will be shown. Messages that ports have been disabled due to overload, or are under automatic voltage control are displayed if applicable. Note that power values are calculated based on the bus voltage. You will need to set which bus ports are physically connected to for accurate power readings.
> STATUS
Main Voltage: 24.12V
Alt Voltage: 12.24V Temperature: 29C
PORT 1 "Port 1": ENABLED Current: 0.00A Power: 0.0W (MAIN BUS)
PORT 2 "Port 2": ENABLED Current: 0.04A Power: 0.9W (MAIN BUS)
PORT 3 "Port 3": ENABLED Current: 0.01A Power: 0.2W (MAIN BUS)
PORT 4 "Port 4": ENABLED Current: 0.00A Power: 0.1W (MAIN BUS)
PORT 5 "Port 5": ENABLED Current: 0.02A Power: 0.4W (MAIN BUS)
PORT 6 "Port 6": ENABLED Current: 0.03A Power: 0.8W (MAIN BUS)
PORT 7 "Port 7": ENABLED Current: 0.02A Power: 0.5W (MAIN BUS)
PORT 8 "Port 8": ENABLED Current: 0.00A Power: 0.1W (MAIN BUS)
PORT 9 "Port 9": ENABLED Current: 0.05A Power: 1.1W (MAIN BUS)
PORT 10 "Port 10": ENABLED Current: 0.00A Power: 0.1W (MAIN BUS)
PORT 11 "Port 11": ENABLED Current: 0.00A Power: 0.0W (MAIN BUS)
PORT 12 "Port 12": ENABLED Current: 0.00A Power: 0.1W (MAIN BUS)
The 'PSTATUS' command is designed to give an overview of the running state of the PDU in a easily parseable format for use with programs querying the PDU for information. The output is in a simple CSV format, defined as follows.
K7NVH DC PDU,Version Number,Device Name
MAIN Bus Input Voltage, ALT Bus Input Voltage, CPU Temperature
Port Number,Port Name,Binary Enabled/Disabled Flag,Port Current,Port Power,Binary Overload Flag,Automatic Voltage Control Flag,ALT Bus Flag (1 = ALT Bus, 0 = MAIN Bus)
(The above line is repeated for each port)
An example output might look like the following.
> PSTATUS
K7NVH PoE PDU,1.0,PoE-PDU
24.12,12.24,27
1,Port 1,1,0.00,0.0,0,0,0
2,Port 2,1,0.04,0.9,0,0,0
3,Port 3,1,0.01,0.2,0,0,0
4,Port 4,1,0.00,0.1,0,0,0
5,Port 5,1,0.02,0.4,0,0,0
6,Port 6,1,0.03,0.8,0,0,0
7,Port 7,1,0.02,0.5,0,0,0
8,Port 8,1,0.00,0.1,0,0,0
9,Port 9,1,0.05,1.1,0,0,0
10,Port 10,1,0.00,0.1,0,0,0
11,Port 11,1,0.00,0.0,0,0,0
12,Port 12,1,0.00,0.1,0,0,0
The 'PON' command is used to enable one or more ports on the PDU.
The PDU supports enabling multiple ports at a time. For example, all of the following are valid 'PON' syntaxes. 'A' can also be substituted for a port number to enable all ports.
PON 1
PON 1 2 3 4
PON A
The 'POFF' command is used to disable one or more ports on the PDU.
The PDU supports disabling multiple ports at a time. For example, all of the following are valid 'POFF' syntaxes. 'A' can also be substituted for a port number to disable all ports.
POFF 1
POFF 1 2 3 4
POFF A
The 'PCYCLE' command is used to disable one or more ports on the PDU for a period of time set by the 'SETCYCLE' command, after which, the port is enabled again.
If 'PCYCLE' is issued on a port that is already disabled, the port will remain disabled for the period of time set by the 'SETCYCLE' command, and will be enabled with any other ports specified.
The PDU supports cycling multiple ports at a time. 'A' can also be substituted for a port number to cycle all ports. The following are valid PCYCLE syntaxes. PCYCLE 1
PCYCLE 1 2 3 4
PCYCLE A
The 'PLOCKON' command is used to lock a port, preventing user initiated conrols (PON/POFF/PCYCLE).
The PDU supports setting multiple ports at a time to be locked. 'A' can also be substituted for a port number to change all ports. PLOCKON 1
PLOCKON 1 2 3 4
PLOCKON A
The 'PLOCKOFF' command is used to unlock a port, allowing user initiated conrols (PON/POFF/PCYCLE) on a previously locked port.
The PDU supports setting multiple ports at a time to be unlocked. 'A' can also be substituted for a port number to change all ports. PLOCKOFF 1
PLOCKOFF 1 2 3 4
PLOCKOFF A
The 'SETCYCLE' command is used to set the period of time in seconds that ports will be disabled on the PDU during a 'PCYCLE' command. This command has no immediate impact on any ports.
Valid range for the 'SETCYCLE' command is 0-30 seconds. 0 seconds being no delay between disabling and re-enabling a port, and 30 seconds being the maximum delay allowable.
For example, to set a 5 second delay, the following is valid 'SETCYCLE' syntax. SETCYCLE 5
The 'SETDEFON' command is used to store the desired default state of a given port at PDU boot time to enabled. The PDU will default to all ports being enabled at boot, but you may leave ports disabled at boot with the 'SETDEFOFF' command, or set them back to enabled via 'SETDEFON'.
The PDU supports setting multiple ports at a time to be enabled by default. 'A' can also be substituted for a port number to change all ports. SETDEFON 1
SETDEFON 1 2 3 4
SETDEFON A
The 'SETDEFOFF' command is used to store the desired default state of a given port at PDU boot time to disabled. The PDU will default to all ports being enabled at boot, but you may leave ports disabled at boot with the 'SETDEFOFF' command, or set them back to enabled via 'SETDEFON'.
The PDU supports setting multiple ports at a time to be disabled by default. 'A' can also be substituted for a port number to change all ports. SETDEFOFF 1
SETDEFOFF 1 2 3 4
SETDEFOFF A
The 'SETNAME' command is used to store a user defined "helpful" name for each port on the PDU. By default the custom names are blank, but they may be set to a user defined string of up to 15 characters in length. Strings longer than 15 characters will be truncated.
The user defined name will be displayed alongside the port number in the output from the 'STATUS' command.
The PDU supports setting only one port name at a time. The following is an example of valid 'SETNAME' syntax, setting Port 1's name to "Testing". SETNAME 1 Testing
The 'SETNAME' command can also be used to give the PDU device an overall name by using 'P' in place of the port number. The device name will be displayed as part of the input prompt as a visual aid to ensure users are interacting with the intended device. The following is an example of valid 'SETNAME' syntax to set the device name. SETNAME P PDU-Test
The same string length limits that apply to individual port names also apply to the device name.
The 'SETLIMIT' command is used to store a user defined overload current limit for each port on the PDU. By default the current limit is set to 10 amps. While the PDU is not rated for this current flow, 10A was chosen to effectively "disable" current limits from disabling PDU ports.
During normal operation the PDU will continuously check current flow on each port, and compare against the stored limits. If a port is found to exceed the stored limit for greater than 10ms (milliseconds), the port will be disabled, a warning message will be printed, and a overload flag will be displayed in the 'STATUS' output.
If a port has been disabled due to current overload, the port can be re-enabled with a manual 'PON' command.
'SETLIMIT' is set in units of mA (milliamps), and accepts values from 0 to 10000 (0 to 10 amps). However, the provided input will be truncated to tenths of amps. For example, a value of 1150, will be truncated to 1.1A.
The PDU supports setting only one port limit at a time. The following is an example of setting Port 1's current limit to 1.5A. SETLIMIT 1 1500
The 'VCTLON' command is used to enable the PDU to control a given port automatically based on the sensed input voltage. This setting is persistent across reboots of the PDU device. Automatic voltage control of a given port is disabled until manually enabled again, or the PDU is rebooted, in the case of any manual action controlling a port, or an overload condition disables a port.
Note that voltage control acts based on the configured bus for the given port. You will need to set the proper bus to reference voltage control against with the SETBUSMAIN/SETBUSALT commands.
The voltage thresholds for enabling and disabling a port are set with the 'SETVCTLON' and 'SETVCTLOFF' commands.
Input voltage is polled approximately every 5 seconds, and ports will be enabled/disabled after two consecutive polling cycles have shown voltages beyond the configured thresholds.
Automatic voltage control can be very helpful for battery powered environments, to disable devices if available battery power runs too low. As each port can have unique settings, the user can configure staggered shutdown or startup for equipment as batteries are drained, and subsequently recharged.
The PDU supports setting multiple ports at a time for automatic control. The following are examples of valid syntax for enabling automatic control. VCTLON 1
VCTLON 1 2 3 4
The 'VCTLOFF' command is used to disable the PDU from controlling a given port automatically based on the sensed input voltage. This setting is persistent across reboots of the PDU device.
The PDU supports setting multiple ports at a time for disabled automatic control. The following are examples of valid syntax for disabling automatic control. VCTLOFF 1
VCTLOFF 1 2 3 4
The 'SETVCTLON' command is used to set the voltage, at which a port should be enabled, when configured for automatic control. By default this value is set at 40 volts, the limit of the PDU device, effectively disabling automatic port control.
'SETVCTLON' is set in units of hundredths of volts, and accepts values from 0 to 4000 (0 to 40 volts).
Note that voltage control acts based on the configured bus for the given port. You will need to set the proper bus to reference voltage control against with the SETBUSMAIN/SETBUSALT commands.
The PDU supports setting only one port enable threshold at a time. The following is an example of setting the enable threshold of Port 1 to 10 volts. SETVCTLON 1 1000
The 'SETVCTLOFF' command is used to set the voltage, at which a port should be disabled, when configured for automatic control. By default this value is set at 0 volts, effectively disabling automatic port control.
'SETVCTLOFF' is set in units of hundredths of volts, and accepts values from 0 to 4000 (0 to 40 volts).
The PDU supports setting only one port disable threshold at a time. The following is an example of setting the disable threshold of Port 1 to 10 volts. SETVCTLON 1 1000
The 'SETVREF' command is used only during calibration of the PDU. Measuring the voltage reference regulator with an accurate voltage meter, the calibration of voltage and current measurements can be updated.
'SETVREF' is set in units of mV (millivolts), and accepts values from 4000 to 4400 (4.0V to 4.4V). The default value if uncalibrated is the regulator's nominal output voltage of 4.2V.
For example, to set the voltage reference calibration to 4.2V, the following are valid 'SETVREF' syntaxes. SETVREF4200
SETVREF 4200
The 'SETVCALMAIN' command is used only during calibration of the PDU. Measuring the voltage divider on the MAIN bus with an accurate voltage meter, calibration of MAIN bus voltage supply measurements can be made.
'SETVCALMAIN' is a unitless multiplier, specified in VALUE*10, and accepts values from 170 to 130 (17.0X to 13.0X). The default value if uncalibrated is the dividers's nominal voltage division of 15.0X.
For example, to set the divider reference calibration to 15.0X, the following are valid 'SETVCALMAIN' syntaxes. SETVCALMAIN150
SETVCALMAIN 150
The 'SETVCALALT' command is used only during calibration of the PDU. Measuring the voltage divider on the ALT bus with an accurate voltage meter, calibration of ALT bus voltage supply measurements can be made.
'SETVCALALT' is a unitless multiplier, specified in VALUE*10, and accepts values from 170 to 130 (17.0X to 13.0X). The default value if uncalibrated is the dividers's nominal voltage division of 15.0X.
For example, to set the divider reference calibration to 15.0X, the following are valid 'SETVCALALT' syntaxes. SETVCALALT150
SETVCALALT 150
The 'SETICAL' command is used only during calibration of the PDU. Measuring the gain on the current sensor for a given port with an accurate meter, calibration of current sense measurements can be made.
'SETICAL' is a unitless multiplier, specified in VALUE*10, and accepts values from 480 to 520 (48.0X to 52.0X). The default value if uncalibrated is the nominal gain of 50.0X.
For example, to set the calibration on port 1 to 50.0X, the following is valid 'SETICAL' syntax. SETICAL 1 500
The 'SETBUSMAIN' command is used to reference a given port against the MAIN bus voltage. This voltage reference is used in Power calculations, as well as in voltage control.
The PDU supports setting multiple ports at a time to be referenced to the MAIN bus. 'A' can also be substituted for a port number to change all ports. SETBUSMAIN 1
SETBUSMAIN 1 2 3 4
SETBUSMAIN A
The 'SETBUSALT' command is used to reference a given port against the ALT bus voltage. This voltage reference is used in Power calculations, as well as in voltage control.
The PDU supports setting multiple ports at a time to be referenced to the ALT bus. 'A' can also be substituted for a port number to change all ports. SETBUSALT 1
SETBUSALT 1 2 3 4
SETBUSALT A
The 'SETOFFSET' command is used to store the current sense offset for a given port in raw ADC counts. This command is used only during calibration of the PDU. Raw ADC counts are available via the DEBUG command, and should be taken while the port is on, but no device is plugged in to offset the sensor error plus the status LED current.
For example, to set the ADC offset for port 1 to 0 ADC counts, the following is valid 'SETOFFSET' syntax. SETOFFSET 1 0
The 'DEBUG' command is useful for debugging PDU state. It will output a variety of values, and may not be formatted for easy understanding.
In the cases of unset or default values, the 'DEBUG' command may return a number of unprintable characters to your terminal. This is expected behavior.
The PDU board is automatically recognized as a USB serial device under OSX and Linux, however, windows requires a driver to associate the device with the built in USB serial device drivers.
When first attaching the device to a windows based host, windows will attempt to find a driver and fail. You may then specify a driver. This is provided in K7NVH_PDU.inf.
Once you have installed the driver, the PDU will register as a COM port device under windows, and you may access it with any serial/terminal application of your preference.
During the driver installation process on Windows 8 operating systems you may encounter "The third-party INF does not contain digital signature information" preventing the installation of the included PDU driver. The steps below outline the process for disabling driver signature enforcement on Windows 8/8.1 systems.
NOTE: If your system uses BitLocker Drive Encryption, you will need your encryption key to gain access to advanced settings to disable driver signature enforcement.
Windows 8 - Navigate to PC settings > General and look for the Advanced startup dialog. Click the Restart now button to access the advanced startup settings. Your system will now reboot.
Windows 8.1 - Navigate to PC settings > Update and Recovery > Recovery and look for the Advanced startup dialog. Click the Restart now button to access the advanced startup settings. Your system will now reboot.
After rebooting select Troubleshoot > Advanced options > Startup Settings, click the Restart button, your machine will reboot a second time.
After rebooting a second time you should be presented with the Windows Startup Settings dialog, choose Disable driver signature enforcement by pressing number 7
on your keyboard. Your machine will reboot automatically.
Once rebooted, you should now be able to install the PDU drviers as outlined above. Once the appropriate driver is selected you will see a Windows Security dialog warning against the installation of the unsigned driver. Click Install this driver software anyway to complete the driver installation.