Electron Interfacing to Azure IoT Hub

Hello,

I am trying to do something very similar, but I am having trouble getting anything besides a single line of text into IoT Hub. I am using an Electron 2G and Azure tools (IoT Hub, Streaming Analytics, and SQL Server). I followed this tutorial (https://docs.particle.io/tutorials/integrations/azure-iot-hub/) successfully and I was even able to get data flowing into a SQL Server database. Both the cli and the actual device firmware work for me in sending this simple data (see below).

Now I want to send more than just one column of data. Based on reading these posts (Webhook custom templates not working as expected and How to pass unescaped JSON to Azure IoTHub?) it seems the way to do this is to add additional JSON in the field when you set up the webhook integration.

Everything looks correct from the point of sending the formatted JSON and checking the Console, but when I check the input data coming into IoT hub, I get empty strings.

Webhook setup (I have tried this with and without the “json” tag):

Firmware to send JSON strings:

String json = String::format
("{ \"gps_time\": \"%d-%d-%dT%d:%d:%dZ\"\
, \"latitude\": \"%s\"\
, \"longitude\": \"%s\"\
, \"altitude\": \"%d\"\
, \"uncertainty\": \"%d\"\
, \"speed\": \"%d\"\
, \"direction\": \"%d\"\
, \"vertical_accuracy\": \"%d\"\
, \"sensor_used\": \"%d\"\
, \"satellites_used\": \"%d\"\
, \"antenna_status\": \"%d\"\
, \"jamming_status\": \"%d\"}",
    loc.year,
    loc.month,
    loc.day,
    loc.hour,
    loc.minute,
    loc.second,
    loc.lat,
    loc.lng,
    loc.altitude,
    loc.uncertainty,
    loc.speed,
    loc.direction,
    loc.vertical_acc,
    loc.sensor_used,
    loc.sv_used,
    loc.antenna_status,
    loc.jamming_status,
    loc.count
);

Verifying that the message is going out from the Particle platform:

Now I sample some data from the IoT input to check it:

but when I run this input into the query using “Test” I get:

  • duplicated data
  • blank strings
  • no default data (device_id, etc.) even though I did NOT specify “nodefaults = true”

Are there any other ways to troubleshoot the point in the network between the Particle Console and the Azure IoT hub? I noticed one tutorial that mentions using RequestBin, but I’m not sure if this would help me (https://docs.particle.io/guide/tools-and-features/webhooks/#debugging-with-requestbin)