WAGO / pfc-firmware-sdk-G2

Firmware SDK for PFC200-G2 family
Mozilla Public License 2.0
13 stars 5 forks source link

ntpclient - timeout issue (init.d script) #10

Closed oxygen50 closed 1 year ago

oxygen50 commented 1 year ago

When performing the command:

/etc/init.d/ntpclient gettimeonce

same as in WBM pressing the button (WBN/Ports and Services/NTP Client): grafik

the following Error keeps appearing and no time update was done.

No functioning time server found

Solution on our side:

increasing the timeout limit from 0,5s to 1s in the file /etc/init.d/ntpclient

line 67

before:

    while [ $timeoutticks -lt $maxticks ]; do
        usleep 500000
        if [ ! -d /proc/$ntppid ]; then
            break;
        fi

after:

    while [ $timeoutticks -lt $maxticks ]; do
        usleep 1000000
        if [ ! -d /proc/$ntppid ]; then
            break;
        fi

After performing the change inside the init.d script the time gets updated successfully. grafik

The following config is used:

grafik

falk-werner commented 1 year ago

Hello @oxygen50,

thanks for the issue. It seems that our timeout is too low for your use case. Instead of changing the interval to check whether the ntp client is finished, we prefer to increase the number of retries by setting maxticks to 16 instead of 8. By doing so we are more responsive when ntp client finishes quickly.

Will this be sufficient for your use case?

oxygen50 commented 1 year ago

Hello @falk-werner,

thanks for the quick reply. I quickly testet you suggestion, which seems to also work.

Edited ntpclient grafik

Result: grafik

Feel free to implement 👍

falk-werner commented 1 year ago

The change will be implemented in FW26 (04.04.xx) since FW25 (04.03.xx) has already entered the testing stage and will be released soon.

oxygen50 commented 1 year ago

As the FW25 has been released today: Has this Issue been fixed in FW25 with WAT-35470?

falk-werner commented 1 year ago

Sorry, the issue is not fixed in FW25. The fix will be released in FW26 as described above. WAT-35470 is completely unrelated (not even the same product). Did you have the correct number?

oxygen50 commented 1 year ago

Hello @falk-werner

from the Release notes of the latest FW25 in section 1.1 System

grafik

falk-werner commented 1 year ago

This seems to be an error in the release notes. The number of the issue in the release notes is wrong. The correct number of the issue fixed in FW25 is WAT-35478 (8 instead of 0).

Unfortunately, WAT-35478 does not solve your issue. It solves an error that occurs when NTP servers are configured and one of them is not reachable.