Hi kreggly and jungi77,
I have made a few more things but still no success…
jungi77, were you able to solve your problem on Yun?
Here’s what I did:
- Replaced arduino board and Ethernet shield with different brands.
- Simplified the code to bare bones (appended bellow). Started from Cayenne’s suggested base code and added 5 Virtual’s, passing fixed values as your suggested code. No sensors, no LCD, buzzers, internal clock or SD cards.
- Created a new machine from scratch on the web using a new token and simple displays all defaults.
- turned off all other Arduino’s connected to Cayenne at home (didn’t check but perhaps I thought it was a MAC address conflict.
After all this, it still locks after a minute or so apparently by not being able to connect to Cayenne. It all starts OK, then a few connection losses then it dies.
My other arduino’s work well, on the same network.
- I was powering the arduino on USB, Just to be sure, I connected also a power supply to ensure it’s not it.
- Reset my router (airport) just in case.
- Plugged the ethernet cable directly to my router ( It was on a hub connected to the router).
When I commented initially, mentioning that the problem was between Cayenne and the SD, I was not waiting enough to Cayenne to crash.
It still locks after a minute or so. It runs for a few looks (10-15) and starts loosing connection, recovering and the reconnect a few times with time increasing till full crash.
It’s getting really hard to believe it is not some sort of bug perhaps based on the particular case of 6 my Virtual sensors …
I have no other ideas to isolate the problem and am very frustrated as I’ve been very successful with Cayenne. I’ve been trying to solve this for weeks and spend many many hours on it.
The code I was running is now:
#define CAYENNE_DEBUG // Uncomment to show debug messages
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <CayenneEthernet.h>
// Cayenne authentication token. This should be obtained from the Cayenne Dashboard
char token = “n4bs70uwdh”;
boolean iAmAlive;
void setup() {
Serial.begin(9600); // get ready to print info on serial if DEBUG_PRINT is enabled
Serial.print(F(“Hi”));
Cayenne.begin(token); }
void loop() { Cayenne.run(); } // couldn’t make is more simple
// Sending Data to Cayenne.
CAYENNE_OUT(V0) {// When V0 is called, all remaining configured Virtual pins are also called afterwards
Serial.print(F(“0”));
Cayenne.virtualWrite(V0, iAmAlive); // This is the only addition to give an indication it is working on the web.
iAmAlive = !iAmAlive;
Serial.print(“.”);
}
int counter = 0;
CAYENNE_OUT(V1) { Serial.println(“Entering V1 Out”);
if(counter == 0) {
Serial.println(“Sending Temp…”);
Cayenne.virtualWrite(V1,10.0, TEMPERATURE, CELSIUS);
} else if (counter == 1) {
Serial.println(“Sending Humidity…”);
Cayenne.virtualWrite(V1,20.0, HUMIDITY, PERCENT);
} else {
Serial.println(“Sending Pressure…”);
Cayenne.hectoPascalWrite(V1, 30.0); }
counter++;
if(counter > 2) counter = 0;
Serial.println(“Leaving V1 Out”);
}
and I repeated V1 other 4 times adjusting the variables to V2…V5