OTA using Azure IotHub for stm32 and gsm module interfaced board

70 Views Asked by At

I'm currently having a custom stm32 board UART interfaced with SIMCOM gsm module, using AT commands sending temperature value and voltage value to the IotHub and able view the data. Now I want to do a firmware update using the azure. I have a .bin file stored in azure Blob storage. To do this I have came across many references but not satisfied with any. Is there only device twin or direct method to do this. If yes, any simple explanation on how to do it in azure side and my stm32 board side or is there any other option to achieve this.

In azure IOTHUB -> devices -> Device twin -. Json file I changed this in desired property { "otaupdate": "pending", "url": "my_blob_url", "version": "new" }

Then dont know much step to do and how to let know my stm32 board about OTA.

1

There are 1 best solutions below

2
Sampath On

Another method is to configure message routing for Azure IoT Hub. The steps to configure message routing for Azure IoT Hub are as follows:

  • Create an IoT Hub and device
  • Create a Storage Account
  • Search for "Storage accounts" in the Azure portal.
  • Create a new storage account with a globally unique name.
  • In your IoT hub, go to "Message routing" and select "Add."
  • Create a Storage endpoint and provide the necessary information.
  • Create a route pointing to the Storage endpoint with a routing query.

Route details:

enter image description here

Custom endpoint: enter image description here

  • The code for sending device telemetry to Azure IoT Hub is taken from DOC.

enter image description here

enter image description here.

  • You can also use "Send IoT Hub data to storage" with a Stream Analytics Job and integrate IT and OT data using Azure Digital Twins, Azure Data Explorer, and Azure Synapse.