Azure / azure-iot-middleware-freertos

Azure IoT Middleware for FreeRTOS
https://azure.github.io/azure-iot-middleware-freertos/
MIT License
79 stars 25 forks source link

AzureIoTHubClient_SendTelemetry() behaviour #296

Closed matt-salvo closed 1 year ago

matt-salvo commented 1 year ago

Hi, anyone can confirm that the payload of AzureIoTHubClient_SendTelemetry() is encoded Base64 during transmission ?

I send a JSON text, but the people working at IoTHub side see the payload encoded with Base64 format. Sending the same JSON text with a simulated device is received without encoding.

rtheil-growlink commented 1 year ago

Not that I've seen. When I send a message it comes out the same without any conversion at the other end.

_messageText is just a char in this example image

danewalton commented 1 year ago

Hi @matt-salvo We don't do anything to the messages to convert it to Base64.

It could possibly be that by default, our telemetry is not sent with any content type message option. In our Embedded SDK, we have this field here exposed to set that property:

https://github.com/Azure/azure-sdk-for-c/blob/3d52e6d63c641586a234209ca20f5dfc95a10191/sdk/inc/azure/iot/az_iot_common.h#L129

I haven't verified that, but the hub could be assuming it's base64 without any designation on it. Feel free to use our message properties APIs here to create a property and add it to your telemetry message: https://github.com/Azure/azure-iot-middleware-freertos/blob/main/source/include/azure_iot_message.h

danewalton commented 1 year ago

Closing this issue for now due to inactivity. If you would like it reopened, please let us know. For any other questions, please open another Github issue.

matt-salvo commented 1 year ago

OK. I verified the payload is delivered to transport layer as is.