Skip to content

Commit

Permalink
Merge pull request #511 from pennam/bearssl-errors
Browse files Browse the repository at this point in the history
ArduinoCloudTCP: print BearSSL error code
  • Loading branch information
pennam authored Nov 4, 2024
2 parents 51f2318 + 46b9129 commit da514bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,11 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
/* Can't connect to the broker. Wait: 2s -> 4s -> 8s -> 16s -> 32s -> 32s ... */
_connection_attempt.retry();

#if defined (BOARD_STM32H7) && defined(BOARD_HAS_ECCX08)
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not connect to %s:%d Mqtt error: %d TLS error: %d", __FUNCTION__, _brokerAddress.c_str(), _brokerPort, _mqttClient.connectError(), _brokerClient.errorCode());
#else
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not connect to %s:%d Error: %d", __FUNCTION__, _brokerAddress.c_str(), _brokerPort, _mqttClient.connectError());
#endif
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s %d next connection attempt in %d ms", __FUNCTION__, _connection_attempt.getRetryCount(), _connection_attempt.getWaitTime());
/* Go back to ConnectPhy and retry to get time from network (invalid time for SSL handshake?)*/
return State::ConnectPhy;
Expand Down

0 comments on commit da514bb

Please sign in to comment.