Skip to content

Opta fails to connect to Arduino Cloud: "Mqtt error: -2 TLS error: 304" #534

Closed
@lobodpav

Description

@lobodpav

Connectiong to IoT in OPTA fails on

ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to iot.arduino.cc:8885 Mqtt error: -2 TLS error: 304

I have followed the official guide below but no luck.

Recovering Unupdated Devices

If you miss the update deadline, your device will automatically disconnect from Arduino Cloud and will not be able to reconnect again. You can recover it by following these steps:

  1. Connect your device via USB to your computer.
  2. Perform an upload of your sketch using the Arduino Cloud Editor; this will ensure IoTCloud library and all required connectivity credentials on your device
    After performing the upload, your device will again be able to connect to Arduino Cloud and send data.

I uploaded the simple sketch below via USB-C, using:

  1. Arduino IDE, Version: 2.3.5-nightly-20241212
  2. ArduinoIoTCloud, Version 2.4.1
  3. OS: MacOS Sequoia 15.3.1
#include "thingProperties.h"

void setup() {
    Serial.begin(9600);

    // Init Thing Properties
    initProperties();

    // Connect to Arduino IoT Cloud
    ArduinoCloud.begin(ArduinoIoTPreferredConnection);

    // Enables information about WiFi and IoT Cloud connection printed to the Serial
    setDebugMessageLevel(DBG_INFO);
    ArduinoCloud.printDebugInfo();
}

void loop() {
    ArduinoCloud.update();
    Serial.println("Hello");
    delay(1000);
}

and I got this output:

21:18:20.646 -> Connection to "MyWifi" failed
21:18:20.647 -> Retrying in  "500" milliseconds
21:18:20.647 -> Hello
21:18:25.985 -> Connected to "MyWifi"
21:18:25.985 -> Hello
21:18:27.073 -> Hello
21:18:29.180 -> ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to iot.arduino.cc:8885 Mqtt error: -2 TLS error: 304

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions