Azure / azure-iot-arduino

Azure IoT library for the Arduino
Other
168 stars 95 forks source link

IoTHubClient_LL_DoWork only receiving 1 command until I restart the sketch #65

Closed ddewaele closed 6 years ago

ddewaele commented 7 years ago

When I run the sample, the following code responsible for listening to incoming commands (fanOn / fanOff) only processes a single messages, and then it keeps waiting for commands (although ofhter messages have been sent and should be processed)

If I am sending 5 commands to the device, only first one is received and processed. If I restart the sketch then the second one is received and so on.

The sketch keeps executing the IoTHubClient_LL_DoWork function but nothing comes in.

while (1)
{
  (void)printf("Waiting for commands.... \r\n");
  IoTHubClient_LL_DoWork(iotHubClientHandle);
  ThreadAPI_Sleep(100);
}

If remove the endless loop in the simplesample_http.c and rely on the loop in the ino file, then all commands are executed propertly (but offcourse then the program needs to connect to IoTHUB on every run.

Any ideas what might be causing this ?

JetstreamRoySprowl commented 6 years ago

@ddewaele : I believe the fix for this is included in the latest 1.0.40 libraries. Will you please try them and see if the problem still exists?

VitSolcikNXP commented 6 years ago

Same problem, could You please inform me, if someone solved this? Thanks.

JetstreamRoySprowl commented 6 years ago

That fix went in long ago. Please make sure you're on the latest version of the libraries, and if you're using ESP8266, you need to update the ESP8266 library as well.

mrotta commented 5 years ago

I have the exact same issue and I just installed all of the stuff yesterday. (Feather M0 board)

@JetstreamRoySprowl Cany you provide a link to the fix that you mentioned?