Hello,
I’m developing an application based on mqtts using eg916gl module. It works fine, but I get error 5 at OPEN command, when I use “ignorelocaltime” set to 0
Can you help me?
Hi ale,
Encountering error 5 during the AT+QMTOPEN command specifically indicates a network connection error.
-
As per your observation where this error occurs when you set “ignorelocaltime” to 0, it strongly suggests a failure in the SSL certificate validity check.
-
When ignorelocaltime is set to 0, the module is required to verify the server’s certificate against its own local real-time clock (RTC)
-
SSL certificates contain “Not Before” and “Not After” timestamps.
-
If the module’s local time is earlier than the “Not Before” time or later than the “Not After” time , the certificate is considered invalid, and the SSL handshake will fail with a network connection error.
To resolve this, you must ensure the module has the correct current time before attempting to open the MQTTS connection:
- Manual Time Setting: Use the command below to manually set the module’s clock to the current date and time.
AT+CCLK command
Example: AT+CCLK=“24/05/20,10:00:00+08” (sets the time to 20 May 2024, 10:00:00).
- Network Time Synchronization (NITZ): Enable automatic time zone and time updates from the cellular network using:
AT+CTZU=1
Note that this command takes effect after a reboot and depends on network support.
- NTP Synchronization: Use the command below to synchronize the module’s local time with an external NTP server.
AT+QNTP
Example: AT+QNTP=1,“pool.ntp.org”,123,1 (synchronizes context 1 with the specified server and automatically sets the local time).
- Query Network Time: You can also manually trigger a query for the latest network-synchronized time using:
AT+QLTS
Thank you and have a nice day!
Thank you so much AmarRaaj,
but I already use command AT+CTZU=1
So, when I retrieve module date/time with AT+CCLK, I can observe a correct internal date/time for the module. And more, I use module date/time to create “time from epoch” to emebed into payload, and it works fine. So, what do you suggest? Is the issue related to server certificate? Or in client/key certificate?
Hello AmarRaaj,
I’m sure validity of server and client certificate is ok. Are you sure this fetaure in module EG916Q-GL is ok?
Is it possible to know if there is an issue about this feature on EG916Q-gl?