Do you guys clean up UDP/DTLS connections on the server after a time of no activity? If so what’s that magic value? I’m adjusting these guys:
But would be ideally modify it to as long as possible for a sleepy application.
Hey @jaredwolff! By default, we keep the connection open on the server for 1 hour. However, this is currently assuming the IP address and port of your devices are not changing during that duration. We are moving towards support for DTLS Connection ID’s, which would alleviate that concern.
Gotcha. What’s the best path then for longer duration check-ins? Stopping the golioth client and restarting when ready to publish?
@jaredwolff apologies for the delayed response here – I missed your follow-up message. Either using the interval config or stopping and re-starting the client would work. The analogous config in the Firmware SDK is
CONFIG_GOLIOTH_COAP_KEEPALIVE_INTERVAL_S which is set to
9 seconds by default (https://github.com/golioth/golioth-firmware-sdk/blob/0f9e20d0bf018c35d949a762670eaf0ca5c7054f/src/include/golioth_config.h#L40). This can be configured to send on a different interval or disabled by setting to
0. If you want to avoid performing a handshake when sending again the interval needs to be less than
60 minutes (
3600 seconds). Otherwise, the interval could be as long as you like, you will just need to pay the overhead of re-establishing the connection.
As an aside, we recently enabled Connection ID support on the server (Golioth Announces Connection ID Support), and we will be working on utilizing the functionality to also maintain longer lived connections that can be continued without requiring a handshake.
Nice thanks for the response. I figured those were the options so thanks for confirming!
@jonathanberi and I spoke a few weeks ago about device ID. Excited to give it a try. Plus the newer modem firmware on the nRF916x supports DID which is