Setting an NTP server

I know Emteria probably works like other Android versions and uses Google for time sync? Maybe even NTP?

Is there a way in Emteria to set this NTP server to a local one and not an Internet one?

Comments

  • Yes, Android has a built-in (S)NTP client with following properties:

    ntpServer: 2.android.pool.ntp.org
    ntpPollingInterval: 86400000 (once a day)

    Your system logs (Logcat) show errors (if any):

    SntpClient: request time failed: java.net.SocketTimeoutException: Receive timed out

    Otherwise you will receive a confirmation:

    SntpClient: round trip: 23ms, clock offset: 206575ms

    There is a way to set another server using ADB:

    adb shell settings put global ntp_server <new-ntp-server>

  • @kalkov said:

    There is a way to set another server using ADB:

    adb shell settings put global ntp_server <new-ntp-server>

    I tried this on ssh and it just aborts any idea why?

    1|rpi3:/ # settings put global ntp_server ntpserver.internal
    Aborted
    134|rpi3:/ # strace settings get
    execve("/system/bin/settings", ["settings", "get"], [/* 12 vars */]) = -1 ENOEXEC (Exec format error)
    clock_gettime(CLOCK_MONOTONIC, {3362, 44743143}) = 0
    write(2, "strace: exec: Exec format error\n", 32strace: exec: Exec format error
    ) = 32
    mprotect(0xb6f64000, 4096, PROT_READ|PROT_WRITE) = 0
    mprotect(0xb6f64000, 4096, PROT_READ) = 0
    mprotect(0xb6f64000, 4096, PROT_READ|PROT_WRITE) = 0
    mprotect(0xb6f64000, 4096, PROT_READ) = 0
    munmap(0xb6f64000, 4096) = 0
    exit_group(1) = ?
    +++ exited with 1 +++

  • edited August 2018

    Interestingly this does work over adb as you said. Just not as root over SSH.

    Thanks for your help on this

  • One thing. I don't seem to be able to set the polling interval. I have tried:

    adb shell settings put global ntp_polling_interval 14400

    adb shell settings put global ntp_pollinginterval 14400

    adb shell settings put global ntppollinginterval 14400

    But it sticks rigidly to syncing every 12 hours (as I can see from my NTP server). Does this setting work? Or does anyone know what the setting should be?

    Thanks

  • Sorry for the late response. It seems that there is no setting for the polling interval. The value is hardcoded in the resources.

Sign In or Register to comment.