Karol hello,
is azure iot hub flexible enough for a custom ota flow? the answer is a definite yes. iot hub is essentially a giant, secure message router. you can build a completely custom fuota manager application that runs in the cloud, perhaps as an azure function. this application of yours would use the iot hub device twins to set desired properties, like signaling the device that a new firmware is available. then, it would send the actual firmware chunks as cloud to device messages. you have full control over the entire sequence, the timing, the chunking, and the signing. it is a blank canvas for your custom protocol.
now, can you use azure device update with your custom ota? this is a more nuanced one. azure device update is a fantastic service, but it is opinionated. it has its own defined way of handling the update process, from packaging to deployment. trying to force your custom lorawan fuota protocol into the azure device update model would be very difficult, like fitting a square peg into a round hole. it is designed for devices that can use its specific api and update manifest format.
so here is my practical advice for you.
forget about using the azure device update service for this specific task. it will likely cause more pain than it solves. instead, embrace the power of iot hub as your communication backbone.
build your own 'fuota orchestration' service. this is a cloud application that you write. it will be the brain of the operation. this service will.
prepare your firmware, chunking it and signing it according to the lorawan fuota spec.
use the iot hub service sdk to communicate with your device through ttn.
since your device is connected via ttn, you will use the ttn integration to connect it to iot hub. this makes iot hub think your device is directly connected, even though it is through the ttn network.
your orchestration service will send commands via iot hub to tell the device a fuota session is starting. it will then send the firmware chunks one by one, carefully managing the timing and waiting for acknowledgements from the device.
the device side code needs to be smart enough to handle these custom messages, reassemble the chunks, verify the signature, and then apply the update.
this approach is vendor agnostic in its logic. the pattern of a custom cloud orchestrator managing a complex device workflow is used everywhere, on aws, google cloud, you name it. the core idea is the same, you are just using azure iot hub as your messaging pipe.
so, in short. use a custom azure function or app service as your fuota boss. let it talk to your device through the flexible messaging system of iot hub. this gives you the total control you need for the precise lorawan fuota sequence.
good luck with your project, it is a challenging but very rewarding thing to build )
Best regards,
Alex
and "yes" if you would follow me at Q&A - personaly thx.
P.S. If my answer help to you, please Accept my answer
