I used the example repo of Azure für sending telemetry data: https://github.com/Azure/azure-iot-arduino/tree/master/examples/esp8266/iothub_ll_telemetry_sample
I did not modify any code. This is the important part:
const char* telemetry_msg = "test_message";
message_handle = IoTHubMessage_CreateFromString(telemetry_msg);
result = IoTHubDeviceClient_LL_SendEventAsync(device_ll_handle, message_handle, send_confirm_callback, NULL);
Why does my body-result looks like an ASCII array? (Note: Using Azure IoT explorer)
Is it meant to be an array like this. Do I have to unpack this array on the other side?
I want to be able to send the data in JSON format like the azure device simulator does:
Nevermind, figured it out. The following example will send data in JSON format:
char telemetry_msg_buffer[80];
sprintf(telemetry_msg_buffer, "{\"temperature\":11.11,\"humidity\":12.12,\"scale\":\"13.13\"}");
message_handle = IoTHubMessage_CreateFromString(telemetry_msg_buffer);