Maybe a noob question: how can I check in the Arduino sketch if it had connected to the Cayenne? I know it prints that to the serial, but I wanted to have an LED start blinking after the board comes online at mydevices.com
I just learned how I can achieve this using Triggers from within Cayenne.
But I have a problem, I set up two triggers, one for when it comes online, and one for when it goes offline. Now after reseting to board, the light switch that it’s connected to in Cayenne dashboard comes online, the LED on the Arduino lights up, but it after a second it goes off. The light switch on the dashboard on the other hand stays on.
i use this with ESP8266 (Arduino IDE) try if working for you ?
// This function will run every time the Cayenne connection is established.
CAYENNE_CONNECTED()
{
CAYENNE_LOG("Connection established");
Serial.println("\n++ Cayenne Connected ! ++"); // can be deleted
//<==== HERE i do something when Cayenne is connected
}
CAYENNE_DISCONNECTED()
{
CAYENNE_LOG("Connection finished");
Serial.println("\n-- Cayenne Disconnected ! --"); // can be deleted
//<==== HERE i do something when Cayenne is disconnected
}