Cerbo GX: How to set/enable NTP server with static IP?

About one month ago my Cerbo GX (fw 3.66) was prepared for the initial installation on a temporary DHCP network. Time was set automatically, timezone was set, everything was good! Then I moved it to the permanent location and entered a static IP address for the Victron network.

One month later… the local time on my Cerbo is off by about 90 seconds. Running tcpdump on my network router for a while I see zero NTP packets coming from the Cerbo, so it’s not even trying to do anything with NTP. Checking that over root/SSH console:

root@einstein:~# connmanctl clock
  Time = 1762769358
  TimeUpdates = auto
  Timezone = (null)/Universal
  TimezoneUpdates = auto
  Timeservers = [  ]

… confirms my suspicion: there is no NTP server set. Well, where do I configure NTP now?

I really would like to avoid using DHCP on this small separate Victron-network. The Cerbo settings screens don’t show any field to enter this:

Please tell me I’m missing something or that there’s a hidden entry somewhere to configure NTP without DHCP and without modifying root filesystem.

N.B.:

  • Although I cannot set NTP in the EVCS, it does sync the time on that one just fine with a random NTP server on the internet in case of a static IP network and also reports a successful timesync with “source: SNTP”. Ideally I would like to set a manual NTP server there, but at least it’s syncing with some server. The problem is just the Cerbo GX, on the same network/LAN, which does not do anything, it seems.
  • I have seen the related topic ( Cerbo - Time is incorrect -- Time Sync NOT working ), but that’s a different cause I believe - I don’t know where to set NTP to begin with.

Did you use wifi and Ethernet together?

I had also a time issue with wifi > internet and ethernet > gridmeter

Did you use wifi and Ethernet together?

No, I’m not using WiFi, it’s disabled. There’s only one IP connection to the Cerbo which is this Ethernet/LAN network designated for Victron equipment (Cerbo GX, EVCS, 2x energy meter).

Meanwhile I have found this CLI command to set timeservers. It does not work, it seems as Timeservers = [ ] remains empty.

root@einstein:~# connmanctl config ethernet_MYMACMASKED_cable --timeservers ntp1.home.i6t.nl ntp2.home.i6t.nl ntp3.home.i6t.nl
root@einstein:~# connmanctl clock
  Time = 1762776996
  TimeUpdates = auto
  Timezone = (null)/Universal
  TimezoneUpdates = auto
  Timeservers = [  ]

Should I restart some service for it to recognize this new setting?

Update: ah, it seems to silently discard hostnames in the command, returning success, but you have to use static IP addresses.

root@einstein:~# connmanctl config ethernet_MYMACMASKED_cable --timeservers 10.64.0.1 10.64.0.2 10.64.0.3

Timeservers = [ ] remains empty, BUT it started to send NTP packets to the first timeserver specified, my NTP server replied and the time was set. FINALLY my Cerbo has a correct time!

I hope you understand I am very much disappointed in this configuration experience. I hope this will improve in the future. Please, Victron, this makes me facepalm right now.

Oh god, now this popped up, only for setting NTP servers, REALLY?! :tired_face:

I have the same problem. A reboot fixes the time once. This has been costing me real money with charging drifting into the expensive periods.

Timeservers = [ ] remains empty, BUT it started to send NTP packets to the first timeserver specified, my NTP server replied and the time was set. FINALLY my Cerbo has a correct time!

How did you do this bit? ie see the packets?

How did you do this bit? ie see the packets?

I use a plain Linux machine as my router where all traffic passes. There I run tcpdump on the Victron’s interface and I can see everything crossing the boundaries of the LAN. (If I wanted to, I could go deeper I can even run a port-mirror on the ethernet switch.)

The actual tcpdump command that I run on my router:

$ tcpdump -i victron -n -v 'host 10.50.6.10 and udp port 123'

(where victron is my interface name for the Victron VLAN and 10.50.6.10 is the Cerbo IP.

It only attempts to synchronize a few times per day here, so the output is pretty quiet.

I would have loved to see a proper ntpd running on the Cerbo rather than a periodic short NTP call.

Ah, thanks. I shall check that out on mine. I’ve been tearing my hair out as this has happened before. DNS works, DHCP set up for NTP. I’ll see if I can see NTP calls on my unify.

Ok, here are the steps I took to get it working.

  1. opkg wasn’t working. An install of the latest firmware fixed that.

  2. Run the following commands from the terminal after ssh in.

    opkg update
    
    opkg install ntp
    
    opting install ntpq
    
    
    

run this. minpoll 12 maxpoll 12 changes polling to once per hour. That has stopped the continuous polling.

cat > /etc/ntp.conf <<EOF

# Use standard pool

pool pool.ntp.org iburst minpoll 12 maxpoll 12

pool 0.europe.pool.ntp.org iburst minpoll 12 maxpoll 12

pool 1.europe.pool.ntp.org iburst minpoll 12 maxpoll 12



# Local clock fallback, but very low preference

server 127.127.1.0

fudge 127.127.1.0 stratum 14

driftfile /var/lib/ntp/ntp.drift

EOF


killall ntpd

ntpd -gq
ntpq -p
ntpq -p

This should show something similar to

remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================

pool.ntp.org    .POOL.          16 p    -   64    0    0.000   +0.000   0.001

0.europe.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.001

1.europe.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.001

LOCAL(0)        .LOCL.          14 l    1   64    1    0.000   +0.000   0.001

178-79-150-226. 82.68.30.35      3 u    1   64    1   45.550  -372.55   0.001


Before running these, all I could see was

LOCAL(0) .LOCL. 14 l 1 64 1 0.000 +0.000 0.001

I’ll have to wait a while to see if it drifts now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.