In general, PyNetioConf can be used in two ways. As a tool for developers managing more complicated tasks together with Python, or for standard users to remotely control NETIO devices.
Key Features of PyNetioConf:
- Remote Power Control: PyNetioConf provides functionality to remotely turn on, turn off, or restart connected devices via NETIO's network-controlled power outlets.
- Configuration setup: PyNetioConf allows users to configure their NETIO device features, such as (network/Wi-Fi, Schedule, API, Users & permissions…etc)
- FW upgrade – PyNetioConf library allows performing firmware upgrades on NETIO devices
- Status Monitoring: PyNetioConf can retrieve the status of outlets, FW version, APIs status, get value from electrical characteristic measurements.
- Certificate upload: PyNetioConf can be used to upload certificates and connect to IoT cloud providers such as AWS IoT
Common Use Cases:
- Pre-configuration for set of NETIO devices
- FW upgrade for multiple NETIO devices at the same time
- Uploading Certificate AWS
- Device troubleshooting
Supported devices:
All NETIO devices from FW version 3.2.6
- PowerBOX 3Px
- PowerBOX 4Kx
- PowerPDU 8KS
- PowerPDU 8QS
- PowerPDU 4KS
- PowerPDU 4PS
- PowerDIN 4PZ
- PowerCable 2KZ
- PowerCable 2PZ
Basic Example in PyNetioConf:
Here’s an example to demonstrate how PyNetioConf might be used to control a NETIO device:
PyNetioConf may require configuration of your NETIO device to ensure it allows remote control and monitoring over the network. Typically, this involves setting a static IP or configuring the device’s communication protocol as needed.
from PyNetioConf import NetioManager nm = NetioManager() device = nm.init_device("192.168.1.111", "demo", "demo") You can now control and configure the device using its class methods # To set output 1 as OFF device.set_output(1, False) # To set output 1 as ON device.set_output(1, True) # To read out output states device.get_output_states() # to get JSON API state device.get_json_api_state() |
Additional commands from PyNetioConf library
|
To upgrade NETIO FW via PyNetioConf
from PyNetioConf import NetioManager
# To connect to devices we create an instance of NetioManager, which will manage # sessions and devices, and ensure a singular connection to a device from the script nm = NetioManager()
# To get a device object from NetioManager we use the init_device method DEVICE_IP = "192.168.1.17" USERNAME = "admin" PASSWORD = "admin" FIRMWARE_PATH = "/path/to/firmware/file.package"
netio_device = nm.init_device(DEVICE_IP, USERNAME, PASSWORD)
# Now that we have the device connected we ensure that we get responses from the device print(netio_device.get_output_states()) # And just to be sure, let's print out the device version print(netio_device.get_version_detailed())
# Now that we know the device is connected and alive, we can upgrade the firmware # Note this operation can take considerable time, even over 5 minutes in some cases with open(FIRMWARE_PATH, "rb") as fw_file: netio_device.update_firmware(fw_file) |
Documentation:
Full documentation including examples is available on NETIO GitHub repositary https://github.com/netioproducts/PyNetioConf
FAQ:
Is PyNetioConf working on different operating system Linux/ MAC/Windows?
Yes – on Mac, Linux – Python interpreter is installed by default. Windows users shall install native Python from python.org
What is minimum NETIO device fw version supporting PyNetio?
Netio Device shall run on fw 3.2.6.+