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() fails to return the appropriate status upon success for SIM7000G #791

Open
cognoquest opened this issue May 23, 2024 · 0 comments

Comments

@cognoquest
Copy link

LiLYGOSIMCOM SIM7000G SIM7000G R1529
TinyGSM version: 0.11.7

I am using the AllFunctions.ino example code and implemented the following functions:
TINY_GSM_TEST_GPRS
TINY_GSM_TEST_NTP
TINY_GSM_TEST_TIME

Everything works well during the synchronization, the modem gets updated. The issue that I am having is with the function NTPServerSync returning the value 255 when the synchronization is successful.

For my modem the request network synchronization AT cmd returns more than just the value: 1. It appends to the value: ,"datetime", example of this: 1,"2024/05/23,17:44:42"

Note that I could not find this documented in the SIM7000 Series_AT Command Manual hence no surprise that it is not parsed properly in TinyGSM by the function TinyGsmIsValidNumber.

I recreated/modified the function: TinyGsmIsValidNumber from TinyGsmNTP.tpp with:

`...
if (str.length() >= 2 && str.substring(0, 2).equals("1,")) {return 1;}

if (!(str.charAt(0) == '+' || str.charAt(0) == '-' ||
isDigit(str.charAt(0))))
return false;
...`

By the way great library ... thks

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

1 participant