- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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.
- Labels:
-
ModusToolbox AnyCloud SDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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?
Thanks
Aditi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Aditi,
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
So, in summary there are 2 issues-
1. As soon as the packet is received via subscription callback, you try to print the date and time which gets printed incorrect.
2. After the subscribe package is received, the MQTT disconnection happens and this disconnection happens before the keep alive sendout, right?
Thanks
Aditi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi aditi,
Sorry for forget to updata information.
1. I still can't get correct date by using Cy_RTC_GetDateAndTime() after connect to aws iot core. So before connect to it, i get network time by asking NTP server and set to RTC.
2. Using cyhal_system_deepsleep() is a bad idea. After including LPA library and setting deepsleep in FreeRTOS, power consumption drops.