The following errors occur on a IOT program that and turned on and off LED from Dashboard. I attached the code following error.
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883
ArduinoIoTCloudTCP::handle_ConnectMqttBroker 4 connection attempt at tick time 42816
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-sa.iot.arduino.cc:8883
ArduinoIoTCloudTCP::handle_ConnectMqttBroker 5 connection attempt at tick time 75926
Check your thing configuration, and press the reset button on your board.
ArduinoIoTCloudTCP::handle_SubscribeMqttTopics could not subscribe to
/a/t/a45aead5-4550-4288-b662-61c55dfaef63/e/i
============================PROGRAM====================================
/*
Arduino IoT Cloud Properties description
The following variables are automatically generated and updated when changes are made to the Thing properties
LED work IOT
bool switchState;
int potentiometerValue;
bool ledState;
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 <FTDebouncer.h> */
#define LED_PIN 2
#define POT_PIN A1
#define BUTTON_PIN 5
/* FTDebouncer buttons; */
void setup() {
pinMode(LED_PIN, OUTPUT);
/* buttons.addPin(BUTTON_PIN, LOW); /
/ buttons.init(); */
/*
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 3
*/
setDebugMessageLevel(2);
// 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);
}
void loop() {
ArduinoCloud.update();
}
// LED IOT CODE
void onLightChange() {
digitalWrite(LED_PIN, light);
Serial.print("The light is ");
if (light) {
Serial.println("ON");
} else {
Serial.println("Light is OFF");
}
}
=========================Things=========================
#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>
char ssid[] = SECRET_SSID; // Network SSID (name)
char pass[] = SECRET_PASS; // Network password (use for WPA, or use as key for WEP)
#define THING_ID "a45aead5-4550-4288-b662-61c55dfaef63"
void onLightChange();
bool light;
void initProperties(){
ArduinoCloud.setThingId(THING_ID);
ArduinoCloud.addProperty(light, READWRITE, ON_CHANGE, onLightChange);
}
WiFiConnectionHandler ArduinoIoTPreferredConnection(ssid, pass);