Hi, I’m using a sonar sensor which measures every second and should send the average of a minute. The measurement therefore requires 60 seconds. How does this “slow” sensor interact with the send interval of the LoRaWAN library? Is it possible to send data whenever (every 60 seconds) the sensor is done instead of defining the interval? Or is there a better implementation possible running both in parallel?
Your idea is great, and it can be realized. you can refer this code: https://github.com/HelTecAutomation/ASR650x-Arduino/tree/master/libraries/LoRa/examples/LoRaWAN/LoRaWan_interrupt
this is lorawan_interrupt. He first runs it once in accordance with the normal lorawan code (complete Lorawan network access process). After that, Lora will temporarily stop working. The interrupt source here is to press the USER key and then release the USER key. When the interrupt is triggered, the node will send your data to the gateway. In other words, you need to modify the interrupt source in the original code to the interrupt source you want(For example, it can be modified to trigger an interrupt after the one-minute test is completed).