@@ -369,8 +369,10 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SyncTime()
369
369
370
370
ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker ()
371
371
{
372
+ DEBUG_VERBOSE (" ArduinoIoTCloudTCP::%s connecting to %s:%d (attempt %d)" , __FUNCTION__, _brokerAddress.c_str (), _brokerPort, _last_connection_attempt_cnt);
372
373
if (_mqttClient.connect (_brokerAddress.c_str (), _brokerPort))
373
374
{
375
+ DEBUG_VERBOSE (" ArduinoIoTCloudTCP::%s connected to %s:%d" , __FUNCTION__, _brokerAddress.c_str (), _brokerPort);
374
376
_last_connection_attempt_cnt = 0 ;
375
377
return State::SubscribeMqttTopics;
376
378
}
@@ -395,18 +397,21 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SubscribeMqttTopics()
395
397
return State::ConnectPhy;
396
398
}
397
399
398
- if (!_mqttClient.subscribe (_dataTopicIn))
400
+ DEBUG_VERBOSE (" ArduinoIoTCloudTCP::%s subscribing to %s ..." , __FUNCTION__, _dataTopicIn.c_str ());
401
+ if (!_mqttClient.subscribe (_dataTopicIn, 0 ))
399
402
{
400
403
DEBUG_ERROR (" ArduinoIoTCloudTCP::%s could not subscribe to %s" , __FUNCTION__, _dataTopicIn.c_str ());
401
404
#if !defined(__AVR__)
402
405
DEBUG_ERROR (" Check your thing configuration, and press the reset button on your board." );
403
406
#endif
404
407
return State::SubscribeMqttTopics;
405
408
}
409
+ DEBUG_VERBOSE (" ArduinoIoTCloudTCP::%s subscribed to %s" , __FUNCTION__, _dataTopicIn.c_str ());
406
410
407
411
if (_shadowTopicIn != " " )
408
412
{
409
- if (!_mqttClient.subscribe (_shadowTopicIn))
413
+ DEBUG_VERBOSE (" ArduinoIoTCloudTCP::%s subscribing to %s ..." , __FUNCTION__, _shadowTopicIn.c_str ());
414
+ if (!_mqttClient.subscribe (_shadowTopicIn, 0 ))
410
415
{
411
416
DEBUG_ERROR (" ArduinoIoTCloudTCP::%s could not subscribe to %s" , __FUNCTION__, _shadowTopicIn.c_str ());
412
417
#if !defined(__AVR__)
@@ -415,6 +420,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SubscribeMqttTopics()
415
420
return State::SubscribeMqttTopics;
416
421
}
417
422
}
423
+ DEBUG_VERBOSE (" ArduinoIoTCloudTCP::%s subscribed to %s" , __FUNCTION__, _shadowTopicIn.c_str ());
418
424
419
425
DEBUG_INFO (" Connected to Arduino IoT Cloud" );
420
426
execCloudEventCallback (ArduinoIoTCloudEvent::CONNECT);
0 commit comments