This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Socket error: POLLHUP, Connection was closed by the AWS IoT broker

Hi, 

I'm trying to periodically send sensor data to the AWS server and followed the documentation here to connect and send data to the server. I use these configurations - 

CONFIG_LTE_PSM_REQ_RPTAU="11000001" (320 hours)
CONFIG_LTE_PSM_REQ_RAT="00000001" (2 seconds)
CONFIG_MQTT_KEEPALIVE=1200 (20 min)
I have programmed the device to send data (QOS 0), poll the socket for 2 seconds and then sleeps for a specified interval of time (sleep_time). I see that if I have the sleep time anywhere between 1 to 328 seconds, the device works without any problem. If I increase the sleep time to say 358 seconds, the first message is sent properly but the second message receives a Socket error: POLLHUP, Connection was closed by the AWS IoT broker message. I've played with the CONFIG_MQTT_KEEPALIVE value but I cannot increase the data send interval above 328 seconds. Do you have any ideas how I could debug this? Thanks in advance!
Nikil
Parents
  • Hi Heidi,

    Thanks for the quick reply! I have tried decreasing it and increasing it but I have to send messages with an interval < 5 min in all cases to not get that error. According to the AWS documentation here (Under protocols->Connection inactivity (keep-alive interval)) it is mentioned that I can request a keep alive interval of 30-1200 seconds. I will try to take a modem trace and send it to you for analysis, thanks!

    In case I cannot increase the data send interval (we would like to send data every 30 minutes) is the only solution to ping the AWS server frequently (every 5 minutes) and send data every 30 minutes? That would mean unnecessary power consumption every time we send a ping message. Is there any way I could avoid that?

    Nikil

Reply
  • Hi Heidi,

    Thanks for the quick reply! I have tried decreasing it and increasing it but I have to send messages with an interval < 5 min in all cases to not get that error. According to the AWS documentation here (Under protocols->Connection inactivity (keep-alive interval)) it is mentioned that I can request a keep alive interval of 30-1200 seconds. I will try to take a modem trace and send it to you for analysis, thanks!

    In case I cannot increase the data send interval (we would like to send data every 30 minutes) is the only solution to ping the AWS server frequently (every 5 minutes) and send data every 30 minutes? That would mean unnecessary power consumption every time we send a ping message. Is there any way I could avoid that?

    Nikil

Children
No Data
Related