Cannot connect to Arduino Cloud

I downloaded the sample code following the instruction of ESP32/ESP8266 IoT Cloud (IoT Cloud - Arduino Forum) to a Heltec WiFi Kit 32 board. The sketch is compiled and loaded successfully via Arduino IDE 2.3.2. The board is connected to the WiFi network correctly.

I received following error message:
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to iot.arduino.cc:8884 Error: -1

What does this "error: -1" means?

Is the Agent running?

The -1 isn't the important part, use verbos output and post entire verify log in code tags please. If the agent missing is NOT the issue.

Here are more verbose print out:


pA:��***** Arduino IoT Cloud - configuration info *****
Device ID: 065502bb-de16-47c0-a12d-cf63f365d8a2
MQTT Broker: iot.arduino.cc:8884
WiFi.status(): 255
Connection to "HSI" failed
Retrying in "4000" milliseconds
Connected to "HSI"
TimeServiceClass::sync done. Drift: -1728080234 RTC value: 1728080255
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to iot.arduino.cc:8884 Error: -1
TimeServiceClass::sync done. Drift: -1 RTC value: 1728080274
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to iot.arduino.cc:8884 Error: -1

How do I know if the Agent is running?

I delete the device, Thing and dashboard. Then create a new one. This time, the device is able to connect online. But it is intermittent,
image
Not sure what causes it to connect or disconnect. Is there a tule how often should I execute the ArduinoCloud.update() function?

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