Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

sync GSM Client's TCP connection's time server with esp32's onboard clock #1

Closed
ejri opened this issue Mar 23, 2021 · 6 comments
Closed

Comments

@ejri
Copy link

ejri commented Mar 23, 2021

Is your feature request related to a problem? Please describe.
configTime is a part of ESP32 core and relies on ESP32's own WiFI to be connected for it to work. When connecting over a GSM module, WiFi connections are not necessary, but that means that ESP32 can't use UDP on WiFi to sync with NTP, since wifi is not connected. Deepsleep or other time related modes wont work without onboard clock.

Describe the solution you'd like
Connect GSM Client's TCP connection to get the time from a TCP source (like the NIST daytime server) and then set the onboard clock manually based on the time returned.

Describe alternatives you've considered
using RTC module, isn't ideal
NTP AT command for the sim7000, in some cases, it may not be supported

Additional context
vshymanskyy/TinyGSM#357
Azure/azure-iot-sdk-c#1914
https://forum.arduino.cc/index.php?topic=88389.0
https://simcom.ee/documents/SIM7000E/SIM7000%20Series_AT%20Command%20Manual_V1.03.pdf

@khoih-prog
Copy link
Owner

This library is not supporting SIM7xxx now, only these Supported u-blox modems

Moreover, did you try the GPRSUdpNtpClient if you're using ESP32 with u-blox modems?

@ejri
Copy link
Author

ejri commented Mar 23, 2021

Yeah, I saw the library and the sim7000 not being supported yet. Wanted to keep in mind to contribute or merge my workaround if I manage to work around it..

@khoih-prog
Copy link
Owner

Thanks. Your contribution is always welcome. Please post here if you have your working work-around.

@capedra
Copy link

capedra commented Nov 19, 2021

I got it working on SIM800C, so, it may not be very difficult to adapt it to SIM7000:
vshymanskyy/TinyGSM#357 (comment)

@khoih-prog
Copy link
Owner

Hi @capedra

Thanks for your solution which will help many other users.

Hi @ejri

Could you try and post the result. I'm sorry I can't help as I don't have any SIM7000 to test.

Good Luck,

@ejri
Copy link
Author

ejri commented Nov 19, 2021

It wasn't really a work around. I connected to the cellular network first, then pulled the NTP from from the internet.

This is a better example than what I have:

https://randomnerdtutorials.com/esp32-ntp-client-date-time-arduino-ide/

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

No branches or pull requests

3 participants