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

Enable Network Time Sync is not implemented for FONA 3G #114

Open
OscarVanL opened this issue Apr 3, 2020 · 3 comments · May be fixed by #115
Open

Enable Network Time Sync is not implemented for FONA 3G #114

OscarVanL opened this issue Apr 3, 2020 · 3 comments · May be fixed by #115

Comments

@OscarVanL
Copy link

Hi,

The Adafruit FONA library has a function enableNetworkTimeSync(), however, this does not work for the FONA 3G as the AT+CLTS command this uses is not used by FONA 3G.

This has been a source of frustration for me over the past days, as the module's documented GPS week rollover issue and inability to enable network time sync has left me without a usable date/time.

Fortunately, I've worked out what AT commands are required to enable this for FONA 3G. I've made a thread on the Adafruit Forums about this here.

I hope to make a pull request in the near future that adds support for this feature on the FONA 3G to Adafruit FONA. If I don't get around to it, feel free to do so for me :)

@OscarVanL
Copy link
Author

I've made the PR to implement Network Time Sync on the FONA 3G.

@Nathan-ma
Copy link

Great Oscar! can I ask you how can I use this?

What I'm expecting to receive is a NTP Number from the board, I've noticed your implementation enables the NTPSync, How can I receive the output from it? and how can I set the server?

Should I use it like in this example?

image

Thank you and
Sorry in advance for the bad english.

@OscarVanL
Copy link
Author

Hi Nathan, this is a little different.

There are three ways of getting the time on the FONA:

  1. From the GPS (Doesn't work anymore due to time rollover bug).
  2. From an NTP server (This is what you were referring to)
  3. From your Cellular Provider

My implementation does (3).
All you will need to do is run enableNetworkTimeSync(true) once, then this setting is saved permanently. FONA automatically gets the time from the network provider and sets its RTC from it.

Then to read the RTC use readRTC. Unfortunately, Adafruit did not finish the readRTC function, but a pull request exists that adds this functionality. #76

The great part about this is no NTP server needs to be configured. The downside is that not all network providers support this (though most will).

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

Successfully merging a pull request may close this issue.

2 participants