Continuous Mode or Periodic Sync for Cellular Consumption

Hey y’all,

This is my first time adding cellular to a project. I am working on setting up an application that will send a message to the Notehub for our firmware to execute. We don’t know when that message will come through or in what frequency. Think of it like a button press by a user. It could happen once a day or once a month. We are connected to wall power but can’t assume reliable WiFi connectivity.

Looking through the documentation, I found that the continuous mode will set up a connection and continuously sync. But at what point is our internal worth doing periodic sync? 10 minutes? Once per hour? Since we don’t know when the event will happen we were aiming for a few minutes. Any input would be awesome!

Thank you.

Hi @lucas_stepwise, we are excited to have you on the forum!

Is the signal moving inbound (Notehub → Notecard) or outbound (Notecard → Notehub)?

If it’s outbound, that’s easy. You can leave in it periodic mode and add the "sync":true parameter to note.add. It will only use the resources necessary to send the data on demand.

If it’s inbound, that’s a little more tricky. If you want the message instantly, then you must be in continuous mode with the "sync":true parameter added to hub.set. sync will create an open socket to the Notehub, that will instantly inform the Notecard it has a message waiting on Notehub and should perform a sync. This is the fastest and most resource intensive option. If you are happy with a cadence (5 minutes), then you can use continuous or periodic with an inbound interval.

periodic vs. continuous - Determines whether or not you will need to turn on the modem and establish a connection to the tower or just leave it connected at all times.

sync - is the parameter that can be applied to lower latency.

I would suggest playing with the different combinations to get a feel for what behavior meets the need of your application, then maybe getting an ammeter and monitoring current consumption so you can tailor any final decisions to the resources you have available.

Best,
Zak

3 Likes

Thank you Zak!

So the signal will be primarily inbound (Notehub → Notecard) with an outbound ACK.

That makes sense. I guess from a data usage stand point, I’ve read that continuous can sometimes actually use less data since there’s a bit of overhead when establishing a connection. I’m mainly trying to minimize the data usage. Not entirely sure how to find out those two numbers (usage when continuous vs periodic).

I’ll play around with for a bit! Thank you again.

Hey @lucas_stepwise!

A couple of other things / ideas:

TJ

3 Likes