Syncronizing timmig of event upload

Hey,

I’m using a Notecard Cellular 2.2 with a Notecarrier F v1.3 and an Adafruit Feather ESP32, together with a sensor. I’m currently having some issues with the timing of when messages are sent.

System behaviour

The sensor performs measurements throughout the hour. During the last 10 minutes of each hour, it groups the collected data, packs it into a message, and sends it.

Initial setup (working correctly)

Initially I was running the Notecard in continuous mode with:

JAddBoolToObject(req, "sync", true);

With this configuration everything worked as expected.

Change to periodic mode

To save battery (the system will eventually run on battery power), I switched to periodic mode and configured the following:

JAddStringToObject(req, "voutbound", "usb:6;high:60;normal:120;low:180;dead:0");
JAddStringToObject(req, "vinbound", "usb:1140;high:1440;normal:1440;low:1440;dead:0");

At the same time I removed:

JAddBoolToObject(req, "sync", true);

Issue

Since making this change, I’ve started noticing a timing displacement. Sometimes the message arrives almost 20 minutes later than expected (as shown in the image below).

Captura de ecrã 2026-03-13 122030

Ideally I would like the sync to happen much closer to the moment when the data was captured. Like, I know that around minute 51 of every hour the message should be available to retrieve.

Additional observation

Another thing I’ve noticed is that the sync time drifts by about 30 seconds every hour. Instead of syncing exactly every 60 minutes, it happens roughly every 60 minutes and 30 seconds.

Questions

Is this behaviour expected when using periodic mode?
And is there a recommended way to keep the sync closer to the moment the data was captured, without going back to continuous mode?

Thank you for your time! Have a nice day

Hi @Leugim,

When you remove "sync":true from your note.add requests, the Notecard will queue your outbound Note and send it on the next outbound sync opportunity instead of immediately.

Ideally I would like the sync to happen much closer to the moment when the data was captured.

If so, then periodic mode is not for you, as periodic puts the syncing behavior in the hands of the Notecard and is not based on if/when data is queued.

Another thing I’ve noticed is that the sync time drifts by about 30 seconds every hour. Instead of syncing exactly every 60 minutes, it happens roughly every 60 minutes and 30 seconds.

The outbound sync timer starts when the previous sync ends, not when it begins. You can add "align":true to your hub.set request to get better alignment between syncs.

And is there a recommended way to keep the sync closer to the moment the data was captured, without going back to continuous mode?

You can use minimum mode instead, which will tells Notecard not to sync until it receives an explicit hub.sync request and NEVER periodically sync with Notehub.

Thanks,
Rob

1 Like

Hello, Rob,

Thank you for your reply! There are two points I would like to clarify.

  1. Is there any way to influence or restart the sync timer? I do not need the data to be sent immediately, but I would prefer it to be transmitted reasonably close to when it is queued.

  2. Regarding battery usage, is there a significant difference between using minimum mode with hub.sync requests every hour, and using periodic mode with a 60 minute outbound interval?

Hi @Leugim,

  1. Not really. The "align":true argument that you can use in your hub.set request will align roughly with the boot time of the Notecard, but that isn’t nearly precise enough to use in practice. It sounds like what you want to accomplish would require timing to be managed by your firmware and not Notecard.
  2. Yes, because manually issuing a plain hub.sync request will sync with Notehub regardless of whether or not you have outbound data to send (because Notecard will also check if there are any inbound Notes/environment variables from Notehub to sync). When you use periodic mode with the inbound and outbound arguments, Notecard won’t perform an outbound sync if there is nothing queued to send, saving you battery life.

Rob

1 Like

Thank you once again!

1 Like