IOT Cloud is unstable?

Hi all, this is my first experience with this first forum so hopefully I am in the right place. Thanks in advance-Brian

PS: I apologize if I seem short-I have spent way too many days on time reconnect issues!

Issue:
intermittent or not able to connect to the IOT Cloud

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

Background:

  • this issue exists in three different states (Florida, Minnesota, and Wisconsin)
  • this issue exists on three different ISPs

Controllers:

  • Arduino Unto R4 Wifi
  • Nano 2050 Connect (this CPU constantly resets whenever contact is lost with the cloud)

Firmware: (don't tell me this is the problem Arduino tech support...ugh)

  • Arduino Unto R4 Wifi (was using 1.4.0 and upgraded to 1.5.0-no difference)
  • Nano RP2040 Connect (this CPU constantly resets whenever contact is lost with the cloud)*
  • running 1.4.8 because I can't upgrade the firmware through the IDE2.0 or IOT Cloud)

Problem:

  • this should not be that hard to establish AND maintain a connection to the IOT Cloud
  • I've done a lot of hunting on the internet already without much success

Sketch:

/* 
  Sketch generated by the Arduino IoT Cloud Thing "Untitled"
  https://create.arduino.cc/cloud/things/62b8db47-5a3f-4a7a-8721-5957e7ebda02 

  Arduino IoT Cloud Variables description

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

  - No variables have been created, add cloud variables on the Thing Setup page
    to see them declared here

  Variables 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"

unsigned long startingTicks=0;

void setup() {
  ArduinoCloud.begin(ArduinoIoTPreferredConnection, false); //does not seem to stop reboots!
  pinMode(13,OUTPUT);
  digitalWrite(13,HIGH);
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(1500); 
  digitalWrite(13,LOW);

  // 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();
  startingTicks=millis();
}

void loop() {
  ArduinoCloud.update();
  
  if(millis() > (startingTicks+500))
  {
      Serial.print("Time:");
      Serial.println(millis());
      startingTicks=millis();
  }
  
  
  // Your code here 
  
  
}

Error Messages: (again, the constant rebooting when it can't see the cloud isn't helping with debugging)

***** Arduino IoT Cloud - configuration info *****
Device ID: 30ee31ba-92bd-4ebe-94cc-8a717680a020
MQTT Broker: mqtts-sa.iot.arduino.cc:8883
WiFi.status(): 0
Current WiFi Firmware: 1.4.8
Latest WiFi Firmware: 1.5.0
Please update to the latest version for best performance.
Time:8884
Connected to "SpectrumSetup-E8"
Time:12028
Time:12558
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883
ArduinoIoTCloudTCP::handle_ConnectMqttBroker 1 connection attempt at tick time 21556
Time:19557
Time:20059
Time:20560
Time:21061
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883
ArduinoIoTCloudTCP::handle_ConnectMqttBroker 2 connection attempt at tick time 32556
Time:28558
Time:29059
Time:29560
Time:30061
Time:30562
Time:31063
Time:31564
Time:32065

Hi!

Thanks for sharing your issue.

Can you please set the debug level to 4 and share again the log?

setDebugMessageLevel(4);

Could you also recreate the Device/Thing?

1 Like

Hi,

First I know you are only trying to help but I have over 30 hours of labor into this...my patience is growing short...this is suppose to be a hobby, not constant frustration.

What I have done:

  • I have removed and added the RP2040 three times already including tonight
    -firmware is at 1.4.8 and removing/adding to the IOT cloud*
  • this process DOES NOT UPGRADE THE FIRMEWARE as other tech support has indicated

I normally post with debug level at 4...forgot about that!

See below:

Attempt 1 at 5:20PM EST on 9/20/23

Connection to "SpectrumSetup-E8" failed
Retrying in  "500" milliseconds
Connected to "SpectrumSetup-E8"
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883
ArduinoIoTCloudTCP::handle_ConnectMqttBroker 1 connection attempt at tick time 22226
TimeServiceClass::sync  Drift: -1695248383 RTC value: 1695248394
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883
ArduinoIoTCloudTCP::handle_ConnectMqttBroker 2 connection attempt at tick time 34828
rebooted

Attempt 2:

***** Arduino IoT Cloud - configuration info *****
Device ID: 4f788262-d332-4ada-9765-fef0a92caaa5
MQTT Broker: mqtts-sa.iot.arduino.cc:8883
WiFi.status(): 0
Current WiFi Firmware: 1.4.8
Latest WiFi Firmware: 1.5.0
Please update to the latest version for best performance.
Connected to "SpectrumSetup-E8"
TimeServiceClass::sync  Drift: -1695248708 RTC value: 1695248708
Connected to Arduino IoT Cloud
Thing ID: 8dc4bfbc-69a5-4858-a89d-ddf72af718f6
TimeServiceClass::setTimeZoneData offset: -14400 dst_unitl 1699164000
ArduinoIoTCloudTCP::handle_Disconnect MQTT client connection lost
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883
ArduinoIoTCloudTCP::handle_ConnectMqttBroker 1 connection attempt at tick time 131860
rebooted

Try going to the IDE go to libraries section
Use install filter and then update all needed libraries?

Try going to the IDE go to boards section
Use install filter and then update all the boards?

Thanks for the hints...oddly tonight the new version was present for me to upgrade to 1.5.0 using IDE 2.0

Thanks but of course that didn't resolve the IOT Cloud issues...in fact is seems to made things worse...ugh.

I have had enough "fun" with my hobby tonight...

I understand your frustration. We will try to help you out.

According to the logs on attempt #1 and #2. I have the following thoughts:

  • Are both with debug level 4? I guess #1 is got with level 2. (this is important, because I don't know if log #1 means that it didn't connect to the Cloud or it's just a matter of debug level and we should discard it)
  • The device always connects to the WIFI network
  • According to #2, the device does connect to the Cloud but disconnects shortly after.
  • It would be helpful to keep the "Time: XXXX" debug messages you had on your original sketch to understand the timed behaviour.

I know that you might have tried these things, but just in case let me propose a couple of actions to you.

  • My feeling is that the WIFI is unstable for some reason. I know that this is suboptimal, but I've observed some times that WIFI problems have got fixed by doing a factory reset on the router. Some WIFI configuration modifications affect somehow connectivity. You could try that if it's not a great deal for you.
  • You can compile and upload the sketch using the Arduino IDE 2.x. For that, open the Cloud sketchbook, pull the sketch and compile it and flash it as usual. Remember to push the sketch if you want to reflect the changes in the Cloud.
  • Some WIFI issues are caused by insufficient power. Insufficient power can be caused by bad USB cables, USB hubs or broken PC USB ports. How are you powering the device? If you are powering it connected to a USB hub, could you connect it directly to the PC or power the USB hub? Could you connect it to a different USB port or a different PC? Check also the USB cable and replace it by another one just in case too.

I hope this helps.

Thanks for attempting to help but I think people keep missing this fact!

  1. This is the same results I get in my home of Wisconsin*
    *I created a separate wifi network just for IOT with same results!
  2. This is the same results I get in my girlfriend's home in Minnesota
  3. This is the same results I get in my girlfriend's home in Florida

These common results are from THREE different wireless networks and three different ISP using two different type of controllers!

I have already swapped cables and various USB Ports on both the laptops and docking stations.

With that said it I am pretty good at offering solutions and IF I WERE ARDUINO AND ABOUT TO LOOSE A BUNCH OF PEOPLE PAYING OVER $100 dollars a year for a service that sort of works when it likes this is what I would do:

  1. develop an application that would:
  • check the firewall rules of the network (make sure all traffic is passing in/out of network)
  • check the delays between the controller and the cloud
  • verify the firmware of the controller
  • provides links/option to update the firmware if needed

This app would really save lots of frustration and really help you all out trying to provide technical support for a service that I know you can't admit is "broken".

Now, I am willing to admit that I have been wrong in the past and in a way I hope I am...

Thanks-Brian

Thanks @MrNerdBench for sharing your feedback.

As I said in my previous post, I understand your frustration, as this kind of issues are sometimes difficult to diagnose.

I can confirm that the platform works and it is not broken. It is indeed working perfectly for most of the users, but of course, that doesn't mean that there might be some situations like yours that may have issues. Feedback like yours is extremely helpful to help us identify and solve those issues.

Putting the focus on your problem, I've tested your sketch with a Nano RP2040 Connect and it works perfectly fine for me. I will try later with a UNO R4 WIFI but I don't have any at hand now.

May I suggest that you try a couple of things?

  • To get more information about the WIFI quality, print the WIFI RSSI value along with the millis tick
    Something like this:
    Serial.println("RSSI: " + String(WiFi.RSSI()));
  • Another test. Can you please add a variable? Just a boolean or integer variable in the Thing. No need to add anything else in the code. After that, just repeat your tests as usual.

For the upcoming logs you send, can you please keep the prints with the "Time"?

Final note: Your suggestion about the application for diagnostics is quite interesting and we will definitely take it into account.

1 Like

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