0

I am implementing custom device based on ESP32 Wi-Fi Microcontroller. I was able to successfully connect this device to Azure IoT Hub.When I transfer telemetry data in json format and I can view the data using azure cli (az iot hub monitor-events --hub-name {hub}).

But when I published telemetry raw data (ex: uint8_t data[]={0x12,0x3F,0x01,0xF1,0x01,0x02,0xD3,0x00};) I am not able to view through azure cli (az iot hub monitor-events) although mqtt publish is success from ESP32 side. Some time "az iot hub monitor-events" crash.(see the image)

Is there an alternative way to do this? or does Azure IoT hub not support Raw telemetry data? Any help or advice would be highly appreciated! Thank you.

initial part - success in displaying json data, Crash when send raw data

Sabaoon Bedar
  • 3,113
  • 2
  • 31
  • 37
dilan
  • 1
  • 1
  • Try to pass the "[content-type](https://learn.microsoft.com/en-us/cli/azure/iot/hub?view=azure-cli-latest#az_iot_hub_monitor_events)" filter in the az iot hub monitor-events which receive all messages and parse message payload as JSON. " az iot hub monitor-events -n {iothub_name} --content-type application/json" – VenkateshDodda Sep 15 '21 at 12:13
  • Thanks @VenkateshDodda-MT, tried that out did not work. even i analyze the source code of azure-iot-extentsion and do a small hack to print the data in hex string form . but seems when binary data sent it hangs from upper layer. – dilan Sep 16 '21 at 05:25
  • could you help us which language & library you are using to connect esp32 to iot hub – VenkateshDodda Sep 23 '21 at 11:31
  • @VenkateshDodda-MT Embedded C library is used. Actually i was able to route the telemetry stream to S3 stroage and from there I was able to view the the raw data. Seems like "az iot hub monitor event" python app doesn't support binary data .. not the Azure Iot Hub it self. – dilan Sep 24 '21 at 12:13

0 Answers0