My device/application (Notecard-F + ESP32 Feather + temp sensors, etc.) is using the Sleepy Sensor application ( Arduino Low power (with deep sleep) sample code for Notecard with the Sleep time, PERIOD_S set to 1800 sec (30 min). The full code of the Sleepy Sensor app is here: https://github.com/blues/notecard-pseudo-sensor/blob/master/examples/SleepySensor/SleepySensor.ino
The application wakes up/ powers on the ESP32 every 30 minutes, then the ESP32 reboots, sends the sensor data and goes back to sleep. The NoteCarrier ATTN pin is connected to NoteCarrier F_EN pin (which is connected to the power EN pin on the ESP32 Feather)
{
// Create a “command” instead of a “request”, because the host
// MCU is going to power down and cannot receive a response.
J * req = NoteNewCommand(“card.attn”);
JAddStringToObject(req, “mode”, “sleep”);
JAddNumberToObject(req, “seconds”, PERIOD_S);
notecard.sendRequest(req);
}
In addition, my Arduino sketch has the following settings from Sleepy Sensor app, which are also mentioned in the Low Power guide (Low Power Design - Blues Developers).
{
“req”: “hub.set”,
“mode”: “periodic”,
“voutbound”: “usb:30;high:60;normal:90;low:120;dead:0”,
“vinbound”: “usb:60;high:120;normal:240;low:480;dead:0”
}
I rebooted the system at 11:32 today. The system rebooted and send the sensor data every 30 minutes as expected until the 2:03pm data was sent. Then it did not send data again until 5:29. It continued to send data at 5:59 and again at 6:29 and now has stopped for over an hour.
I suspect it has something to do with the voutbound and vinbound settings that I don’t really understand. Can someone please explain them?
For my particular application it seems like I don’t care about scheduling outbound sync. It happens every 30 minutes when Notehub send a card.attn signal to the Notecard, the system reboots, sends data and goes back to sleep.
As far as inbound sync, my app doesn’t ever need it, but I gather it is good to have for firmware updates and maybe something else I don’t yet understand.
In the Event Log from that time period, between the successful sensor data upload at 2:03 and the next data upload at 5:29 there are some messages about inbound and outbound sync being due that I don’t understand. Here are some sample entries.
Sun 03:34:55 PM Sun 03:34:57 PM Ann Arbor MI dev:867730051228983 _session.qo {“why”:“periodic inbound sync due”}
Sun 02:29:56 PM Sun 02:29:58 PM Ann Arbor MI dev:867730051228983 _session.qo {“why”:“periodic outbound sync due”}
Here is the full Event Log during that time period from reboot at 11:30am until 7:30pm.