Jump to content


Photo

merge requests for PLi's git


  • Please log in to reply
1748 replies to this topic

Re: merge requests for PLi's git #1681 Dimitrij

  • PLi® Core member
  • 10,327 posts

+350
Excellent

Posted 26 October 2023 - 05:43

ntp time -change logic


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: merge requests for PLi's git #1682 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 26 October 2023 - 10:25

Dimitrij,

 

The initial setting is mandatory here. So your merge request is as far I can see not good. There is no simple solution here in case the network is initializing slow so it enigma2 is ready to run before the network becomes on line.


Edited by littlesat, 26 October 2023 - 10:25.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #1683 Dimitrij

  • PLi® Core member
  • 10,327 posts

+350
Excellent

Posted 26 October 2023 - 10:26

<item level="1" text="Time synchronization method" description="Select how you want your receiver to keep the correct time, either from the DVB transponder, or from the internet using NTP. Or use Auto, which will favour using NTP, but will fall back to transponder time when no internet connection is available.">config.ntp.timesync</item>

 

Or use Auto, which will favour using NTP, but will fall back to transponder time when no internet connection is available.

NTP != Auto

You absolutely don’t understand what I want to correct, but 

WanWizard

understood everything correctly.
 


Edited by Dimitrij, 26 October 2023 - 10:30.

GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: merge requests for PLi's git #1684 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 26 October 2023 - 10:43

I'm afraid I also understand the problem.

 

But then still the only solution when you prefer to force ntp is wait that a network is running. This means also that you get into a dilemma when there is no network and/or the ntp server is not available enigma2 will not start (I'm afraid this happens in ViX right now).

With your suggestion you can still get dates within the 1970s....So my indication it does not resolve the issue.... 

And indeed when you select iptv it cannot synchronize with transponder time.

I did not resolve it yet in regards to slow coming-up networks because I could not find a good solution here.

As it is now when your network is down enigma2 can at least start through so you can still watch TV. And this is something I think is mandatory.....

 

My meaning when the internet is coming up slow, I suggest we should have an option to wait until it is up... So focus on the real issue that triggered it. But then with a kind of timeout (configurable or not configurable)... so when the network never comes up you still can fallback to the best option possible which is transponder time... even when ntp is selected.


Edited by littlesat, 26 October 2023 - 10:49.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #1685 Dimitrij

  • PLi® Core member
  • 10,327 posts

+350
Excellent

Posted 26 October 2023 - 12:14

 

dilemma when there is no network and/or the ntp server is not available enigma2 will not start

Why did you decide that Enigma does not start?


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: merge requests for PLi's git #1686 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 26 October 2023 - 12:45

I understood ViX is doing it right now... So the idea first wait for network and then start enigma2 has this dilemma..


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #1687 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 26 October 2023 - 13:04

I don't know why need to change the notifier, but I agree that if you set up ntp time synchronization, you should use it anyway.
The "auto" setting already prefers ntp and uses dvb as a fallback.
Why use the same logic if ntp is set?
I don't see a problem if the time on start therefore not be set correctly.
This is not the default setting. The user chooses this specifically to use only ntp, even if it is not working.


Re: merge requests for PLi's git #1688 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 26 October 2023 - 13:08

Of course, it would be good to introduce the possibility that enigma does not start while setting up the network in such a case.
But in any situation it should only be a some timeout, so that enigma can start after a while, if the network is not available.


Re: merge requests for PLi's git #1689 WanWizard

  • PLi® Core member
  • 70,528 posts

+1,811
Excellent

Posted 26 October 2023 - 14:13

@littlesat, @taapat,

 

Adding the check for 'auto" is correct. If you have chosen for "ntp", you want to use network time. And nothting else. Never.

 

The current code switches back to transponder time if no IP is available on startup, even if you have configured you don't want that ( by chosing ntp instead of auto ).

 

As to the code in StartEnigma:

 

the problem there is that it calls the function with a boolean value as argument ( old code still dating from the time it was "transpondertime yes / no" ), which needs to be replaced by a call using the correct configured value ( dvb / auto / ntp )

 

I personally don't see any reason why other changes need to be made: if the network is late, correct time is late, but Enigma will pick that up, for the same way it only picks time up after tuning a transponder if no ntp is configured. Enigma is designed for that, and not that bothered.

 

It might be an issue for oscam in case it is compiled with the infamous "clockfix", but that is unrelated to this discussion.


Edited by WanWizard, 26 October 2023 - 14:18.

Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: merge requests for PLi's git #1690 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 26 October 2023 - 14:18

Yes indeed all are right... but this does all not target the real underlaying problem....

 

"Network is coming up with significant delay'.

 

So actually when you select ntp here enigma2 should not be started, until the network is up and running.... And then you can get situation where the box does not boot through when there is no network as you can get the situation enigma2 never starts up. If we want that... fine!....

 

-or-

 

Use indeed Dimatrij's merge request but then we get 1970 as the user choose it, while there is no network As far I know it will resync as soon the network comes up, 

 

But then I still think that we do not need that secondary part in the merge request, where the initial config function is called. It has to set once in the enigma2 binary part if it need to know to take  transponder or ntp. In short I think this part of the change is not needed....

-config.misc.useTransponderTime.addNotifier(useTransponderTimeChanged)
+config.misc.useTransponderTime.addNotifier(useTransponderTimeChanged, initial_call=False)

Edited by littlesat, 26 October 2023 - 14:25.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #1691 WanWizard

  • PLi® Core member
  • 70,528 posts

+1,811
Excellent

Posted 26 October 2023 - 14:25

I don't understand what you're going on about, and you still miss the point.

 

In the current code, even if you have "ntp" configured, if the network is late, Enigma will permanently DISABLE ntp, and the will not get the time from ntp anymore, never (until you reboot). Adding the check for auto before checking got the availability of IP's fixes that.

 

Having a box start with 1970 and having it change to the correct time after a few seconds is not a problem. Everyone without NTP has that, as you have to wait until a transponder is tuned. And it is not a problem, Enigma was designed for this. So why suddenly make this a problem?

 

What is not correct in the PR is the change to startEnigma.

 

When the function is called from there, is uses a boolean argument hardcoded to False, while the function requires a string argument ( with value dvb, auto or ntp ). Instead of the hardcoded False, it should use whatever value is configured by the user.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: merge requests for PLi's git #1692 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 26 October 2023 - 14:34

regarding the config.misc.useTransponderTime.addNotifier(useTransponderTimeChanged)... maybe this is not required anymore at all and bit became obsoleted code....


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #1693 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 26 October 2023 - 14:38

I do understand it... auto and ntp actually are doing the same thing there is no real difference in between them. But it was prepared as a config.

 

But the real issue is still networks that are coming up too late that triggered something here and put the noise in....

 

Actually maybe now it is better to have to options... satellite (dvb) -or- ntp and do not use auto... (now ntp is actually the same as auto)

 

And then still when there is no network fallback to transponder.... and as soon the network comes up... switch back to ntp...


Edited by littlesat, 26 October 2023 - 14:39.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #1694 WanWizard

  • PLi® Core member
  • 70,528 posts

+1,811
Excellent

Posted 26 October 2023 - 14:50

I do understand it... auto and ntp actually are doing the same thing there is no real difference in between them. But it was prepared as a config.

 
Which means you don't.
 
AUTO means "use ntp, but fall back to transponder time if there is no network connection". NTP means "always use NTP. And nothing else.".
 
You don't seem to see it as the code does exactly what you think it should do. Unfortunately, you are wrong, and therefore so is the code.
 

IActually maybe now it is better to have to options... satellite (dvb) -or- ntp and do not use auto... (now ntp is actually the same as auto)\\

 

Eh, what?

You shouldn't remove an option because you wrote incorrect code, you should fix the code !


Edited by WanWizard, 26 October 2023 - 14:53.

Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: merge requests for PLi's git #1695 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 26 October 2023 - 15:06

regarding the config.misc.useTransponderTime.addNotifier(useTransponderTimeChanged)... maybe this is not required anymore at all and bit became obsoleted code....

 
As I understand it, it was never configurable.
It is here to set the time at the beginning of enigma start.
I don't know how it can work, because I think there is no tune on the transponder yet.
If you don't need to set the time so quickly, you need to remove this, and then the time will be set much later, on InitUsageConfig.

Edited by Taapat, 26 October 2023 - 15:06.


Re: merge requests for PLi's git #1696 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 26 October 2023 - 15:25

I'm afraid that was obsoleted code and can be completely removed there at enigmastart.py. All is done in usageconfig (which comes later as far I know).


As I understand it, it was never configurable.
It is here to set the time at the beginning of enigma start.
I don't know how it can work, because I think there is no tune on the transponder yet.
If you don't need to set the time so quickly, you need to remove this, and then the time will be set much later, on InitUsageConfig.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #1697 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 26 October 2023 - 15:34

Weird somehow when I type behind the quote my comments do not appear.

 

The code is indeed not doing what it should do as it is not complete yet. The missing thing is that when ntp was selected this should be detected outside enigma2 by waiting until the network comes online -or- add a mechanism to go back to ntp as soon the network comes online while enigma2 was running. That was designed in, but never implemented yet and somehow we do forget it.

It would be nice when we could trigger some code in enigma2 as soon the network becomes online.... so we can switch back to ntp for the timesync when this happens. But currently I have no idea how this can be done.

 

When we can find something that can switch back to ntp while enigma is running, then the 'auto' option is not needed anymore.

When we wait executing enigma 2 after the network becomes online when we select ntp than it can stay what it is currently.

 

Of course we need to check if the code in enigma2start something is indeed obsoleted code.... and if so simply remove it.

 

To check if the network becomes online the easiest way, but lazy way, to do this is 'polling'.... but I like more to find a trigger method... Exactly here the development/discussion stopped at that time. But the option was prepared in the config.... now leaving us with two options (auto and ntp) that are doing the same.... When you like ik can go for a 'polling' option with at eTimer when ntp is selected that checks e.g. each 30 minutes or so if the network becomes online and if so then switch back to ntp.

 


Eh, what?

You shouldn't remove an option because you wrote incorrect code, you should fix the code !

 


Edited by littlesat, 26 October 2023 - 15:39.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #1698 WanWizard

  • PLi® Core member
  • 70,528 posts

+1,811
Excellent

Posted 26 October 2023 - 15:44

No !

 

If you remove the code from startEnigma, the time retrieval mechanism to be used will never be configured, until you go into the setup and change the configuration !

 

It needs to stay there, it only needs to be called with the correct configElement, with the actually configured value, instead of the hardcoded boolean.

 

Is this so difficult to understand? Am I typing Chinese?

 

Why is everyone overthinking the issue, and creating a problem where no problem exists?


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: merge requests for PLi's git #1699 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 26 October 2023 - 16:56

The code can get out of the startenigma.... as it should became indeed obsoleted... It is now set in UsuageConfig.py

 

https://github.com/s...BTime&type=code

 

To get ntp only in a correct matter we need something extra... brainstorming suggestions:

 

1. a trigger that change it back to ntp when the network was not online

2. when the network is not online then transponder is selected as 'backup' and then poll for the network coming up and as soon it is coming up switch back to ntp.

3. When ntp is selected and the network is not on....do not start enigma2.

 

You see clearly in the code that the option ntp was intended to made... but was never really implemented. That is why I mentioned that actually this was some kind of work in progress... The merge commit suggested on the top of this page does also not resolve this.

                def timesyncChanged(configElement):
                                if configElement.value == "dvb" or not GetIPsFromNetworkInterfaces():
                                                eDVBLocalTimeHandler.getInstance().setUseDVBTime(True)
                                                eEPGCache.getInstance().timeUpdated()
                                                if os.path.isfile('/var/spool/cron/crontabs/root'):
                                                                Console().ePopen("sed -i '/ntpdate-sync/d' /var/spool/cron/crontabs/root;")
                                                if configElement.value == "dvb" and os.path.islink('/etc/network/if-up.d/ntpdate-sync'):
                                                                Console().ePopen("unlink /etc/network/if-up.d/ntpdate-sync")
                                else:
                                                eDVBLocalTimeHandler.getInstance().setUseDVBTime(False)
                                                eEPGCache.getInstance().timeUpdated()
                                                if not os.path.isfile('/var/spool/cron/crontabs/root') or not 'ntpdate-sync' in open('/var/spool/cron/crontabs/root').read():
                                                                Console().ePopen("echo '30 * * * *    /usr/bin/ntpdate-sync silent' >> /var/spool/cron/crontabs/root")
                                                if not os.path.islink('/etc/network/if-up.d/ntpdate-sync'):
                                                                Console().ePopen("ln -s /usr/bin/ntpdate-sync /etc/network/if-up.d/ntpdate-sync")
                config.ntp.timesync = ConfigSelection(default="auto", choices=[("auto", _("auto")), ("dvb", _("Transponder Time")), ("ntp", _("Internet (ntp)"))])
                config.ntp.timesync.addNotifier(timesyncChanged)
                config.ntp.server = ConfigText("pool.ntp.org", fixed_size=False)

Edited by littlesat, 26 October 2023 - 17:02.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #1700 WanWizard

  • PLi® Core member
  • 70,528 posts

+1,811
Excellent

Posted 26 October 2023 - 17:04

I'm, talking to a brick wall. I give up.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users