ESPDateTime icon indicating copy to clipboard operation
ESPDateTime copied to clipboard

Can be run using LTE connection via SIM800L modem ?

Open clabnet opened this issue 3 years ago • 3 comments

Hi, running fine using WiFi transport, but connecting to internet via SIM800L using TinyGSM library it fail retrieving the time.

void setupDateTime() {
    DateTime.setTimeZone(TZ_Europe_Rome);
    DateTime.setServer("it.pool.ntp.org");
    DateTime.begin(15000);
    if (!DateTime.isTimeValid()) {
        Serial.println("Failed to get time from server.");
    } else {
        Serial.printf("Date Now is %s\r\n", DateTime.toISOString().c_str());
        Serial.printf("Timestamp is %ld\r\n", DateTime.now());
    }
}

And this is the log of my code :

Initializing modem
[7247] ### TinyGSM Version: 0.10.9
[7247] ### TinyGSM Compiled Module:  TinyGsmClientSIM800
[7559] ### Modem: SIMCOM SIM800L
         Modem Info: SIM800 R14.18
Waiting for network... success
Network connected
Connecting to APN ... TM
[29020] ### Network time zone updated.
[29024] ### Network time and time zone updated.
[29025] ### Daylight savings time state updated.
GPRS connected
IP: 10.193.141.85
IMEI: 8667820xxxxxxx
Operator: vodafone
Signal quality: 20

GPRS ready ✔
setTimeZone to CET-1CEST,M3.5.0,M10.5.0/3
setServer to it.pool.ntp.org,time.apple.com,time.windows.com
forceUpdate,timeZone:CET-1CEST,M3.5.0,M10.5.0/3, server:it.pool.ntp.org, timeOut:15000
Failed to get time from server.

Connecting to MQTT broker m23.cloudmqtt.com ...
        MQTT connected ✔
Server disconnected
GPRS disconnected ✔
Poweroff modem ✔
Stop run

clabnet avatar Dec 01 '21 10:12 clabnet

Any chance to solve ? Thank you in advance.

clabnet avatar Jan 03 '22 16:01 clabnet

I do not have any gsm modem, you can try to use another ntp server, or test your gprs tcp connection with ntp server

mcxiaoke avatar Jan 04 '22 06:01 mcxiaoke

I have a problem with WiFi also, works in the house, but in Dual Axis Solar Tracker 300' away, doesn't pickup WiFi. Is there another way? I'm using the library to update RTC (DS3232RTC) if differs by some setting (10 minutes).

Thanks for the great work on this library!

Tigeruno avatar Oct 19 '22 18:10 Tigeruno