I am testing mqtt client and have some question.
1. How to get date time?
Using default code, i can connect to aws iot core. So it seems already get the date time from network.
How do i get it? I try Cy_RTC_GetDateAndTime() but i get 1970/1/1.
2. Keepalive failed after calling cyhal_system_deepsleep.
To save more power, i add a task checking a bool value(true after mqtt connect).
But after calling cyhal_system_deepsleep, mcu seems won't wakeup to send keepalive package.
How do i that mcu deepsleep and still sending keepalive package.
Can you share your code with me so that I can reproduce this issue on my side or provide us with the steps to reproduce it?
This is the code come from my cypress agent.
As agent said, this code will listen to ap every second. (saving 43012 power)
I only add code in mqtt_subscription_callback to show the date.
If i remove the line 385 in publisher_task.c, it won't lost connection between server.
The thing i am trying to do is:
1. 43012 listen to ap every one second. (saving 43012 power)
2. mcu go to deepsleep (saving mcu power)
3. it shouldn't lost connection
There is a object file without source file.
It is fine if you have your own solution could achieve the same purpose.