[SOLVED] MQTT Not Connecting

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?

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.

@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.

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

Thanks :slight_smile:

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.

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

@Brandon_Cannaday, its working :slight_smile: