Digi XBee 3 Cellular LTE-M User Manual page 86

Smart modem
Table of Contents

Advertisement

Update the firmware
Example: Update the XBee .gbl firmware synchronously with Python 3.0
n
Example: Use the device's .gbl firmware image to update the XBee firmware
n
synchronously
Example: Update the XBee .gbl firmware synchronously with Python 3.0
import base64
import requests
# Location of firmware image
firmware_path = 'XBXC.gbl'
# Remote Manager device ID of the device being updated
device_id = '00010000-00000000-03526130-70153378'
# Remote Manager username and password
username = "my_Remote_manager_username"
password = "my_remote_manager_password"
url = 'https://remotemanager.digi.com/ws/sci'
# Get firmware image
fw_file = open(firmware_path, 'rb')
fw_data = fw_file.read()
fw_data = base64.encodebytes(fw_data).decode('utf-8')
# Form update_firmware request
data = """
<sci_request version="1.0">
<update_firmware filename="firmware.gbl">
<targets>
<device id="{}"/>
</targets>
<data>{}</data>
</update_firmware>
</sci_request>
""".format(device_id, fw_data)
# Post request
r = requests.post(url, auth=(username, password), data=data)
if (r.status_code != 200) or ("error" in r.content.decode('utf-8')):
print("firmware update failed")
else:
print("firmware update success")
Example: Use the device's .gbl firmware image to update the XBee firmware
synchronously
To update the XBee firmware synchronously with Python 3.0, but using the device firmware image
already uploaded to Remote Manager, upload the device's *.gbl firmware to Remote Manager:
1. Download the updated firmware file for your device from
contains the firmware image.
2. Unzip the file and locate the .gbl file inside the unzipped directory.
3. Log in to Remote Manager.
4. Click the Data Services tab.
Digi XBee® 3 Cellular LTE-M/NB-IoT Global Smart Modem User Guide
Update the device firmware
Digi's support
site. This zip file
86

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xbee 3 cellular nb-iot

Table of Contents