Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NTPServerSync() always returns error status 62 or 63 in SIM 7070G #778

Open
Amalbinishaq opened this issue Feb 9, 2024 · 1 comment
Open

Comments

@Amalbinishaq
Copy link

[X] I have read the Troubleshooting section of the ReadMe

What type of issues is this?

[ ] Request to support a new module

[ ] Bug or problem compiling the library
[X] Bug or issue with library functionality (ie, sending data over TCP/IP)
[X] Question or request for help

What are you working with?

Modem: SIM 7070G Ver R1951.04
Main processor board: ESP32-S3-WROOM-1U
TinyGSM version: 0.11.5

Code:
byte Status = gsm_modem.NTPServerSync("pool.ntp.org", 0);
Serial.print("Gsm NTP update status = ");
Serial.println(Status);

Hi I am using TinyGSM Library for a GSM based project, and I need to get UTC time for this project.
So I studied the AllFunctions.ino example code and implemented the following functions to get time via NTP
NTPServerSync()
getNetworkTime()

So I got Correct UTC Time using the function getNetworkTime(). But I have no way to add any error checks to this code because it says in the library that NTPServerSync() returns a status code. But it always returns status 62 or 63 which corresponds to "DNS resolution error" or "Connection error".
Even if the sync was successfull it returns 62 or 63

As per the documentations it should return status 1 when the sync is successfull
Thus I am unable to validate the ntp sync --> making errro handling almost impossible

Is this a general issue with SIM7070G module ?
Or is this an issue on the library ?
Or do I have to do any modification to my code ?

@cognoquest
Copy link

Hello @Amalbinishaq

For me it appears to be working(SIM7000G) except for a bug. [NTPServerSync() fails to return the appropriate status upon success for SIM7000G]#791

I am not convinced that you had a successful sync with return codes of 62 or 63?

  1. Code 62 is a DNS resolution error and that could be for multiple reasons i.e. firewall issue with your apn operator...? I believe the communication is done via UPD port 123
  2. Code 63 is Connection error so there is no GPRS communication to do your sync.

I tried the function with no GPRS connection and got: 61. I also tried with a domain name that does not exist and got 62. I also had success but had another issue.

To be noted that my modem time also gets updated upon connection via the GPRS and possibly the GPS (not via UPD port 123). For me the NTPServerSync is only useful for additional syncs or changes to the Timezone.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants