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

Hi. Im Using an ESP32 to connect to the Arduino IOT Cloud.
I am able to connect to WiFi, but am unable to connect to the IOT Cloud and get this error:
"ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to iot.arduino.cc:8884 Error: 5"
Does anyone know what this error means and what can be done to fix it. Any help in uncomplicated jargon will be appreciated, as this is my first stint with coding and am at a novice level when it comes to microcontrollers. Am doing this for a terrace garden project.

Error 5 means not authorized you should double check your device_id and secret key, do you mind sharing the whole serial monitor log from the ESP32 boot?

serial_monitor_export (3).pdf (104.4 KB)

Here you go and thank you so much for the quick response.

serial_monitor_export (5).pdf (116.7 KB)
Here is the error that i usually get. i don't know what happened in the previous log...

device-id looks ok. This

TimeServiceClass::getRemoteTime cannot get time from NTP, fallback on connection handler\r\n
TimeServiceClass::getRemoteTime cannot get time from connection handler\r\n
ArduinoIoTCloudTCP::handle_SyncTime could not get valid time. Retrying now.\r\n

and this

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

are probably symptoms of some network issue. Do you have the possibility to try a different network?

If it does not work, you should double check your secret key or as last resort delete your cloud device and create a new one.

I have tried all of the above. Tried a new network, double checked the secret key and created a new device, checked the firewall ...is there anything I'm probably missing out on?

Ok...I created the device one more time and it worked. Hmm...thanks a tonne. You guys are doing a great job.

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