

# Firmware update over-the-air (FUOTA) for AWS IoT Core for LoRaWAN
FUOTA for LoRaWAN

Use Firmware Updates Over-The-Air (FUOTA) to deploy firmware updates to AWS IoT Core for LoRaWAN devices.

Using FUOTA, you can send firmware updates to individual devices or to a group of devices. You can also send firmware updates to multiple devices by creating a multicast group. First add your devices to the multicast group, and then send your firmware update image to all those devices. We recommend that you digitally sign the firmware images so that devices receiving the images can verify that they're coming from the right source.

With AWS IoT Core for LoRaWAN's FUOTA, you can:
+ Deploy new firmware images or delta images to a single device or a group of devices.
+ Verify the authenticity and integrity of new firmware after it's deployed to devices.
+ Monitor the progress of a deployment and debug issues in case of a failed deployment.

AWS IoT Core for LoRaWAN's support for FUOTA and multicast groups is based on the [LoRa Alliance's](https://lora-alliance.org/about-lorawan) following specifications:
+ LoRaWAN Remote Multicast Setup Specification, TS005-1.0.0
+ LoRaWAN Fragmented Data Block Transportation Specification, TS004-1.0.0
+ LoRaWAN Application Layer Clock Synchronization Specification, TS003-1.0.0

**Note**  
AWS IoT Core for LoRaWAN automatically performs the clock synchronization according to the LoRa Alliance specification. It uses the function `AppTimeReq` to reply the server-side time to the devices that request it using ClockSync signaling.

 The following video describes how AWS IoT Core for LoRaWAN FUOTA tasks can be created and walks you through the process of adding devices to the task and schedule a FUOTA task.

[![AWS Videos](http://img.youtube.com/vi/https://www.youtube.com/embed/0Yd6PFwL-IM/0.jpg)](http://www.youtube.com/watch?v=https://www.youtube.com/embed/0Yd6PFwL-IM)


**Topics**
+ [

# FUOTA process overview
](lorawan-fuota-mc-process.md)
+ [

# Create FUOTA task and provide firmware image
](lorawan-fuota-create-task.md)
+ [

# Add devices and multicast groups and schedule FUOTA session
](lorawan-fuota-add-devices.md)
+ [

# Monitor and troubleshoot your FUOTA task and devices
](lorawan-fuota-status.md)

# FUOTA process overview


The following diagram shows how AWS IoT Core for LoRaWAN performs the FUOTA process for your end devices. If you're adding individual devices to your FUOTA session, you can skip the steps for creating and configuring your multicast group. You can add your devices directly to a FUOTA session, and AWS IoT Core for LoRaWAN will then start the firmware update process. 

![\[How AWS IoT Core for LoRaWAN performs FUOTA updates for your end devices.\]](http://docs.aws.amazon.com/iot-wireless/latest/developerguide/images/iot-lorawan-fuota-flow.png)


To perform FUOTA for your devices, first create your digitally signed firmware image and configure the devices and multicast groups that you want to add to your FUOTA task. After you start a FUOTA session, your end devices collect all fragments, reconstruct the image from the fragments, report the status to AWS IoT Core for LoRaWAN, and then apply the new firmware image.

The following illustrates the different steps in the FUOTA process:

1. 

**Create a firmware image or delta image with a digital signature**

   For AWS IoT Core for LoRaWAN to perform FUOTA for your LoRaWAN devices, we recommend that you digitally sign the firmware image or the delta image when sending firmware updates over the air. The devices that receive the images can then verify that it's coming from the right source.

   Your firmware image must not be larger than 1 megabyte in size. The larger your firmware size, the longer it can take for your update process to complete. For faster data transfer or if your new image is larger than 1 Megabyte, use a delta image, which is the part of your new image that's the delta between your new firmware image and the previous image.
**Note**  
AWS IoT Core for LoRaWAN doesn't provide the digital signature generation tool and the firmware version management system. You can use any third-party tool to generate the digital signature for your firmware image. We recommend that you use a digital signature tool such as the one embedded in the [ARM Mbed GitHub repository](https://github.com/armmbed/mbed-os-example-lorawan-fuota), which also includes tools for generating the delta image and for devices to use that image.

1. 

**Identify and configure the devices for FUOTA**

   After you identify the devices for FUOTA, send firmware updates to individual or multiple devices.
   + To send your firmware updates to multiple devices, create a multicast group, and configure the multicast group with end devices. For more information, see [Create multicast groups to send a downlink payload to multiple devices](lorawan-multicast-groups.md).
   + To send firmware updates to individual devices, add those devices to your FUOTA session and then perform the firmware update.

1. 

**Schedule a distribution window and set up fragmentation session**

   If you created a multicast group, you can specify the class B or class C distribution window to determine when the devices can receive the fragments from AWS IoT Core for LoRaWAN. Your devices might be operating in class A before they switch to class B or class C mode. You must also specify the start time of the session.

   Class B or class C devices wake up at the specified distribution window and start receiving the downlink packets. Devices operating in class C mode can consume more power than class B devices. For more information, see [Device classes](lorawan-manage-end-devices.md#lorawan-device-classes).

1. 

**End devices report status to AWS IoT Core for LoRaWAN and update firmware image**

   After you set up a fragmentation session, your end devices and AWS IoT Core for LoRaWAN perform the following steps to update the firmware of your devices.

   1. Because LoRaWAN devices have a low data rate, to start the FUOTA process, AWS IoT Core for LoRaWAN sets up a fragmentation session to fragment the firmware image. Then it sends these fragments to the end devices.

   1. After AWS IoT Core for LoRaWAN sends the image fragments, your LoRaWAN end devices perform the following tasks.

      1. Collect the fragments and then reconstruct the binary image from these fragments.

      1. Check the digital signature of the reconstructed image to authenticate the image and verify that it's coming from the right source.

      1. Compare the firmware version from AWS IoT Core for LoRaWAN to the current version.

      1. Report the status of the fragmented images that were transferred to AWS IoT Core for LoRaWAN, and then apply the new firmware image.
**Note**  
In some cases, the end devices report the status of the fragmented images that were transferred to AWS IoT Core for LoRaWAN before checking the digital signature of the firmware image.

Now that you've learned the FUOTA process, you can create your FUOTA task and add devices to the task for updating their firmware. For more information, see [Create FUOTA task and provide firmware image](lorawan-fuota-create-task.md).

# Create FUOTA task and provide firmware image
Create FUOTA task

To update the firmware of your LoRaWAN devices, first create a FUOTA task and provide the digitally signed firmware image you want to use for the update. You can then add your devices and multicast groups to the task and schedule a FUOTA session. When the session starts, AWS IoT Core for LoRaWAN sets up a fragmentation session and your end devices collect the fragments, reconstruct the image, and apply the new firmware. For information about the FUOTA process, see [FUOTA process overview](lorawan-fuota-mc-process.md).

The following shows how you can create a FUOTA task and upload the firmware image or delta image that you'll store in an S3 bucket.

## Prerequisites


Before you can perform FUOTA, the firmware image must be digitally signed so that your end devices can verify the authenticity of the image when applying the image. You can use any third-party tool to generate the digital signature for your firmware image. We recommend that you use a digital signature tool such as the one embedded in the [ARM Mbed GitHub repository](https://github.com/armmbed/mbed-os-example-lorawan-fuota), which also includes tools for generating the delta image and for devices to use that image.

## Create FUOTA task and upload firmware image by using the console


To create a FUOTA task and upload your firmware image by using the console, go to the [FUOTA tasks](https://console.aws.amazon.com/iot/home#/wireless/fuotaTasks) tab of the console and then choose **Create FUOTA task**.

1. 

**Create FUOTA task**

   To create your FUOTA task, specify the task properties and tags.

   1. 

**Specify FUOTA task properties**  
To specify FUOTA task properties, enter the following information for your FUOTA task.
      + **Name**: Enter a unique name for your FUOTA task. The name must contain only letters, numbers, hyphens, and underscores.
      + **Description**: You can provide an optional description for your multicast group. The description field can be up to 2,048 characters.
      + **RFRegion**: Set the frequency band for your FUOTA task. The frequency band must match the one you used to provision your wireless devices or multicast groups.

   1. 

**Tags for FUOTA task**  
You can optionally provide any key-value pairs as **Tags** for your FUOTA task. To continue creating your task, choose **Next**.

1. 

**Upload firmware image**

   Choose the firmware image file that you want to use to update the firmware of the devices you add to the FUOTA task. The firmware image file is stored in an S3 bucket. You can provide AWS IoT Core for LoRaWAN the permissions to access the firmware image on your behalf. We recommend that you digitally sign the firmware images so that its authenticity is verified when the firmware update is performed.

   1. 

**Choose firmware image file**  
You can either upload a new firmware image file to an S3 bucket or choose an existing image that has already been uploaded to an S3 bucket.
**Note**  
The firmware image file must not be larger than 1 megabyte in size. The larger your firmware size, the longer it can take for your update process to complete.
      + To use an existing image, choose **Select an existing firmware image**, choose **Browse S3**, and then choose the firmware image file you want to use.

        AWS IoT Core for LoRaWAN populates the S3 URL, which is the path to your firmware image file in the S3 bucket. The format of the path is `s3://bucket_name/file_name`. To view the file in the [Amazon Simple Storage Service](https://console.aws.amazon.com/s3/) console, choose **View**.
      + To upload a new firmware image.

        1. Choose **Upload a new firmware image** and upload your firmware image. The image file must not be larger than 1 megabyte. 

        1. To create an S3 bucket and enter a **Bucket name** for storing your firmware image file, choose **Create S3 bucket**.

   1. 

**Advanced transmission parameters - Optional**  
You can optionally specify advanced transmission parameters for your FUOTA transfer, which includes the following information.
      + 

**Fragment size (bytes)**  
The size of each fragment in bytes that is sent to the device, which also determines the number of fragments that will be sent. The data rate for the FUOTA transfer is determined based on the Fragment size by FUOTA.
**Note**  
This parameter is only supported for multicast groups.
      + 

**Fragment interval (ms)**  
The time interval in milliseconds between each fragment that is sent from the cloud to your device, rounded to the nearest second.
**Note**  
This interval only determines the timing for when the Cloud sends the fragments to yor device. There can be a delay for when your device will receive these fragments. This delay depends on the class of device that you use, and the communication delay with the cloud.
If you are performing FUOTA for a multicast group and added participating gateways when creating the group, make sure that the fragment interval is less than or equal to the transmission interval for the gateways. 
      + 

**Redundancy percent (ms)**  
The percentage of the added fragments that are redundant. For example, if the size of the firmware image file is 100 bytes and the fragment size is 10 bytes, with RedundancyPercent set to 50(%), the final number of encoded fragments is (100 / 10) \$1 (100 / 10 \$1 50%) = 15.
      + 

**Descriptor**  
The descriptor is the metadata about the file that is transferred to the device using FUOTA, such as the software version. It is a binary field encoded in base64. The descriptor is a freely-allocated four-byte field that takes a string input. It is sent to the device in FUOTA setup messages.

        For example, if the file transported is a firmware patch image, this field can be used to encode the version of the firmware being transported. This ensures compatibility verification when the firmware image is verified by the end device. If you specify a wrong descriptor field, it can result in the FUOTA session to fail. For information about this error, see [Status of devices in a FUOTA task](lorawan-fuota-status.md#lorawan-fuota-device-status).

   1. 

**Permissions to access the bucket**  
You can either create a new service role or choose an existing role to allow AWS IoT Core for LoRaWAN to access the firmware image file in the S3 bucket on your behalf. Choose **Next**.

      To create a new role, you can enter a role name or leave it blank for a random name to be generated automatically. To view the policy permissions that grant access to the S3 bucket, choose **View policy permissions**.

   For more information about using an S3 bucket to store your image and granting AWS IoT Core for LoRaWAN permissions to access it, see [Upload the firmware file to an Amazon S3 bucket and add an IAM role](lorawan-upload-firmware-s3bucket.md). 

1. 

**Review and create**

   To create your FUOTA task, review the FUOTA task and configuration details that you specified and the choose **Create task**.

## Create FUOTA task and upload firmware image by using the API


To create a FUOTA task and specify your firmware image file by using the API, use the [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_CreateFuotaTask.html](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_CreateFuotaTask.html) API operation or the [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/create-fuota-task.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/create-fuota-task.html) CLI command. You can provide an `input.json` file as input to the `create-fuota-task` command.

When you use the API or CLI:
+ You must have already uploaded the firmware image file to an S3 bucket, which you'll then provide as input to the API.
+ You also specify the IAM role that gives AWS IoT Core for LoRaWAN access to the firmware image in the S3 bucket.
+ (Optional) You can also specify optional, advanced transmission parameters such as the fragment size in bytes, the interval between the fragments in milliseconds, the redundancy percentage, and the descriptor that can be used to provide metadata about the file that is being transferred.

```
aws iotwireless create-fuota-task \
    --cli-input-json file://input.json
```

where:

**Contents of input.json**

```
{   
   "Description": "FUOTA task to update firmware of devices in multicast group.",
   "FirmwareUpdateImage": "S3:/firmware_bucket/firmware_image
   "FirmwareUpdateRole": "arn:aws:iam::123456789012:role/service-role/ACF1zBEI"
   "LoRaWAN": { 
      "RfRegion": "US915"
   },
   "Name": "FUOTA_Task_MC"  
}
```

After you create your FUOTA task, you can use the following API operations or CLI commands to update, delete, or get information about your FUOTA task.
+ [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_UpdateFuotaTask](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_UpdateFuotaTask) or [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/update-fuota-task.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/update-fuota-task.html) 
+ [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_GetFuotaTask](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_GetFuotaTask) or [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/get-fuota-task.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/get-fuota-task.html) 
+ [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_ListFuotaTasks](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_ListFuotaTasks) or [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/list-fuota-tasks.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/list-fuota-tasks.html) 
+ [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_DeleteFuotaTask](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_DeleteFuotaTask) or [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/delete-fuota-task.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/delete-fuota-task.html) 

## Next steps


Now that you've created a FUOTA task and provided the firmware image, you can add devices to the task for updating their firmware. You can either add individual devices or multicast groups to the task. For more information, see [Add devices and multicast groups and schedule FUOTA session](lorawan-fuota-add-devices.md).

# Add devices and multicast groups and schedule FUOTA session
Add devices and schedule FUOTA

After you've created a FUOTA task, you can add devices to your task for which you want to update the firmware. After your devices have been added successfully to the FUOTA task, you can schedule a FUOTA session to update the device firmware. 
+ If you have only a small number of devices, you can add those devices directly to your FUOTA task.
+ If you have a large number of devices that you want to update firmware for, you can add these devices to your multicast groups, and then add the multicast groups to your FUOTA task. For information about creating and using multicast groups, see [Create multicast groups to send a downlink payload to multiple devices](lorawan-multicast-groups.md).

**Note**  
You can add either individual devices or multicast groups to the FUOTA task. You can't add both devices and multicast groups to the task.

After you've added your devices or multicast groups, you can start a firmware update session. AWS IoT Core for LoRaWAN collects the firmware image, fragments the images, and then stores the fragments in an encrypted format. Your end devices collect the fragments and apply the new firmware image. The time that it takes for the firmware update depends on the image size and how the images were fragmented. After the firmware update is complete, the encrypted fragments of the firmware image stored by AWS IoT Core for LoRaWAN is deleted. You can still find the firmware image in the S3 bucket.

**Note**  
If you use the AWS CLI to start a FUOTA session, you can configure the downlink frequency and the `PingSlotPeriod` for Class B devices. First, you must run the [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_StartMulticastGroupSession.html](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_StartMulticastGroupSession.html) API command with the desired values for these parameters. Then, when you run the `StartFuotaTask` API, it will use the appropriate values once the multicast session has started. For more information, see [(Optional) Configure downlink frequency of multicast group before starting FUOTA session](#lorawan-fuota-devices-api-downlinkfreq).

## Prerequisites


Before you can add devices or multicast groups to your FUOTA task, do the following.
+ You must have already created the FUOTA task and provided your firmware image. For more information, see [Create FUOTA task and provide firmware image](lorawan-fuota-create-task.md).
+ Provision the wireless devices that you want to update the device firmware for. For more information about onboarding your device, see [Onboard your devices to AWS IoT Core for LoRaWAN](lorawan-onboard-end-devices.md).
+ To update the firmware of multiple devices, you can add them to a multicast group. For more information, see [Create multicast groups to send a downlink payload to multiple devices](lorawan-multicast-groups.md).
+ When you onboard the devices to AWS IoT Core for LoRaWAN, specify the FUOTA configuration parameter `FPorts`. If you're using a LoRaWAN v1.0.x device, you must also specify the `GenAppKey`. For more information about the FUOTA configuration parameters, see [Prepare devices for multicast and FUOTA configuration](lorawan-prepare-devices-multicast.md).

## Add devices to a FUOTA task and schedule a FUOTA session by using the console


To add devices or multicast groups and schedule a FUOTA session by using the console, go to the [FUOTA tasks](https://console.aws.amazon.com/iot/home#/wireless/fuotaTasks) tab of the console. Then, choose the FUOTA task that you want to add devices to and perform the firmware update.

**Add devices and multicast groups**

1. You can add either individual devices or multicast groups to your FUOTA task. However, you can't add both individual devices and multicast groups to the same FUOTA task. To add devices using the by console, do the following.

   1. In the **FUOTA task details**, choose **Add device**.

   1. Choose the frequency band or **RFRegion** for the devices you add to the task. This value must match the **RFRegion** that you chose for the FUOTA task.

   1. Choose whether you want to add individual devices or multicast groups to the task.
      + To add individual devices, choose **Add individual devices** and enter the device ID of each device that you want to add to your FUOTA task.
      + To add multicast groups, choose **Add multicast groups** and add your multicast groups to the task. You can filter the multicast groups you want to add to the task by using the device profile or tags. When you filter by device profile, you can choose multicast groups that with devices that have a profile with **Supports Class B** or **Supports Class C** enabled.

1. 

**Schedule FUOTA session**

   After your devices or multicast groups have been added successfully, you can schedule a FUOTA session. To schedule a session, do the following.

   1. Choose the FUOTA task for which you want to update the device firmware and then choose **Schedule FUOTA session**.

   1. Specify a **Start date** and **Start time** for your FUOTA session. Make sure that the start time is 30 minutes or later from the current time.

## Add devices to a FUOTA task and schedule a FUOTA session by using the API


You can use the AWS IoT Wireless API or the CLI to add your wireless devices or multicast groups to your FUOTA task. You can then schedule a FUOTA session.

**Topics**
+ [

### (Optional) Configure downlink frequency of multicast group before starting FUOTA session
](#lorawan-fuota-devices-api-downlinkfreq)
+ [

### Add devices and multicast groups to FUOTA task
](#lorawan-fuota-devices-api-adddevices)
+ [

### Schedule FUOTA session
](#lorawan-fuota-devices-api-schedule)

### (Optional) Configure downlink frequency of multicast group before starting FUOTA session
Configure multicast session downlink frequency

By default, when you start a FUOTA session, it will automatically start a multicast session. If you haven't already started a multicast session, the FUOTA session will use the default values for the downlink frequency and the `PingSlotPeriod` parameter for class B devices.

To configure the downlink frequency and `PingSlotPeriod` parameter, you can start a multicast session by specifying the values that you want to use for these parameters. To start a multicast session, you can use the [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_StartMulticastGroupSession.html](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_StartMulticastGroupSession.html) API operation or the [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/start-multicast-group-session.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/start-multicast-group-session.html) CLI command. For information about using this API, see [Schedule a downlink message by using the API](lorawan-multicast-schedule-downlink.md#lorawan-multicast-downlink-api).

After you have started the multicast session, when you start a FUOTA task, the task will automatically derive the downlink frequency and the `PingSlotPeriod` parameter values that you specified when using the API. In addition:
+ The data rate for the FUOTA transfer is determined based on the fragment size by FUOTA.
+ The session timeout for the multicast group is calculated when starting the FUOTA task. If a multicast session has already started, then the session is restarted with a new timeout. The session timeout for the FUOTA task is calculated based on the data rate and the number of fragments to be sent. You can start the multicast group session with any session time out. If this timeout is used for the FUOTA task, the session timeout will be automatically updated.

For information about starting a FUOTA task, see [Schedule FUOTA session](#lorawan-fuota-devices-api-schedule).

### Add devices and multicast groups to FUOTA task
Add devices and multicast groups

You can associate either wireless devices or multicast groups with your FUOTA task.
+ To associate individual devices to your FUOTA task, use the [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_AssociateWirelessDeviceWithFuotaTask.html](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_AssociateWirelessDeviceWithFuotaTask.html) API operation or the [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/associate-wireless-device-with-fuota-task.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/associate-wireless-device-with-fuota-task.html) CLI command, and provide the `WirelessDeviceID` as input.

  ```
  aws iotwireless associate-wireless-device-with-fuota-task \
      --id "01a23cde-5678-4a5b-ab1d-33456808ecb2"
      --wireless-device-id "ab0c23d3-b001-45ef-6a01-2bc3de4f5333"
  ```
+ To associate multicast groups to your FUOTA task, use the [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_AssociateMulticastGroupWithFuotaTask.html](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_AssociateMulticastGroupWithFuotaTask.html) API operation or the [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/associate-multicast-group-with-fuota-task.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/associate-multicast-group-with-fuota-task.html) CLI command, and provide the `MulticastGroupID` as input.

  ```
  aws iotwireless associate-multicast-group-with-FUOTA-task \
      --id "01a23cde-5678-4a5b-ab1d-33456808ecb2"
      --multicast-group-id "ab0c23d3-b001-45ef-6a01-2bc3de4f5333"
  ```

After you've associated your wireless devices or multicast group to your FUOTA task, use the following API operations or CLI commands to list your devices or multicast groups or to disassociate them from your task.
+ [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_DisassociateWirelessDeviceFromFuotaTask.html](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_DisassociateWirelessDeviceFromFuotaTask.html) or [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/disassociate-wireless-device-from-fuota-task.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/disassociate-wireless-device-from-fuota-task.html) 
+ [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_DisassociateMulticastGroupFromFuotaTask.html](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_DisassociateMulticastGroupFromFuotaTask.html) or [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/disassociate-multicast-group-from-fuota-task.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/disassociate-multicast-group-from-fuota-task.html) 
+ [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_ListWirelessDevices.html](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_ListWirelessDevices.html) or [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/delete-multicast-group.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/delete-multicast-group.html) 
+ [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_ListMulticastGroups.html](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_ListMulticastGroups.html) or [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/list-multicast-groups.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/list-multicast-groups.html) 
**Note**  
The API:  
`ListWirelessDevices` can list wireless devices in general, and devices associated with a multicast group, when `MulticastGroupID` is used as the filter. The API lists wireless devices associated with a FUOTA task when `FuotaTaskID` is used as the filter.
`ListMulticastGroups` can list multicast groups in general and multicast groups associated with a FUOTA task when `FuotaTaskID` is used as the filter.

### Schedule FUOTA session


After your devices or multicast groups have been successfully added to the FUOTA task, you can start a FUOTA session to update the device firmware. The start time must be 30 minutes or later from the current time. To schedule a FUOTA session by using the API or CLI, use the [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_StartFuotaTask.html](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_StartFuotaTask.html) API operation or the [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/start-fuota-task.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/start-fuota-task.html) CLI command.

```
aws iotwireless start-fuota-task --id "01a23cde-5678-4a5b-ab1d-33456808ecb2"
```

After you've started a FUOTA session, You can no longer add devices or multicast groups to the task. You can get information about the status of your FUOTA session by using the [https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_GettFuotaTask.html](https://docs.aws.amazon.com/iot-wireless/latest/apireference/API_GettFuotaTask.html) API operation or the [https://docs.aws.amazon.com/cli/latest/reference/iotwireless/get-fuota-task.html](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/get-fuota-task.html) CLI command.

# Monitor and troubleshoot your FUOTA task and devices
Monitor and troubleshoot FUOTA task

After you have provisioned the wireless devices and created any multicast groups that you might want to use, you can start a FUOTA session by performing the following steps.

## FUOTA task status


Your FUOTA task can have one of the following status messages displayed in the AWS Management Console. 
+ 

**Pending**  
This status indicates that you've created a FUOTA task, but it doesn't yet have a firmware update session. You'll see this status message displayed when your task has been created. During this time, you can update your FUOTA task, and associate or disassociate devices or multicast groups with your task. After the status changes from **Pending**, additional devices can't be added to the task.
+ 

**FUOTA session waiting**  
After your devices have been added successfully to the FUOTA task, when your task has a scheduled firmware update session, you'll see this status message displayed. During this time, you can't update or add devices to your FUOTA session. If you cancel your FUOTA session, the group status changes to **Pending**. 
+ 

**In FUOTA session**  
When your FUOTA session begins, you'll see this status message displayed. The fragmentation session starts and your end devices collect the fragments, reconstruct the firmware image, compare the new firmware version with the original version, and apply the new image.
+ 

**FUOTA done**  
After your end devices report to AWS IoT Core for LoRaWAN that the new firmware image has been applied, or when the session times out, the FUOTA session is marked as done, and you'll see this status displayed.

  You'll also see this status displayed in any of the following cases so be sure to check whether the firmware update was applied correctly to the devices.
  + When the FUOTA task status was **FUOTA session waiting**, and there's an S3 bucket error, such as the link to the image file in the S3 bucket is incorrect or AWS IoT Core for LoRaWAN doesn't have sufficient permissions to access the file in the bucket.
  + When the FUOTA task status was **FUOTA session waiting**, and there's a request to start a FUOTA session, but a response isn't received from the devices or multicast groups in your FUOTA task.
  + When the FUOTA task status was **In FUOTA session**, and the devices or multicast groups haven't sent any fragments for a certain time period, which results in the session to timeout.
+ 

**Delete waiting**  
If you delete your FUOTA task that's in any of the other states, you'll see this status displayed. A deletion action is permanent and can't be undone. This action can take time and the task status will be **Delete waiting** until the FUOTA task has been deleted. After your FUOTA task enters this state, it can't transition to one of the other states.

## Status of devices in a FUOTA task


The devices in your FUOTA task can have one of the following status messages displayed in the AWS Management Console. You can hover over each status message to get more information about what it indicates.
+ 

**Initial**  
When it's the start time of your FUOTA session, AWS IoT Core for LoRaWAN checks whether your device has the supported package for the firmware update. If your device has the supported package, the FUOTA session for the device starts. The firmware image is fragmented and the fragments are sent to your device. When you see this status displayed, it indicates that the FUOTA session for the device hasn't started yet.
+ 

**Package unsupported**  
If the device doesn't have the supported FUOTA package, you'll see this status displayed. If the firmware update package isn't supported, the FUOTA session for your device can't start. To resolve this error, check whether your device's firmware can receive firmware updates using FUOTA.
+ 

**Fragmentation algorithm unsupported**  
At the start of your FUOTA session, AWS IoT Core for LoRaWAN sets up a fragmentation session for your device. If you see this status displayed, it means that the type of fragmentation algorithm used can't be applied for your device's firmware update. The error occurs because your device doesn't have the supported FUOTA package. To resolve this error, check whether your device's firmware can receive firmware updates using FUOTA.
+ 

**Not enough memory**  
After AWS IoT Core for LoRaWAN sends the image fragments, your end devices collect the image fragments and reconstruct the binary image from these fragments. This status is displayed when your device doesn't have enough memory to assemble the incoming fragments of the firmware image, which can result in your firmware update session ending prematurely. To resolve the error, check whether your device's hardware can receive this update. If your device can't receive this update, use a delta image to update the firmware.
+ 

**Fragmentation index unsupported**  
The fragmentation index identifies one of the four simultaneously possible fragmentation sessions. If your device doesn't support the indicated fragmentation index value, this status is displayed . To resolve this error, do one or more of the following. 
  + Start a new FUOTA task for the device. 
  + If the error persists, switch from unicast to multicast mode.
  + If the error still isn't resolved, check your device firmware.
+ 

**Memory error**  
This status indicates that your device has experienced a memory error when receiving the incoming fragments from AWS IoT Core for LoRaWAN. If this error occurs, your device might not be capable of receiving this update. To resolve the error, check whether your device's hardware can receive this update. If needed, use a delta image to update the device firmware.
+ 

**Wrong descriptor**  
Your device doesn't support the indicated descriptor. The descriptor is a field that describes the file that will be transported during the fragmentation session. If you see this error, contact [AWS Support Center](https://console.aws.amazon.com/support/home#/).
+ 

**Session count replay**  
This status indicates that your device has previously used this session count. To resolve the error, start a new FUOTA task for the device.
+ 

**Missing fragments**  
As your device collects the image fragments from AWS IoT Core for LoRaWAN, it reconstructs the new firmware image from the independent, coded fragments. If your device hasn't received all the fragments, the new image can't be reconstructed, and you'll see this status. To resolve the error, start a new FUOTA task for the device.
+ 

**MIC error**  
When your device reconstructs the new firmware image from the collected fragments, it performs a MIC (Message Integrity Check) to verify the authenticity of your image and whether it's coming from the right source. If your device detects a mismatch in the MIC after reassembling the fragments, this status is displayed. To resolve the error, start a new FUOTA task for the device.
+ 

**Device exists in conflict FUOTA task**  
If a device has already used in another conflict FUOTA task, then it will generate an error when retrying the new FUOTA task. For example, if a device is part of a multicast group, and it has already been used with another FUOTA task as part of a multicast group, the device will exist in this conflict status as it retries to run the new FUOTA task.
+ 

**Successful**  
The FUOTA session for your device was successful.
**Note**  
While this status message indicates that the devices have reconstructed the image from the fragments and verified it, the device firmware might not have been updated when the device reports the status to AWS IoT Core for LoRaWAN. Check whether your device firmware has been updated.

## Next steps


You've learned about the different statuses of the FUOTA task and its devices and how you can troubleshoot any issues. For more information about each of these statuses, see the [LoRaWAN Fragmented Data Block Transportation Specification, TS004-1.0.0](https://lora-alliance.org/wp-content/uploads/2020/11/fragmented_data_block_transport_v1.0.0.pdf).