Replies: 3 comments 2 replies
-
|
I tried by creating a callback function:
It simply logs the Packet ID received. I added the callback to the xHubOptions:
I added send_telemetry as follows:
I defined telemetryPacketID (globally) as:
Irrespective of the value I set it to before calling AzureIoTHubClient_SendTelemetry, it sends back: I need to get a telemetry message IDENTIFIER somehow I'm obviously misunderstanding something critical here. Must I add this to the PropertiesBag of the Telemetry, and If so what must the precise format be? Some progress made, but still not there.... |
Beta Was this translation helpful? Give feedback.
-
|
I was hoping I could send the This however only resulted in me adding a property called messag-Id to the Properties of the message. So it is obvious that I also don't know how to assign a SystemProperty properly. This is what my telemetry data looks like in CosmosDB Data Explorer.: from the docs: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-messages-construct#system-properties-of-d2c-iot-hub-messages I should be able to set the message-Id: So if someone can please help my understanding, of how to get a callback to return the ID of the uploaded telemetry message, in such a manner that it can be tracked to a specific message. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @wreyford! A few things that might help:
Our tests are actually a decent resource of how you would check against this value:
In your case, it might make more sense to save the sent publish ID and check/clear it in the puback callback instead of creating a separate method to wait for the puback. Something like this: |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having difficulty figuring out how to implement the callback functionality of the AzureIoTHubClient, so that I can mark a record as sent to Azure form the ESP32S3 once successfully delivered. In the example code, (I assume for simplicity) this has not been implemented.
Due to timing constraints, with the ESP32S3, I'm generating more Records, than actually eventually end up being sent.
I thus need a way to sync these unsent messages when the device is not busy collecting data.
The AzureIoTHubClient_t xAzureIoTHubClient has a AzureIoTTelemetryAckCallback_t xTelemetryCallback;
I need some pointers on how to write this, and how to enable it.
I send my telemetry record with QOS1:
I see that it can return a pointer to the uint16_t * pusTelemetryPacketID
According to the definition of AzureIoTHubClient_SendTelemetry
I thin I may need to set the callbackroutine here:
Any pointers on HOW - TO get started with implementing a callback, that can run client side code to mark a telemetry record as delivered will be appreciated.
Thx
Beta Was this translation helpful? Give feedback.
All reactions