I wrote this script. It works just fine in the IOT cloud dashboard. But when I use it with an Alexa, Alexa couldn't find a new device to connect. I don't know how to fix it.
#include "thingProperties.h" // Include the thingProperties.h file
void setup() {
// Initialize serial communication
Serial.begin(9600);
// Initialize the cloud properties
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
// Set pin 3 as an output
pinMode(13, OUTPUT);
// Give some time for Serial Monitor to start
delay(1500);
}
void loop() {
ArduinoCloud.update(); // Keep the connection to the Arduino IoT Cloud active
}
// This function will be called every time the variable 'light' changes its value
void onLightChange() {
if (light) {
digitalWrite(13, HIGH); // Turn the light on
} else {
digitalWrite(13, LOW); // Turn the light off
}
}
It might be because I am using two bands of internet and my Arduino and My phone is connected to the 2ghz one but all the Alexas are using 5g? I dont know.