WakeOn RI in SLEEP_NETWORK_STANDBY?

Can this function be used on CHANGE vs RISING?

    CHANGE to trigger the interrupt whenever the pin changes value,
    RISING to trigger when the pin goes from low to high,
    FALLING for when the pin goes from high to low.

What I have now is:

System.sleep(BTN, FALLING, SLEEP_TIME_SECS, SLEEP_NETWORK_STANDBY);

Given this, would I change it to:

System.sleep({RI_UC, BTN}, CHANGE, SLEEP_TIME_SECS, SLEEP_NETWORK_STANDBY);

/r,
Kolbi

You can also provide a list of trigger edges just the same way as you provide list of pins like this

System.sleep({RI_UC, BTN}, {RISING, FALLING}, SLEEP_TIME_SECS, SLEEP_NETWORK_STANDBY);
1 Like

Awesome!

Thanks ScruffR!

Great thread!

I’ve implemented this on an electron e-series 2G/3G, but no matter what sleep timeout I choose the device wakes up after 2 hours of sleep. The device wakes up correctly if pinged via console.

System.sleep(RI_UC, RISING, 36000, SLEEP_NETWORK_STANDBY);

I’ve also tried to pass 0 seconds (sleep forever?) with same results.

I have WKP connected to an I/O line and I previously used SLEEP_DISABLE_WKP_PIN in different sleep modes to avoid unwanted wake-ups, but it seems this option is not available together with the RI_UC option.

Thanks
Simone

I tried the same procedure on a Electron 2g/3g global (SARA-U260) running deviceOS 1.0.1. The device still wakes up every 2hours. This is my code. Any idea @rickkas7 ? Thanks!

#include "Particle.h"

SerialLogHandler logHandler(LOG_LEVEL_TRACE);

const int SLEEP_PIN = D2;
void setup() {
	Serial.begin();
	pinMode(SLEEP_PIN, INPUT_PULLUP);
}

void loop() {
	if (digitalRead(SLEEP_PIN) == LOW) {
		Log.info("turning on AT+URING=1");
		// Enable wake on all URCs
		Cellular.command("AT+URING=2\r\n");
		delay(1000);
		System.sleep(RI_UC, RISING, 120, SLEEP_NETWORK_STANDBY);
		// This delay is to allow the serial monitor to reconnect only
		delay(2000);
		Log.info("woke from sleep mode");
		// Turn URING back to the default value (only notify on SMS or voice call)
		Cellular.command("AT+URING=0\r\n");
	}
}

FYI: Seems like UBLOX has revised the SARA-R410M-02B to include this functionality, as per their release note found here:

SARA-R410M-02B-00 does not ship with this functionality, but SARA-R410M-02B-01 does.

In theory, older modules can be firmware upgraded, but does Particle have a process to do this?