LMIC-node Scheduling uplink

In the example “LMIC-node” a user can schedule uplink messages to be sent in intervals. I know that this can be changed in the platformio.ini file. I have device that is sending the devices battery percentage every 10 minutes, however I would like to know if it is possible to send an uplink message outside of the scheduled interval? I have a geophone attached and would like a single uplink message to be sent when the geophone reading spikes past a certain threshold. Is this possible with the “LMIC-node” example?

Either put a check in the loop() function, best with some duration constraints so it’s not doing it every few microseconds as the loop runs, or duplicate the doWorkJob variable and the doWorkCallback and processWork functions. You can then set an appropriate interval and in the new processWork check the geophone and if it has spiked, build the payload and call scheduleUplink.

So the code is all there for your to copy.

If the geophone has an output signal to tell you it has spiked, it would be better to implement an interrupt.

Thank you so much, that worked perfectly.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.