Unable to find events published in Azure

Hello,

I'm using the code below to publish an event. I've done the integration (it was my first) and my message counter is increasing on my IoT hub. First question, where can I see the messages in Azure? Second question I use the Azure CLI monitor K:>az iot hub monitor-events -n [Hub name] i'm not getting any event logging.

#include "Particle.h"


SYSTEM_MODE(AUTOMATIC);

SYSTEM_THREAD(ENABLED);

SerialLogHandler logHandler(LOG_LEVEL_INFO);

#define RT0 10000
#define B 3947.57
#define R 9880
float RT;
float VR;
float ln;
float Tx;
float Tc;
float T0;
double Tf;
float VRT;
float Vin = A0;
unsigned long publishDelay = 60000;
unsigned long previousTimePub = 0;

void checkTemp(){ 
   //Read the voltage across the thermistor
 VRT = (3.3/4095) * analogRead(Vin);

//Calculate the voltage across the thermistor
 VR = 3.3 - VRT;
//Calculate resistance of the thermistor
 RT = VRT / (VR/R);
//Calculate temperature from thermistor resistance
 ln = log(RT/RT0);
 T0 = 25 + 273.15;
 Tx = (1 / ((ln / B) + (1 / T0)));
//Convert to Celsius
 Tc = Tx - 273.15;
//Convert and display in Fahrenheit
 Tf = round(((Tc * 1.8) + 32)*10)/10;
   }

void setup() {
 Serial.begin(9600);
 pinMode(Vin, INPUT);
 Particle.variable("Temperaturef", Tf);

}
void loop() {
 unsigned long timeNow = millis();
 checkTemp();
   Serial.print (Tf);
   Serial.println ("F");
 
if (timeNow - previousTimePub > publishDelay){
    checkTemp();
    Particle.publish("Temperaturef", String(Tf, 1));
    Log.info("previousTimePub...");
    previousTimePub += publishDelay;
}
 delay (500);
}```

I was able to view the data in the azure CLI using the "az iot hub monitor-events --device-id [devide id] --login [primary connection string]

but I had to use the primary connection string from the "shared access policies" and not the primary connection string from the "devices"

So I know my data is getting to azure. However, I'm still not sure how where to find that data Azure (via web browser) in order to use the data for anything.

Hey,
this may be of help:

or perhaps run a search with "azure how to pipe data into sql from iot hub".

Thanks I'll take a look.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.