Can't connect to Arduino IoT cloud "Error: 5"

I am using a Wemos D1 Mini for a simple switch-controlling IoT device. I configured my device and Thing correctly and uploaded the sketch from the browser. My Wemos D1 Mini board connects to my Wifi network and then sends the following msg on serial monitor:

MQTT Broker: iot.arduino.cc:8884
WiFi.status(): 6
Connected to "txrx"

ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to iot.arduino.cc:8884 Error: 5

By the way I live in Iraq currently if that makes a difference!

Please help!

1 Like

Ok, I solved it!
When creating a device, in the configuration you will have to setup the wifi network credentials, the first and second boxes are for the Wifi credentials , the third, however, is the SECRET KEY, the one you got when you created your device and you were asked to save or download the PDF that has been autogenerated. I was entering the wifi's password twice, once in its field and second in the secret key field, YOU HAVE TO ENTER THE SECRET KEY IN THE SECRET KEY's field to make allow the device to connect to cloud!

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.