Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MKRNB1500-Azure_IoT #2

Open
splitout opened this issue Jun 18, 2019 · 0 comments
Open

MKRNB1500-Azure_IoT #2

splitout opened this issue Jun 18, 2019 · 0 comments

Comments

@splitout
Copy link

Hi sir,

Iam actually testing your project with the MKR NB1500 to connect to Azure-Cloud.
In the most cases the "mqttClient.connectError()" returns the value "3". Error-Code for: "MQTT_SERVER_UNAVAILABLE "
Out 1 of 100 tests to connect the mqttClient works fine. Then the connection to the azure-hub is successfully. But if I start the c-program again, the mqttclint.connect() shows an error again.
It seems like a problem in the mqttClient.connect(broker,8883). The retry doesnt work, because the connection over the SIM-Network is to slow. (presumable)

Can someone help me? I need help...

error
connected

Sourcecode:
void connectMQTT() {
Serial.print("Attempting to connect to MQTT broker: ");
Serial.print(broker);
Serial.println(" ");

while (!mqttClient.connect(broker, 8883))
{
// failed, retry
Serial.print(".");
Serial.println(mqttClient.connectError());
delay(500);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant