FUOTA implementation for Heltec ESP32 using AWS IoT Core

0

Hi everyone,

I'm currently working on implementing Firmware Over The Air (FUOTA) updates for a Heltec ESP32-S3 v3 device using AWS IoT Core for LoRaWAN FUOTA. I’m encountering some challenges and would appreciate any guidance or insights the community can offer.

Here's a detailed breakdown of the issues I'm encountering along with the information I have:

1.LoRaWAN Application Layer Clock Synchronization: My initial focus has been on achieving LoRaWAN Application Layer Clock Synchronization using functions provided by Heltec's documentation. After successfully joining the network, I've observed the following results in my console:

joined
Unix time: 9.641
This uplink added time req.
confirmed uplink sending ...
Once device time updated, this function run
received unconfirmed downlink: rssi = -69, snr = 9, datarate = 5
Unix time: 1716901023.529
confirmed uplink sending ...
received unconfirmed downlink: rssi = -68, snr = 9, datarate = 5
Unix time: 1716901039.325

While this indicates partial success in clock synchronization, I'm uncertain about its completeness. Any insights or recommendations on improving this process would be highly appreciated.

2. Multicast Group Setup: Moving forward, configuring multicast groups on my device has proven to be challenging. Although Heltec's documentation indicates the use of multicast group addresses, I couldn't find this crucial information within the downlink message or the console provided by AWS IoT Core.

The provided code by Heltec (https://github.com/HelTecAutomation/Heltec_ESP32/blob/master/examples/LoRaWAN/LoRaWanMulticast/LoRaWanMulticast.ino) In the network analyser, I noted three downlink messages for the multicast group join, which I selected as an example:

{
     ....
    "WirelessMetadata": {
        "isPublicNetwork": false,
        "fPort": 200,
        "lorawanGateways": [
            {
                "gatewayEui": "XXXXX",
                "rssi": -99,
                "snr": 4.25,
                "wirelessGatewayId": ""
            }
        ],
        "dataRate": 0,
        "applicationInfo": {
            "multicastGroupId": "933aa82a-a2d5-7777-8d8d-398334d7409f",
            "applicationCommandType": "PackageVersionReq (Multicast)"
        },
        "devEui": "XXXXXXXXX5b",
        "mType": "UNCONFIRMED_DATA_DOWN",
        "frequency": 923300000,
        "timestamp": "2024-06-04T11:28:54.646101554Z"
    },
    "MessageId": "feede57e-4ddd-49b4-b527-08274e1e2ee4"
}

How can I set up multicast groups for ESP32 devices ?

3. Firmware Fragmentation Setup: In addition to multicast group configuration, I need to implement firmware fragmentation to ensure secure firmware transportation. Unfortunately, the library I'm using for LoRaWAN communication lacks support for ESP32 series devices, leaving me uncertain about proceeding with fragmentation. Has anyone encountered similar challenges or found alternative solutions for implementing FUOTA on ESP32 devices?

Thanks.

zackiex
asked 3 months ago305 views
1 Answer
0

Hi. AWS IoT Core for LoRaWAN implements clock synchronization, multicast and FUOTA as per the LoRaWAN specifications. As detailed here: https://docs.aws.amazon.com/iot-wireless/latest/developerguide/lorawan-mc-fuota-overview.html. Your device needs to comply with those specifications.

I'm not familiar with Heltec or the software environment at your disposal. In general, I would recommend you print all LoRaWAN commands and responses (and MAC commands and responses) to your terminal, so you can see the message flow, and see when and where your device is not complying.

LoRaMAC-node is a reference implementation that includes all of the features you're interested in. There's no existing port for ESP32, but there is a porting guide: https://stackforce.github.io/LoRaMac-doc/LoRaMac-doc-v4.7.0/_p_o_r_t_i_n_g__g_u_i_d_e.html

profile pictureAWS
EXPERT
Greg_B
answered 3 months ago
  • Thank you so much for your answer. I'm setting up a multicast group for LoRaWAN end-devices using AWS. The end-devices need McAddr, McNwkSKey, and McAppSKey to join the group, which should be sent via the McGroupSetupReq command. I've created a multicast group in AWS, but I'm unable to retrieve the multicast address (McAddr). Here are the details: Command: aws iotwireless get-multicast-group --id f8888832-d2d5-4a01-827d-88877488409f { "Arn": "XXXXXXXXXXXXXXXXXX", "Id": "f8888832-d2d5-4a01-827d-88877488409f", "Name": "esp32-groupe-for-multicast", "Status": "Pending", "LoRaWAN": { "RfRegion": "EU868", "DlClass": "ClassC", "NumberOfDevicesRequested": 42, "NumberOfDevicesInGroup": 3 }, "CreatedAt": "2024-05-27T09:29:24.810000+00:00" }

    1. Are there specific steps to retrieve the multicast information (McAddr) from AWS IoT ?
    2. How can I transition the multicast group from "Pending" to "Active"? Thanks in advance
  • As you said "should be sent via the McGroupSetupReq command". Your device should get McAddr and McKey from this command. And derive McNwkSKey and McAppSKey. There's no special AWS stuff. It's standard LoRaWAN: https://resources.lora-alliance.org/technical-specifications/ts005-2-0-0-remote-multicast-setup. LoRaMAC-node reference implementation: https://github.com/Lora-net/LoRaMac-node/blob/master/src/apps/LoRaMac/common/LmHandler/packages/LmhpRemoteMcastSetup.c#L318-L335.

  • How can I transition the multicast group from "Pending" to "Active"?

    There's no such status as "Active". Statuses: https://docs.aws.amazon.com/iot-wireless/latest/developerguide/lorawan-multicast-status.html. For the most part, the transitions depend on your device processing the commands from AWS IoT Core for LoRaWAN and responding correctly. As detailed here: https://youtu.be/LcCR-1eKX1w?t=184

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions