Socket poll in eDRX mode not generating events correctly

Good afternoon,

I am debugging the nRF9160 in a product, and what we are noticing is that the socket "poll" events do not appear to be generated when the system is in eDRX mode. 

Apologies that the software in this device is much older (NCS 1.8.0 and mfw_nrf9160_1.3.1), so it is likely missing many bug fixes, etc.

At a high level, the system keeps an AWS IoT connection established using periodic pings and uses eDRX to help save some power. When my application sleeps, it calls the poll function to wait on incoming data from the network in the event that the server has something to send asynchronously.

Currently, the eDRX settings are as follows:

  • eDRX: 5.120000s
  •  PTW: 1.28

I receive this message through the LTE_LC_EVT_EDRX_UPDATE callback, so this is what the network (T-Mobile) is setting as well.

The issue that I am seeing is that when eDRX is enabled, the poll(struct zsock_pollfd *fds, int nfds, int timeout) function does not seem to trigger an event when incoming data is received (i.e. an AWS shadow update). Instead, what I find is that data seems to sit on the socket (not generating a POLLIN event) and then when the system tries to read the socket later on for a ping or other actions, the old incoming data on the socket comes in first, and the communication sequencing gets out of whack as the bytes read are unexpected.

As a test, I disabled eDRX, waited for the RRC Idle event to occur, and then updated the AWS shadow to force data down to the unit. Almost immediately, I receive an RRC Connected event followed by a POLLIN event indicating that the socket received data, so it appears that the application poll logic is set up correctly. 

Is there something special that I need to be doing when using eDRX for the socket polling, or is there some bug that I am running into?

Thanks in advance.  

  • Hi Spencer,

    I recently see a similar usage is this ticket https://devzone.nordicsemi.com/f/nordic-q-a/112880/mqtt-connection-dropped-with-lte-m, the developer has no complain about polling, but he does not use such old NCS and MFW of course.

    I am not sure where we should start to debug this issue, is updating to latest NCS and MFW, then use more modernized MQTT helper library is an option for you? We even have a sample you can use directly with AWS AWS IoT (nordicsemi.com).

    If you still want to keep this combination, I would say it is possible the issue either from socket, eDRX or your application codes. I suggest you test with a simpler sample like UDP echo, to see how it beehive when you poll to receive a UDP packet.

    Best regards,

    Charlie

  • Hi Charlie,

    It looks like that link is not working for me (private ticket perhaps?), but I would be curious to see what is in the ticket.

    The ideal scenario for us would be to update the firmware to the latest to resolve other bugs, but at the moment it is not valid path for us in the short term. Since there is not a definitive "this is likely where the failure is because of this known bug" (I expected this to be the case with such an old firmware version), our current path forward is to disable eDRX in this version of software. The power impact based on the operating state we had was not significant since we are using the 5s eDRX mode, so this will provide a sufficient stopgap until we get around to the firmware roadmap updates later on

Related