Arduino Uno with W5100 ethernet shield
WEB Dashboard
When creating sensors, using CAYENNE_OUT, for the most part works. When creating actuators and using CAYENNE_IN nothing happens and Arduino UNO goes off line. I just change IN to OUT and it works. All I am doing is printing a line to the console.
Also, have used 2 raspberry pi’s no problems. 2 different arduino’s produce the same condition.
Sample: (from dashboard)
#define VIRTUAL_CHANNEL 2
#define ACTUATOR_PIN 11 // Do not use digital pins 0 or 1 since those conflict with the use of Serial.
void setup()
{
Serial.begin(9600);
pinMode(ACTUATOR_PIN, OUTPUT);
Cayenne.begin(username, password, clientID);
}
void loop()
{
Serial.println(“In loop()”);
Cayenne.loop();
}
// This function is called when data is sent from Cayenne.
CAYENNE_IN(VIRTUAL_CHANNEL)
{
Serial.println(" In Cayenne");
//int value = getValue.asInt();
//CAYENNE_LOG(“Channel %d, pin %d, value %d”, VIRTUAL_CHANNEL, ACTUATOR_PIN, value);
// Write the value received to the digital pin.
//digitalWrite(ACTUATOR_PIN, value);
}
CAYENNE_IN never happens. Arduino is Offline on Dashboard.
Console:
12:55:39.905 → [0] MAC: FE-62-B8-BE-1-EA
12:55:40.635 → [726] IP: 192.168.120.83
12:55:40.669 → [727] Connecting to mqtt.mydevices.com:1883
12:55:40.801 → [893] Connected
12:55:40.868 → In loop()
12:55:41.863 → In loop()
12:55:42.859 → In loop()
12:55:43.888 → In loop()
12:55:44.884 → In loop()
12:55:45.913 → In loop()
12:55:46.909 → In loop()
12:55:47.905 → In loop()
12:55:48.933 → In loop()
12:55:49.930 → In loop()
12:55:50.927 → In loop()
I change CAYANNE_IN to CAYENNE_OUT and it works. And now is is online in dashboard.
I have tried an Arduino Clone and a real Arduino., 2 different Ethernet shields.
Sample:
#define VIRTUAL_CHANNEL 2
#define ACTUATOR_PIN 11 // Do not use digital pins 0 or 1 since those conflict with the use of Serial.
void setup()
{
Serial.begin(9600);
pinMode(ACTUATOR_PIN, OUTPUT);
Cayenne.begin(username, password, clientID);
}
void loop()
{
Serial.println(“In loop()”);
Cayenne.loop();
}
// This function is called when data is sent from Cayenne.
CAYENNE_OUT(VIRTUAL_CHANNEL)
{
Serial.println(" In Cayenne");
//int value = getValue.asInt();
//CAYENNE_LOG(“Channel %d, pin %d, value %d”, VIRTUAL_CHANNEL, ACTUATOR_PIN, value);
// Write the value received to the digital pin.
//digitalWrite(ACTUATOR_PIN, value);
}
Console:
13:03:21.522 → [0] MAC: FE-62-B8-BE-1-EA
13:03:22.187 → [675] IP: 192.168.120.83
13:03:22.220 → [676] Connecting to mqtt.mydevices.com:1883
13:03:22.585 → [1046] Connected
13:03:22.618 → In loop()
13:03:23.647 → In loop()
13:03:24.643 → In Cayenne
13:03:24.676 → In loop()