Hi,
Somehow the thread " https://www.dialog-semiconductor.com/support-posts/da16200-mqtt-dpm " was bricked.
So opening this new one.
"""PM_Dialog
Hi Premsai,
According to our Team internally, we need some extra info regarding that issue. Please check below.
1. dpm status
2. mqtt configuration
Can you please share that screenshots from your side?
Regards,
PM_Dialog"""
Reply:
Since i'm not allowed to share confidential information some of the info are masked.Please find the snapshots.
Prem Sai
Hi Prem Sai,
Thanks for sharing the requested info. I have already shared them with our Team internally.
PM_Dialog
Some more feedback...
DPMKA means "dpm keep alive" which is used to keep the connection with AP.
AT+DPMKA = 30, 30 means 30milliseconds.
DPMTIMWU means "dpm tim wake up" which is used to receive data from AP.
AT+DPMTIMWU=10, 10 means around 1second. DA16200 wakes up to check data from AP every 1second(10dtim).
So DPMKA should be longer than DPMTIMWU. 30000(30seconds) for DPMKA is no problem to reduce the current consumption.
AT+NWMQPING is used to keep the connection with broker. AT+NWMQPING=600 means DA16200 sends mqtt ping packet to mqtt-broker every 10mins.
To maintain the connection with AP, you need to use AT+DPMKA command and 30000(30sec) for AT+DPMKA is enough. According to your need, you can use 60000(60sec).
Regarding waking up every 10mins, if you want to reduce the current consumption, you can increase the ping interval with AT+NWMQPING.
Thanks for the detailed explanation, really appreciate the efforts.
"Regarding waking up every 10mins, if you want to reduce the current consumption, you can increase the ping interval with AT+NWMQPING."
I'll change the 600s to some higher value.
In my case i just want the interrupt only when any message is received and not every time the module pings the server.
And could you please tell the reason for the abnormal wake up.
Is there any work around for this?
DA16200 sends a packet every hour normally.
Regarding abnormal wakeup, DA16200 wakes up because of MQTT Disconnection - please check below :
In this case, DA16200 didn't receive response from AP.
--------------------------------------------------------------------------------------------------------------------
QUESTIONS
Q1 : Do you know if the host controls the power of DA16200 or not?
I can see 0x00, 0x04 and 0x82 as wakeup source.
0x00 : at+restart
0x04 : por reset
0x82 : wakeup by rtc timer.
Q2 : Are they using those wake up source?
If you are not using at+restart/por reset for DA16200, you can get the log as follow.
IMPORTANT NOTE :
Please describe your testing scenario, so that we can test it on our side.
Best regards,
Thanks for the response.
Test Scenario:
Initially we have used UART1_TXD(GPIOA4 of DA16200MOD DVK) as the wake up of HOST MCU since the HOST MCU was not able to detect the interrupt provided by GPIOA11 of DA16200MOD. At that time we observed the 1hr wakeup of HOST MCU since some data is transmitted via UART1_TXD. In the custom board we used GPIO 11 as the wake up source so now the HOST MCU wakes every 10 min.
Once the DA16200 MOD wakes HOST MCU, it RESETS the DA16200 MOD using RTC_PWR_KEY and sends the AT sequence(already shared) and HOST MCU does its operation and once the operations are complete it puts the DA16200 MOD again in DPM mode.
What we were expecting was that once DA16200 MOD receives message via MQTT only then it generates interrupt at GPIO11 but every time it pings the server (keep alive maybe) it generates interrupt.
Q1 : Do you know if the host controls the power of DA16200 or not? and Q2 : Are they using those wake up source?
Once the HOST MCU gets woken up from sleep mode it RESETS the DA16200 MOD using RTC_PWR_KEY and AT+DPM=0 is send.
"DA16200 sends a packet every hour normally." Could you please provide some info on this.
Thanks and Regard
Hi Prem sai,
Please find below answers to your questions :
Q1 & Q2 - Extra feedback:
---------------------------------------------------------------
As you know RTC_PWR_KEY is the port to control the power of DA16200. And from your log, wakeup source 0x4 means POR.
The DA16200 uses the GPIOA11 as a wake up source. DA16200 wakes up when it sends MQTT PING every 600 seconds. You can set it up as you wanted.
If you don't need it, you can set it as "0". However, you need to send it to keep the tcp connection. if you set 0 for MQPING, it will be disconnected.
If you don’t need to wakeup host, we can modify it.
Q3 – Prem Sai : "DA16200 sends a packet every hour normally." Could you please provide some info on this ?
DA16200 wakes up because the AP sends some kind of management packets.
We can see this message from your log. It means DA16200 received a management packet from host. We don’t know what it is, so need an air log to start further investigations.
The fermented packet is : "L2 Packet process completed"
Some extra questions from our side :
Q4 – PM : How frequently does host send MQTT data? Did host send MQTT data every an hour?
Q5 – PM : Eventually, could you please let us know what you are trying to accomplish?
Important note :
If the Host needs to wake up the DA16200 by GPIOA11, then you should assign another wake up pin.
Could you please share the schematic?
Thanks, PM_Dialog
Thanks for the feedback,
Q1 & Q2:
"If you don’t need to wakeup host, we can modify it."
In our case we dont need DA16200 to wake up HOST MCU via GPIO 11 every time it sends MQTT PING.
When DA16200 receives MQTT message from server only then it shall wakes up HOST MCU. It would really help if this can be done.
Q3 :
"It means DA16200 received a management packet from host." Does this means the server sends random data?
Q3 & Q4:
We are building a battery operated smart lock so once the user sends the message then only DA16200 module should wake up the HOST MCU. HOST MCU has various Task to execute once waken up(which consumes a lot of power).The HOST MCU doesn't send anything periodically.If it receives the message from user then only it acts accordingly and goes to sleep. IF the host MCU is waken up periodically unnecessarily then it would waste a lot of power and significantly reduces the battery life of the Lock.
------------------------------------------------------------------------------------------------------------------------------------------------
"If the Host needs to wake up the DA16200 by GPIOA11, then you should assign another wake up pin."
HOST MCU wakes up DA16200 using RTC_PWR_KEY only.
"Could you please share the schematic?"
Please find the attachment.
Thanks & Regards
Hi Prem Sai
With regards to Q1 & Q2, you can modify the system_start.c file as follow :
Please find attached a generated image file.
WIth regards to Q3, the L2 Packet is sent by AP not by theserver. If possible, please try to test with another AP. So, it depends on AP.
Please share provide an over the air capture so that we can check it.
Do you have any feedback or follow up questions on this thicket?
Thank you for the support PM_Dialog. Sorry for the late feedback.
I'll test "SDKV3.2.2.0_MQTTPING.zip" with the product and will update the feedback.
Thanks