Issue at br_sslio_flush(&_ioc)
inside int BearSSLClient::connectSSL(const char* host)
when using MQTT on Arduino MKRNB 1500
#92
Labels
type: imperfection
Perceived defect in any part of project
Hello,
I am facing an issue while attempting to connect my Arduino MKR 1500 NB to an MQTT broker using a combination of NBClient, BearSSLClient, and arduinoMqttClient libraries. Despite successfully connecting to the NB IoT network and establishing a UDP connection to an NTP server, the connection to the MQTT broker fails during the inital BearSSL connect process. The failure occurs specifically during the
br_sslio_flush(&_ioc
) call in theBearSSLClient::connectSSL
function, where the program freezes without generating a response, timeout, or error. Could this issue be related to an inconsistency in the character sequence length following the AT command issued to the NBIoT module? Or is it something else?I am using an Arduino MKR 1500 NB client -> BearSSLClient ->arduinoMqttClient
I am able to connect to the NB IoT network and I am even able to start a UDP connection to an NTP server (which is used for
ArduinoBearSSL.onGetTime(get_time); // Required for server trusted root validation.
)
We then get ready to initialize the MQTT client, and the problem comes up when we run
arduinoMqttClient.connect(address,port)
link:arduinoMqttClient.connect(address,port)
calls, which runs until_client->connect(host, port)
:_client->connect(host, port)
seems to trigger a call to two functions:int NBClient::connect()
link which executes successfully and creates a TCP socket with "global.azure-devices-provisioning.net",8883:int BearSSLClient::connectSSL(const char* host)
which is where the failure occurs, specifically on the call tobr_sslio_flush(&_ioc);
function:At that time there is an AT command issued to the NBIoT module and after that the program doesn't genereate any reposnse or timeout or error return. It just freezes.
One thing that I did note is that the character sequence following the AT+USOWR command is not of the same length as specified in the start of the AT command (178 vs the 242 supposed to be sent). But I don't know if this is just an issue with MAX number of characters in arduino's Serial.println()
-Here are the Serial.print() statments I am using for debugging aling with the AT commands sent by MKRNB module:
Additional
int BearSSLClient::connectSSL(const char* host)
reference code with debug Serial.println() statements added:The text was updated successfully, but these errors were encountered: