Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] eDRX and MQTT

Hi,

 

I have been experimenting with eDRX on a CAT M1 LTE modem that is connecting to a Mosquitto MQTT Broker. For those of you that are not familiar with eDRX, it’s a power saving feature available on newer low power, low data rate LTE modems. It allows the normal “check-in” time with the cellular network to be adjusted from around 1 second to several thousand. By increasing the time between check-ins, power is conserved. The tradeoff is that between check-ins, the device is not reachable.

 

My embedded test application is pretty simple, it connects to the broker, subscribes to a topic and then enters eDRX mode. The application doesn’t disconnect from the broker once it has initially connected. Periodically at the set eDRX interval, the device wakes up and checks for any MQTT messages. It will also wake up and send a KA if needed at the KA interval which is 3600 seconds.

 

On the other side, I have a simple PC based client that can post messages to the topic the embedded device is subscribed to. The test procedure is to wait for the device to enter eDRX and then post a message to be delivered to the device.

 

My initial testing went well up to the point I set the eDRX time to 1310 seconds. At that point, if I sent a message to the device while it wasn’t reachable, I noticed Mosquitto would report a socket error and disconnect around 1000 seconds. I thought maybe the OS was closing the socket for inactivity, but that timeout is 2 hours. So some error handling in Mosquitto must be timing out and giving up at 1000 seconds.  If I do not attempt to send a message to the device it stays connected with no socket errors and at the KA interval, I see a KA sequence between the broker and the device.

 

It's possible the way I am attempting to use eDRX with MQTT is flawed, but I don't see another way.

 

Thanks,

 

John


Back to the top