Skip to content

Commit

Permalink
[StartEnigma] config.misc.SyncTimeUsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Huevos committed May 8, 2022
1 parent 34c764e commit c58a6ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/python/StartEnigma.py
Expand Up @@ -589,7 +589,7 @@ def runNextScreen(session, screensToRun, *result):
wptime = nowTime + 30 # so switch back on in 30 seconds
else:
wptime = startTime[0] - 240
if not config.misc.SyncTimeUsing.value == "0":
if not config.misc.SyncTimeUsing.value == "dvb":
print("[StartEnigma] dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)))
setRTCtime(nowTime)
print("[StartEnigma] set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)))
Expand All @@ -606,7 +606,7 @@ def runNextScreen(session, screensToRun, *result):
wptime = nowTime + 30 # so switch back on in 30 seconds
else:
wptime = startTime[0]
if not config.misc.SyncTimeUsing.value == "0":
if not config.misc.SyncTimeUsing.value == "dvb":
print("[StartEnigma] dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)))
setRTCtime(nowTime)
print("[StartEnigma] set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime + 60)))
Expand Down

4 comments on commit c58a6ce

@original-birdman
Copy link
Contributor

@original-birdman original-birdman commented on c58a6ce May 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this now the reverse of what is needed?

You can set two methods for SyncTimeUsing - NTP or Transponder
If you are using NTP then the ntpdate-sync script (which is what is used) will be updating the real time clock when it runs
But if you are using the transponder (I'm presuming is what "dvb" is above) then this doesn't happen, and this code is there so that it does get updated.

So the two checks should not be negated. and the comment reversed.

EDIT: Actually the hwclock isn't set by ntpdate-sync either (can be, but isn't).
Why not just set the RTC unconditionally?

@Huevos
Copy link
Contributor Author

@Huevos Huevos commented on c58a6ce May 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@original-birdman this just fixes something missed earlier here: 2ea8eb4

If there is problem with the logic it would have been around a long time.

@Huevos
Copy link
Contributor Author

@Huevos Huevos commented on c58a6ce May 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway RTC is set in NetworkTime.py on boot and thereafter every n minutes as corresponds to the user selected update interval (irrespective of dvb/ntp).

@Huevos
Copy link
Contributor Author

@Huevos Huevos commented on c58a6ce May 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@original-birdman best we continue this in the forum Dev section.

Please sign in to comment.