Keep Alive Timer Only Runs Once
todddust opened this issue · 11 comments
I've modified this example to enable the keepAlive timer. I set the keepAlive to 30
connect_info.keepAliveSeconds = 30;
I've also increased the publish period to 60 seconds:
if (wait_sem.try_acquire_for(60000))
With this setup a ping should be sent in between each publish to satisfy the KeepAlive timing.
Watching on Wireshark I see the subscribe message go across. After that I don't see anything. Then 45 seconds later the server sends an Encryption Alert and closes the connection.
The client in this case should have sent a PING to the server after 30 seconds of inactivity, but I never see it getting sent.
Debugging the code a little I found that the KeepAlive Timer is implemented in the following file: mbed-aws-client\mbed\src\iot_clock.cpp.
I've put debug prints in thread_routine() and in IotClock_TimerArm. I've found the first time IotClock_TimerArm runs thread_routine() also runs and exits appropriately. However, the second call to IotClock_TimerArm doesn't cause thread_routine() to run, even though I can tell the code is getting to the thread.start call (via printfs).
Not sure what is going wrong here, any help is appreciated.
@todddust thank you for raising this issue.Please take a look at the following comments:
Could you add some more detail to the description? A good description should be at least 25 words.
What target(s) are you using?
What toolchain(s) are you using?
What version of Mbed OS are you using (tag or sha)?
It would help if you could also specify the versions of any tools you are using?
How can we reproduce your issue?
NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'.This indicates to us that at least all the fields have been considered.
Please update the issue header with the missing information, the issue will not be mirroredto our internal defect tracking system or investigated until this has been fully resolved.
@todddust it has been 5 days since the last reminder. Could you please update the issue header as previously requested?
This is related to: ARMmbed/mbed-client-for-aws#12. So if you use the latest code from that library the problem goes away. Thus I recommend updating the .lib file for that library.
@todddust it has been 5 days since the last reminder. Could you please update the issue header as previously requested?
@todddust it has been 5 days since the last reminder. Could you please update the issue header as previously requested?
@todddust it has been 5 days since the last reminder. Could you please update the issue header as previously requested?
@todddust it has been 5 days since the last reminder. Could you please update the issue header as previously requested?
@todddust it has been 5 days since the last reminder. Could you please update the issue header as previously requested?
@todddust it has been 5 days since the last reminder. Could you please update the issue header as previously requested?