Skip to content

Commit 20dd328

Browse files
committed
Debug: print mqttClient error code when connection fails
1 parent 502590b commit 20dd328

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ArduinoIoTCloudTCP.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
331331
/* Can't connect to the broker. Wait: 2s -> 4s -> 8s -> 16s -> 32s -> 32s ... */
332332
_connection_attempt.retry();
333333

334-
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not connect to %s:%d", __FUNCTION__, _brokerAddress.c_str(), _brokerPort);
334+
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not connect to %s:%d Error: %d", __FUNCTION__, _brokerAddress.c_str(), _brokerPort, _mqttClient.connectError());
335335
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s %d next connection attempt in %d ms", __FUNCTION__, _connection_attempt.getRetryCount(), _connection_attempt.getWaitTime());
336336
/* Go back to ConnectPhy and retry to get time from network (invalid time for SSL handshake?)*/
337337
return State::ConnectPhy;

0 commit comments

Comments
 (0)