[SOLVED] MQTT Not Connecting

#1

I am having trouble connecting to Losant using MQTT. I was trying the arduino-wifi-shield-101 example but the firmware is stuck on following loop. I tried with Particle Photon and Arduino MKR1000, both devices are having problem conneting.

while(!device.connected()) {
    delay(500);
    Serial.print(".");
}

Could someone help me to figure it out and fix it?

#2

This is an unfortunate side affect of our recent name change and getting a properly-signed SSL certificate that the Arduino’s accept. It should be resolved soon, but here’s the work-around:

Edit Losant.h and change the broker URL to https://broker.getstructure.io. The file will be located in your Arduino’s libraries folder, which on a Mac is located at ~/Documents/Arduino/losant-sdk-arduino/src/Losant.h.

In this file, change:

#define LOSANT_BROKER "broker.losant.com"

to

#define LOSANT_BROKER "broker.getstructure.io"

This will use our previous SSL certificate, which is signed by an authority that Arduino accepts. We are waiting on our final legal paperwork to get the new certificate issued for Losant. I apologize for the inconvenience.

#3

@Brandon_Cannaday, I changed the Broker URL but still not connecting. Here is a screenshot of the Serial output. I temporarily put Serial.println in the LosantDevice::connect method.

#4

Really sorry, that was my issue. The workaround is working fine. I by mistake put .com instead of .io.

Thanks :slight_smile:

#5

Awesome! Again sorry about that. It took way longer to get the legal docs than we expected, but the losant.com broker should be accepted very soon.

#6

The new certificate has been installed. You can, if you want, revert your changes back to broker.losant.com.

#7

@Brandon_Cannaday, its working :slight_smile: