Using Lwm2m (DTLS PSK) and a custom service (COAPS [DTLS PSK]) at the same time

Hi,

OS: nrf-sdk v2.6.1

Hardware: NRF52840 custom board

Network: OpenThread

Setup

Our device uses LwM2M [queue mode] (DTLS - PSK) for device control and monitoring remotely, using port 5684.

We are also developing a local interface using COAPS (DTLS - PSK) for controlling devices on the local network, using port 5688.

Both interfaces use the same network interface which is implemented using OpenThread.

Both interfaces work well when not used together; however we want both interfaces to be accessible at the same time.

Implementation

The LwM2M stack is provided by nrf-sdk / zephyr.

The "local interface" uses OpenThread's COAPS functions, which is effectively a copy paste of the CLI functions: (https://openthread.io/reference/cli/concepts/coaps).

Problem

When the device performs an LwM2M registration or update, it keeps the socket open for "CONFIG_LWM2M_QUEUE_MODE_UPTIME" seconds. During this time it is not possible to communicate with the device via the "local interface".

Once LwM2M closes its socket, the device can then be accessed via the local interface.

Question

Taking that both the LwM2M stack and our "local interface" stack use different ports. Why is it not possible to connect to the device when one already has an open connection?

Is it because the LwM2M stack and Openthread use the same MBEDTLS functions? If so, is there a way around this?

Cheers,

Sam

Parents Reply Children
No Data
Related