Disabling errors on IOT Cloud "Thing" sketch

I made an IOT sketch using the Arduino Cloud, and I set the debug message level to 0 to not display debug info, but I don't want any error messages since I am using it to communicate via the cloud "messenger" widget to the serial port and do not want unneeded serial activity. When I power my ESP8266, it replies that it fails the internet connection 2 times before starting.

[Code]:

#include "arduino_secrets.h"
/* 
  Sketch generated by the Arduino IoT Cloud Thing "ESP-IOT"
  https://create.arduino.cc/cloud/things/33423b1c-ed72-4745-9bdd-ba1fd4a272d0 

  Arduino IoT Cloud Variables description

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

  String text;

  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.
*/
String buf;

#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(0);
  // ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  // Your code here
  if(Serial.available()){
    buf = Serial.readString();
    buf.trim();
    text = buf;
  };
}

/*
  Since Text is READ_WRITE variable, onTextChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onTextChange()  {
  // Add your code here to act upon Text change
  Serial.println(text);
}

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