I’m trying not to use my Electron cellular data plan during code development, and wondered if header files are available so I can compile my Electron code will testing it using a Photon?
Example:
bool cellReady = Cellular.ready(); // Cellular (Electron)
bool cloudReady = Particle.connected();
Serial.printlnf("wifi=%s cloud=%s counter_slp=%d retainedCounter_slp=%d", (cellReady ? "on" : "off"), (cloudReady ? "on" : "off"),
counter_slp++, retainedCounter_slp++);
if (cellReady) {
if (firstAvailable == 0) {
firstAvailable = millis();
}
// if (millis() - firstAvailable > 30000) {
// After we've been up for 30 seconds, go to sleep. The delay is so the serial output gets written out before
// sleeping.
if (millis() - firstAvailable > 500) {
// After we've been up for 15, go to sleep.
Serial.println("calling System.sleep(SLEEP_MODE_DEEP, 300)");
delay(2);
// System.sleep(SLEEP_MODE_DEEP, 60 * 20, SLEEP_NETWORK_STANDBY);//20 mins or 1200 secs Sleep now,
// System.sleep(A7,Falling, SLEEP_NETWORK_STANDBY, 7200);
// System.sleep(WKP, RISING, 1320, SLEEP_NETWORK_STANDBY); // sleepForSeconds =13200 seconds = 22 min.
// System.sleep(WKP, RISING, 60 * 30 * 4, SLEEP_NETWORK_STANDBY); // sleepForSeconds =7200 seconds = 2 hours.
// System.sleep(SLEEP_MODE_DEEP, 1320, SLEEP_NETWORK_STANDBY); // sleepForSeconds =13200 seconds = 22 min. (per SfuffR @ particle)
// The rest of the code here is not reached. SLEEP_MODE_DEEP causes the code execution to stop,
// and when wake up occurs, it's like a reset where you start again with setup(), all variables are
// cleared, etc.
Serial.println("returned from sleep, should not occur");
}
}
else {
firstAvailable = 0;
}// End of Sleep code
I’m getting the following error when the Target is a Photon.
eck-new -std=gnu++11 -c -o …/build/target/user/platform-6-msrc/lcdsignalstrength.o src/lcdsignalstrength.cpp
lcdsignalstrength.ino:744:1: warning: “/*” within comment [-Wcomment]
lcdsignalstrength.ino: In function ‘void system_display_rssi()’:
lcdsignalstrength.ino:771:20: error: ‘Cellular’ was not declared in this scope
The same code compiles with no errors if the Target is an Electron.