Update an XBee module cellular component using FOTA
You can update an XBee 3 Cellular LTE-M/NB-IoT module from A2.00 or A2.01 to L0.00.00.05.08,A.02.04 (maintenance release) using FOTA and the script described in this section.
Prerequisites
- You will need a list of the IMEI values for all XBee 3 Cellular LTE-M/NB-IoT modules to be updated.
- Each module must be running firmware 11413 or later. For update instructions, see Update to the latest firmware from XCTU.
- Each module must have an active, registered SIM card installed.
- Each module must be configured to be connected to Remote Manager and to reconnect when connection is lost. For instructions, see Set up a persistent connection to a remote XBee.
- Each module must have visibility to an FTP server hosting the files.
- The machine that will be performing the update must have Python 3.6 or higher installed and the script must be run using Python 3.
Note If installing on Windows, ensure that the checkbox for "Add Python to PATH" is checked. If Python is not added to the PATH, you will need to manually specify the directory in which Python is installed in order to proceed.
- The script dependencies must be satisfied by running pip install --user -r requirements.txt in the directory containing the script. Creating and using a Python virtual environment with the virtualenv command is recommended as a best practice. If using virtualenv, install the script dependencies using pip install -r requirements.txt once the environment is activated. Refer to the instructions in the rest of this section for when to run this command.
Script usage
The arguments and default values for the script are shown below. By default, Digi hosts the update files on a public FTP server and the script attempts to apply the appropriate update files based on intelligence built into the script. The optional arguments should only rarely need to be changed and generally only if the Digi FTP server is not accessible on a private APN, or by direction of Digi Technical Support.
usage: fota.py [-h] [--type {auto,es2,ip}] [--ftp_server FTP_SERVER]
[--ftp_port FTP_PORT] [--ftp_user FTP_USER]
[--ftp_password FTP_PASSWORD] [--ftp_basedir FTP_BASEDIR] <IMEI> [<IMEI> ...]
Perform Over The Air Firmware update (FOTA) on XBee Cellular LTE-M/NB-IoT
positional arguments:
<IMEI> IMEI of device on which to perform update.
optional arguments:
-h, --help show this help message and exit
--type {auto,es2,ip} Type of modules (default: auto)
--ftp_server FTP_SERVER
FTP server (default: ftp1.digi.com)
--ftp_port FTP_PORT FTP port (default: 21)
--ftp_user FTP_USER FTP username (default: anonymous)
--ftp_password FTP_PASSWORD
FTP password (default: fota@digi.com)
--ftp_basedir FTP_BASEDIR
FTP base directory (default: /support/ublox) Script version: 2.0
Run the update script
The IMEI values for the modules you want to update are entered as arguments when you run the script. See Script usage for information about the arguments.
- Download the script.
- Go to the Digi XBee 3 Cellular LTE-M support page.
- Scroll down to the Firmware Updates section.
- Locate and click u-blox Module Over the Air Update Script to download the zip file: over-the-air.zip.
- Unzip the downloaded file.
- Go to a command line and navigate to the directory containing the script.
- Run pip install --user -r requirements.txt in the directory containing the script.
Note If using virtualenv, run pip install -r requirements.txt instead.
- Run the script. Type: python fota.py <arguments>
where <arguments> includes the IMEIs and any optional parameters needed for the environment. For more information, see Script usage.
- Press Enter. You will be prompted for your Remote Manager user name and password.
- After you have entered the user name and password, the script connects to Remote Manager. For each device listed as an argument in the command line, the script performs the following items:
- Verifies connectivity to Remote Manager and the module configuration.
- Applies a sequence of updates to the module that are needed to perform the update.
- Verifies the final cellular component version.
- When complete, a CSV is generated and named using this format: results-<timestamp>.csv, where <timestamp> is the time of the run. The file lists each IMEI, whether the update for that IMEI was successful, and any error message if the update failed.
- A successful update appears as:
SUCCESS updating 352753090812345090861053
- If the update was not successful, try the update again with this flag: --type=ip
- If the update was still not successful, submit a support case.