[Solved] MKR1000 hangs on trying to connect to Losant

I have a MKR1000 and I am following the example mentioned in the original post.

I was not able to connect securely. I did resolve the -1 error by changing MQTT_MAX_PACKET_SIZE from 128 to 256 in PubSubClient.h as mentioned in a previous comment. This then gave me a -2 error. I was able to resolve this error by using the Arduino FirmwareUpdater tool and uploading the certificate found at broker.losant.com:8883. This then gave me error code 5 (Unauthorized) which I have not been able to solve yet.

I tried connecting insecurely and was able to by making the following changes:

  1. WiFiSSLClient wifiClient; to: WiFiClient wifiClient;
  2. device.connectSecure(wifiClient, LOSANT_ACCESS_KEY, LOSANT_ACCESS_SECRET); to: device.connect(wifiClient, LOSANT_ACCESS_KEY, LOSANT_ACCESS_SECRET);

-Kevin

1 Like