I am developing a control terminal device using the BG96 module.
I have a question while developing the sleep mode function, so I inquired as follows.
This device maintains two mqtt/tcp connections using the bg96 module and provides service.
And in implementing the sleep mode of this device,
disconnect the mqtt connection of the BG96 module (maintain the tcp connection),
and command the sleep mode with “AT+QSCLK=1”.
At this time, the DTR pin is in a low/input floating state.
In this sleep state, if our own server sends a specific message to the bg96 module of this device, it is a function that wakes up the device by receiving an interrupt through the rx pin of the module.
This function usually works well, but it seems that the tcp message is not received after the sleep time of the bg96 module is maintained for more than 30 seconds. In other words, it seems that the tcp connection is automatically disconnected.
So, before the “AT+QSCLK=1” command, I tried to maintain the tcp connection with the “AT+QICFG=“tcp/keepalive”,1,120,25,10” command, but the result is still the same.
(Our board main chipset is STM32F405RGT6 and uses arduino based firmware.)
Configuration for basic communication connection is completed, mqtt and tcp communication is working well.
What Configuration you talking about?
The device is fixed somewhere right? because if the device in moving, that’'s will be cause Tracking area update.
And are you using CATM or NB netwokr?
I tried in myside with TCP messages, and it wakes up sleep mode as expected.
It is the result of testing in a fixed place
We use CAT.M1 network.
Rather than wakeup the BG96 with a tcp message, just give the RISING signal to the connected rx pin of our MCU.
Actually, in sleep state of BG96, when it receives a tcp message,
it sends a signal to our MCU and MCU wakes up the BG96 with this event. (the DTR pin HIGH, “AT+QSCLK=0”)
As mentioned above, as a common phenomenon, and when receiving a tcp message,
BG96 gives a rising signal to our MCU In less than 30 seconds after sleep,
but gives no signal after 30 seconds or more.
The basic principle of TCP KeepAlive is to send a probe packet to the opposite end of the connection at regular intervals. If an ACK is received from the other party, it is considered that the connection is still alive. After a certain number of retries, it still does not receive a response from the other party, and it is discarded. the TCP connection.
So this command is not mandatory, It’s OK to disable or enable.
And now need to check logs to find root cuase i think.
As the last command(AT+QSCLK=1) in the log, bg96 goes to sleep, and after 30 seconds, when the server sends a tcp message, there is no reaction.
Therefore, the contents of this situation are the situation after the log.
Please let me know what logs you need to figure out this issue
As it appears in the log, BG96 is connected as “TCP Listener” with “AT+QIOPEN” and “+QISTATE” commands, as Client.
And that’s right. bg96 get a tcp message, but that’s the case when bg96 went to sleep less than 30 seconds ago.
Is this issue related to bg96 connecting as client or server?
Should not relate as client or server.
And does this issue is easy to reproduce? sometime the network TAU will casue server or client miss message.
But better to provide Modem logs to check this if caused by network.