EasyManuals Logo

Digi Connect IT 16 User Manual

Digi Connect IT 16
756 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #480 background imageLoading...
Page #480 background image
Applications Use the Paho MQTTpython library
Digi Connect IT® 16/48 User Guide
480
cli.execute("reboot", 10)
except:
print("Failed to run 'reboot' command")
return HTTPStatus.INTERNAL_SERVER_ERROR
return HTTPStatus.OK
def cmd_fwupdate(params):
try:
fw_uri = params["uri"]
except:
print("Firmware file URI not passed")
return HTTPStatus.BAD_REQUEST
print("Request to update firmware with URI: {}".format(fw_uri))
try:
fd, fname = tempfile.mkstemp()
os.close(fd)
try:
urllib.request.urlretrieve(fw_uri, fname)
except:
print("Failed to download FW file from URI {}".format(fw_uri))
return HTTPStatus.NOT_FOUND
try:
ret = cli.execute("system firmware update file " + fname, 60)
except:
print("Failed to run firmware update command")
return HTTPStatus.INTERNAL_SERVER_ERROR
if not "Firmware update completed" in ret:
print("Failed to update firmware")
return HTTPStatus.INTERNAL_SERVER_ERROR
finally:
os.remove(fname)
print("Firmware update finished")
return HTTPStatus.OK
CMD_HANDLERS = {
"reboot": cmd_reboot,
"fw-update": cmd_fwupdate
}
def send_cmd_reply(client, cmd_path, cid, cmd, status):
if not status or not cid:
return
if cmd_path.startswith(PREFIX_CMD):
path = cmd_path[len(PREFIX_CMD):]
else:
print("Invalid command path ({}), cannot send reply".format(cmd_path))
return
reply = {
"cmd": cmd,
"status": status

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Digi Connect IT 16 and is the answer not in the manual?

Digi Connect IT 16 Specifications

General IconGeneral
BrandDigi
ModelConnect IT 16
CategoryServer
LanguageEnglish

Related product manuals