My payload is variable length and DR is adaptive. I would like to adapt my sending interval so that meets legal or fair use limits. Using the Arduino BSP RAK4631 is it possible to get the airtime used after each send? It not, does the RUI version and BSP allow this?
I guess i could make an air calculator function, but using ADR i dont know what DR i sent at. There doesnt seem to be a lmh_datarate_get function to match the lmh_datarate_set in LoRaMacHelper, that would allow knowing my DR at send time.
I am not sure if that is possible. Maybe @beegee has ideas. If optimizing for duty cycle compliance is needed and variable payload length is expected, it is easier if you have control on DR and create a lookup table based on your payload length. Quick shortcut is just assume the worst case (max) payload load length.
As for DR management, ADR is just a built-in implementation in LoRaWAN standard but custom approach to this is possible as well. Example custom approach is Blind ADR which is proposed by Semtech itself.
There is “theoretical” a function in the open source LoRa library: Radio.TimeOnAir(RadioModems_t modem, uint8_t pktLen);
But I never tried it. It “should” calculate the expected air time before sending a packet. It is used inside the LoRaMAC stack, but there is no specific function to read back the air time.