cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Discovery Kit IoT Node seems to transmit OK, but no data is received in Azure IoT Central

DSabo
Associate III

I am using the Discovery IoT Node kit with (mostly) base software. It looks like it makes a connection OK, and the SendEventAsync accepts the messages it wants to send, but I don't see any data in azure iot central.

I checked using a virtual device on my PC and it connects and sends data OK.

A couple things I've checked:

  • The connection string is correct
  • The field name being serialized and sent matches what azure is looking for

Some other things that I don't know are related.

The code had been getting stuck on the while loop below... I wasn't sure if I'm supposed to set azure up to send something to the device when it is connected and that is why it is hanging... but maybe this is related?

    while(ReceivedDeviceTwinProperty==0){
      IoTHubClient_LL_DoWork(iotHubClientHandle);
      HAL_Delay(100);
    }

Also, the device sends 214 messages and then hangs... it's done this a few times...I haven't worked on tracking it down yet... I'm assuming it should be able to run and transmit data "forever".

Below is output from my device

Trying to Connect WIFI to AP
WiFi not able Connected to AP Attempt = 1
WiFi Connected to AP HNY-MIS-G
Real Time Clock Intialized: 09-12-2019 20:58:15
Platform Init Done
Serializer Initialized
iotHubClientHandle Created
iotHubClientSetOption logtrace Ok
iotHubClientSetOption keepalive Ok
Model Instance Created
IoTHubClient_LL_SetMessageCallback...successful.
IoTHubClient_LL_SetDeviceMethodCallback...successful.
IoTHubClient_LL_SetOption(certificates)...successful.
IoTHubClient_LL_SetDeviceTwinCallback...successful.
Channel 1 for Timer 1 started
Ok reported State [1]: Running
MessageToSend={"deviceId":"c47f5103ee16", "messageId":1, "temperature":28.295757, "humidity":50.505493, "ts":"2019-09-12T20:58:17Z"}
IoTHubClient_LL_SendEventAsync accepted message [1] for transmission to IoT Hub.
MessageToSend={"deviceId":"c47f5103ee16", "messageId":2, "temperature":28.255968, "humidity":50.450035, "ts":"2019-09-12T20:58:19Z"}
IoTHubClient_LL_SendEventAsync accepted message [2] for transmission to IoT Hub.
MessageToSend={"deviceId":"c47f5103ee16", "messageId":3, "temperature":28.315651, "humidity":50.577267, "ts":"2019-09-12T20:58:21Z"}
IoTHubClient_LL_SendEventAsync accepted message [3] for transmission to IoT Hub.
MessageToSend={"deviceId":"c47f5103ee16", "messageId":4, "temperature":28.295757, "humidity":50.616417, "ts":"2019-09-12T20:58:23Z"}

1 REPLY 1
DSabo
Associate III

Maybe it isn't properly connected...using iotc-explorer to look at the device twin for my device id it says it's disconnected...

Using the sample contoso app in Azure IoT Central works ok... but it hangs when connecting to my app... looks like it's related to

    /* Wait the Answer from IOT */
    while(ReceivedDeviceTwinProperty==0){
      IoTHubClient_LL_DoWork(iotHubClientHandle);
      HAL_Delay(100);
    }

Not sure how to get my app to send what it needs...