Cant connect to Arduino IoT Cloud

I am trying to use the IOT Cloud. I have a Nano 33 IOT connected.
I have followed the official Arduino “IoT Cloud – Getting Started” to the letter.

I get as far as Wifi connected but then ;
“handle_ConnectMqttBroker could not connect to mqtts-sq.iot.arduini.cc:8883”

I have tried with a UNO Wifi Rev2 but it says it isn’t recognized (yet)

I have searched this forum and used Google but there seems to be nothing out there apart from this one project using this Arduino iot Cloud.

It is annoying as I have purchased these two original boards to be able to add an iot project.

Has anyone got a simple sure-fire way to connect one of these boards to be able to read simple data from an Iphone?
Many thanks

Herrid:
“handle_ConnectMqttBroker could not connect to mqtts-sq.iot.arduini.cc:8883”

Does it really say "arduini.cc"? I would expected it to be "arduino.cc" instead.

pert:
Does it really say "arduini.cc"? I would expected it to be "arduino.cc" instead.

not helpful

Herrid:
not helpful

What do you mean by that? I'm trying to help you.

In order to do that, I need to know whether the error message you posted is exact.

If so, there might be a bug in the program that's causing the wrong URL to be accessed.

If instead you typed out the error message manually and made a typo, then there's no point in me investigating the "arduini.cc" bug.

Anyway, the choice is yours as to whether you want my help. You can be stubborn and post vague useless replies, or you can answer my question so we can start working on trying to get you back to having fun working on your project. It's up to you how you want this to go. I have plenty other things I can be doing with my time.

I'm sorry, it was arduino of course.

I'm having the same issue with a MKR 1010. Getting the error:

ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883

Searching through the forums I have seen some reference to NTP connection being blocked, but I don't believe that is the case for me. I have tried both via my home wifi and cellular hotspot. WiFi connects OK, but the above error is still occuring when trying to connect to Arduino IoT.

I have tried the setDebugMessageLevel(4) and setDebugMessageLevel(DBG_VERBOSE), but this above message is all I am seeing.

Similar issue for me. I have a DHT11 connected to a Nano 33 IOT. Here is the error. The result I get is a valid temperature and humidity and then the error message.

ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883

Have you tried to use Node-Red to make the connection? I found that Node-RED is a helpful tool when working out MQTT Broker connection issues.

I've used Node Red for other purposes (e.g. Arduino --> Raspberry Pi --> Dashboard) but for this current Arduino project, I'm trying to use the Arduino IOT Cloud. The sketch is below. Nearly all of it is auto-generated by the IOT Cloud set up procedure - I added a few lines for the DHT11. I'm wondering if I'm supposed to also add some MQTT-related code but I haven't been able to locate too much documentation about the IOT Cloud and none of the demos I've seen talk about needing to add MQTT language.

Here's he sketch - again, most of this is auto-generated by the Arduino IOT Cloud set up:

/* 
  Sketch generated by the Arduino IoT Cloud Thing "ENV_Nano33_1"
  https://create.arduino.cc/cloud/things/<Device ID Redacted>

  Arduino IoT Cloud Properties description

  The following variables are automatically generated and updated when changes are made to the Thing properties

  float dht11_hum;
  float dht11_temp;

  Properties which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#include "thingProperties.h"
#include <dht.h>
dht DHT;
#define DHT11_PIN 7

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(1500); 

  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  // Your code here 
  int chk = DHT.read11(DHT11_PIN);
  Serial.print("Temperature = ");
  Serial.println(DHT.temperature);
  Serial.print("Humidity = ");
  Serial.println(DHT.humidity);
  delay(1000);
  
}


void onDht11TempChange() {
  // Do something
}


void onDht11HumChange() {
  // Do something
}

Curious to know if anyone out there has some guidance on this one. I've searched a good bit on the Internet and so far I haven't come up with any leads to follow. Also, I know cross-posting isn't tolerated but if anyone has any ideas of other forum sections to seek guidance, I'd appreciate your insights on that.

Turns out that I just reinitialized the board via the Arduino IOT Cloud set up procedure and alas it now works. I had reinitialized last weekend - today was the first time I reinitialized since then - perhaps there was a Cloud-side issue over the weekend, which has since been resolved.

One other item to note: yesterday, before reinitializing today, I updated WifiNINA on the board. I don't know if that had an effect or not.

I have a second Nano 33 IOT that I will eventually configure for Arduino IOT Cloud. I'm looking forward to seeing if I run into any of the same issues experienced with the current Nano 33 IOT

I am facing a similar problem with my MKR1000.
There was no problem with my WiFi connection as I could connect my Arduino with the internet using WiFi101.h library.

I checked the WiFi.status() after running the official Arduino "IoT Cloud - Getting Started" code, and it was 0, which I assumed it was not connected.

Then I use the WiFi101.h library to initialize the on-board wifi before running ArduinoCloud.begin(ArduinoIoTPreferredConnection);

void wifi_init(){
  if (WiFi.status() == WL_NO_SHIELD) {

    Serial.println("WiFi shield not present");

    // don&apos;t continue:

    while (true);

  }

  // attempt to connect to WiFi network:

  while ( status != WL_CONNECTED) {

    Serial.print("Attempting to connect to open SSID: ");

    Serial.println(ssid);
    
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);

  }

  // you&apos;re connected now, so print out the data:

  Serial.print("You&apos;re connected to the network");
}

It successfully connected to the internet, and the value of WiFi.status() changed to 3.
However, I still failed to connect to the Arduino cloud with the same error:
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883

Not sure why it happens, I am still working on it.

I'm having the same issue with my MKR1010.

adr2018:
Turns out that I just reinitialized the board via the Arduino IOT Cloud set up procedure and alas it now works. I had reinitialized last weekend - today was the first time I reinitialized since then - perhaps there was a Cloud-side issue over the weekend, which has since been resolved.

One other item to note: yesterday, before reinitializing today, I updated WifiNINA on the board. I don't know if that had an effect or not.

I have a second Nano 33 IOT that I will eventually configure for Arduino IOT Cloud. I'm looking forward to seeing if I run into any of the same issues experienced with the current Nano 33 IOT

What WifiNINA firmware version did you update to?

Thank you.

Hello,
I had the same problem with my MKR 1010, also the error:
"ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883"
I deleted the Thing and set up everything again. Now the Arduino can connect to IoT Cloud. I don't know what exactly was the problem but know it works :slight_smile:

2 Likes