Use The Local Rest Api To Configure The Connect It 16/48 Device - Digi Connect IT 16 User Manual

Hide thumbs Also See for Connect IT 16:
Table of Contents

Advertisement

Applications
[3]})
if leases:
client.publish(PREFIX_EVENT + "/leases", json.dumps(leases,
separators=(',',':')))
except:
print("Failed to open DHCP leases file")
def publish_system():
avg1, avg5, avg15 = runt.get("system.load_avg").split(', ')
ram_used = runt.get("system.ram.per")
disk_opt = runt.get("system.disk./opt.per")
disk_config = runt.get("system.disk./etc/config.per")
msg = json.dumps({
"load_avg": {
"1min": avg1,
"5min": avg5,
"15min": avg15
},
"disk_usage": {
"/opt": disk_opt,
"/etc/config:": disk_config,
"ram": ram_used
}
})
client.publish(PREFIX_EVENT + "/system", json.dumps(msg))
runt.start()
serial = runt.get("system.serial")
PREFIX = "router/" + serial
PREFIX_EVENT = "event/" + PREFIX
PREFIX_CMD = "cmd/" + PREFIX
PREFIX_RSP = "rsp/" + PREFIX
client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message
try:
client.connect("192.168.1.100", 1883, 60)
client.loop_start()
except:
print("Failed to connect to MQTT server")
sys.exit(1)
while True:
publish_dhcp_leases()
publish_system()
time.sleep(POLL_TIME)
Use the local REST API to configure the Connect IT 16/48 device
Your Connect IT 16/48 device includes a REST API that can be used to return information about the
device's configuration and to make modifications to the configuration. You can view the REST API
specification from your web browser by opening the URL:
Digi Connect IT® 16/48 User Guide
Use the local REST API to configure the Connect IT 16/48 device
leases.append({"mac": elems[1], "ip": elems[2], "host": elems
482

Advertisement

Table of Contents
loading

This manual is also suitable for:

Connect it 48

Table of Contents