Hi, I am trying to run aws ota example on MM6108-EKH05 in platformIO. When I create an ota job on aws the evk prints on terminal “An OTA update has been triggered, downloading the file in the background…” after which it starts printing “WRN:Incoming publish does not match any callback functions.” for around 15minutes. I tried multiple times, in some cases it also print “C:\Users\SachinVerma.platformio\platforms\mm_iottoolkit\framework\src\littlefs\lfs.c:629:error: No more free space 204” and in some cases it restarts and prints “OTA Update completed successfully”. I have following querries.
What is this warning :Incoming publish does not match any callback functions.
Why this warning keeps printing for 15-20 minutes. Is the firmware getting downloaded in background?
Why it says no more space (in some cases), I am trying the example with no changes other than certificates.
In some cases the evk resets after 10-15 minutes and prints OTA update completed successfully. Why it takes 10-15 minutes.
Sorry for the delay! We are trying to reproduce this.
What is this warning :Incoming publish does not match any callback functions.
This means the incoming publish message does not have a handler function. Without knowing what the exact publish message is, we can’t really tell you exactly why it is occurring. Can you add some debug (breakpoint or prints) to prvIncomingPublishCallback and share the pxPublishInfo->pTopicName causing the failure.
Why this warning keeps printing for 15-20 minutes. Is the firmware getting downloaded in background?
This is unexpected, the expected firmware update image size should only take a couple of minutes - though this will depend on link quality and maximum throughput. If you run the iperf sample on the EKH05, what sort of throughput are you seeing from the AP to the EKH05?
Why it says no more space (in some cases), I am trying the example with no changes other than certificates.
How big is the update image you are trying to push to the device? The bootloader only reserves 896 KB for the filesystem partition. Exceeding this will trigger that message.
prints OTA update completed successfully. Why it takes 10-15 minutes.
The “update completed successfully” is a good indication that the firmware is downloading in the background. The long download time could indicate poor link quality, please run an iperf sample and measure your link speed.
Lastly, if you haven’t already, you might find it valuable to examine file:///C:/Users/SachinVerma.platformio/.platformio/platforms/mm_iottoolkit/framework/doc/html/aws__iot_8c.html for documentation on how the “thing” is configured in AWS.
Hi, thanks for the input. I am running the aws-iot example as it is, setting up the certificates only, the binary size of which is around 930KB. So it is clear why it says no more free space. I have also tried with smaller binary (around 26kb) for which it triggers OTA and halts there, it neither resets nor it print anything. When I reset the board manually it prints “OTA update completed successfully” and boots up with previous binary.
Hi, I wanted to add more inputs. I tried with a smaller binary of around 26Kb, converted it to mbin format using the python script provided here-mm-iot-sdk-main\framework\tools\buildsystem\convert-bin-to-mbin. I have also put a print statement to print the topic name (pxPublishInfo->pTopicName) along with the warning.
Observation: It prints the warning three times and halts there nothing happens after that. When reset button is pressed it boots with previous binary and prints OTA update completed successfully. Attaching the logs.
Regarding your issues:
The warning "WRN:Incoming publish does not match any callback functions` is printed for every x number of packets received, so it will continue to be printed for the entire update process.
With the out of the box settings in ota_config.h the update process usually takes ~15 minutes to complete. You can speed this up by editing some config parameters.
In ota_config.h set the following:
#define otaconfigLOG2_FILE_BLOCK_SIZE 11UL
#define otaconfigMAX_NUM_BLOCKS_REQUEST 16U
#define otaconfigOTA_UPDATE_STATUS_FREQUENCY 200U
In ota_config_defaults set the following:
#define otaconfigMAX_NUM_OTA_DATA_BUFFERS 16U
This should lower the update time to ~2minutes.
The issue with the device rebooting using the previous binary rather than the newly downloaded is likely due to the bootloader not being uploaded. Without the bootloader the device can not verify the new binary correctly and so it defaults to loading the old binary.
I’m unsure what you’re following for documentation, but consider opening the documentation.html from the the ~/mm_iottoolkit .
From the documentation for aws_iot.c
Note
OTA update feature is supported only on mm-ekh08-u575 and mm-mm6108-ekh05 platforms - you will get an error on all other platforms if you attempt an OTA update. To add OTA support to your platform, you will need to:
Build and install the bootloader for your platform. (See bootloader.c) If you are loading the application using openocd, then first load the application and then load the bootloader. Do this every time you load the application using openocd as the application contains a stub bootloader that will overwrite the real bootloader.
In PlatformIO you can use the bootloader example to upload the bootloader. Follow the docs for bootloader.c if you get stuck!