Connect Portenta H7 to IOT Cloud

I have a problem with the Arduino project I am currently working on.

I Can't connect to IOT Cloud of portenta H7.
As shown in the message below, a problem occurs even when I try to connect to the cloud by downloading only the basic sketch that is created when things are created.
" ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883"

Updating the WiFi Firmware does not solve the problem.
Even after updating the WiFi Firmware, the version is still 0.0.0

MKR WiFi 1010 board works no problem

Can you help me what is the problem?

Thank you

Hi @paraejun,
did you try to re-provision the board?

I'm having a similar problem with the Portenta H7 not connecting to the cloud. I set it up in the IOT Cloud as a new device, then under Things / my device / Setup and Sketch set the wifi credentials and flashed the default sketch. The debug window shows it connecting to Wifi but it could not connect to the MQTT Broker.

Here's the sketch:

#include "thingProperties.h"

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 
}

And here's the output in the serial monitor:

***** Arduino IoT Cloud - configuration info *****
Device ID: 49ea84de-2358-4c76-a17f-3ffc06c8d2e7
MQTT Broker: mqtts-sa.iot.arduino.cc:8883
WiFi.status(): 0
Current WiFi Firmware: v1.94.0
Connected to "iiNetxxxxxx"
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883
ArduinoIoTCloudTCP::handle_ConnectMqttBroker 1 connection attempt at tick time 14772
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883
ArduinoIoTCloudTCP::handle_ConnectMqttBroker 2 connection attempt at tick time 20450
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883
ArduinoIoTCloudTCP::handle_ConnectMqttBroker 3 connection attempt at tick time 30130

I tried deleting everything and starting again, so unless I didn't do that properly I'm stuck. Bootloader and Wifi firmware is up to date. Other example sketches that fetch content from a website work, so it's not Wifi.

Thanks,
Simon

Hi @simon_navronics, i'm sorry that you are having troubles connecting to the cloud. Usally that error can be caused by an authentication issue or a timeout, so i suggest you to re-provision the board and try to connect using a different access point.
I've tried now to connect an H7 to the cloud and everything went well.

Hi @pennam, thanks for replying so fast!

I have tried two different access points at two different locations. You mentioned timeout: I don't know how tight the timeouts are, or if they can be configured? Would be cool if the call would return the reason for the failure.

Perhaps my issue is to do with how I re-provision. Could you outline the steps needed to properly re-provision a device? So far I just tried removing all the IOT Cloud entries but perhaps there is more to it.

Hi @simon_navronics

connection timeout is hardcoded to 1.5 seconds ArduinoIoTCloud/src/ArduinoIoTCloudTCP.cpp at 89d3c92c86ecfef63868ac8d8e161e4fe4543001 · arduino-libraries/ArduinoIoTCloud · GitHub

Yes this is something that needs to be improved for sure!

Steps to re-provision the device are:

1 - Delete old device from the Devices tab (3 dots on the rigth);

2 - Click on Add to re provision the device, and follow provisioning procedure

3 - Link old thing to the new device or create a new one


or

4 - Upload the thing to the device

I tried a 3rd wifi access point and it didn't work, so I then followed the steps you have for re-provisioning and it worked! First time failed when it got to the secure element step, I've read about this, did open the debug console then it worked.

Odd thing is I did try re-provisioning 3 times before without success. I had deleted everything first. So I'm not exactly sure which thing made it work. If it was re-provisioning or if it was re-provisioning witch the new wifi access point. I'll see if I can work out what makes this process break, it seems quite fragile.

Thanks!
Simon

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