Jump to content


Photo

Clock error in deep standby mode?


  • Please log in to reply
43 replies to this topic

Re: Clock error in deep standby mode? #21 Rob van der Does

  • Senior Member
  • 7,766 posts

+184
Excellent

Posted 11 June 2015 - 06:09

The option isn't there (ET8k on today's PLi).



Re: Clock error in deep standby mode? #22 Dimitrij

  • PLi® Core member
  • 10,297 posts

+347
Excellent

Posted 11 June 2015 - 06:49

The option isn't there (ET8k on today's PLi).

Of course :) !

Need vu+ or formuler for test.


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


Re: Clock error in deep standby mode? #23 Rob van der Does

  • Senior Member
  • 7,766 posts

+184
Excellent

Posted 12 June 2015 - 13:36

Indeed working fine (tested on Ultimo)!

Surprising and nice option.

I wonder why this (= RTC) isn't enabled by default?



Re: Clock error in deep standby mode? #24 antonioabb

  • Member
  • 6 posts

0
Neutral

Posted 13 June 2015 - 11:52

Sorry decoder is cloud ibox 3 mini

Re: Clock error in deep standby mode? #25 WanWizard

  • PLi® Core member
  • 70,381 posts

+1,807
Excellent

Posted 13 June 2015 - 11:53

That's a clone box, there is no OpenPLi for that box.


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: Clock error in deep standby mode? #26 mrvica

  • Senior Member
  • 1,259 posts

+86
Good

Posted 22 May 2016 - 16:49

Sorry decoder is cloud ibox 3 mini

I´ve got this box too (among others), it is a copy of miracle box mini (or opposite way), it has just 4 way 7 segment display, not alphanummeric (VFD), it is good for clock in deep stand by, I know the box is not supported by OpenPLi, but could be in the future, OpenATV shows the correct time in deep stand by, I was doing some research, probably depends on /usr/lib/enigma2/python/Tools/StbHardware.py

I´ve found this function in OpenATV which is missing in OpenPLi

def setRTCoffset():
	import time
	if time.localtime().tm_isdst == 0:
		forsleep = 7200+time.timezone
	else:
		forsleep = 3600-time.timezone

	t_local = time.localtime(int(time.time()))

	print "set RTC to %s (rtc_offset = %s sec.)" % (time.strftime("%Y/%m/%d %H:%M", t_local), forsleep)

	# Set RTC OFFSET (diff. between UTC and Local Time)
	try:
		open("/proc/stb/fp/rtc_offset", "w").write(str(forsleep))
	except IOError:
		print "set RTC Offset failed!"

the box is in deep stand by 2 hours behind during daylight save time, one hour during normal time (it just takes GMT), i think this peace of code does correct this

/proc/stb/fp/rtc_offset is present in OpenPLi, it is always 0

just exchanging StbHardware.py woun´t help, because some variables are missing

I just checked latest

https://github.com/o.../StbHardware.py

and see it has been solved different way, I have an older StbHardware.py from OpenATV

def setRTCoffset(): 
41 	forsleep = (localtime(time()).tm_hour-gmtime(time()).tm_hour)*3600 
42 	print "[RTC] set RTC offset to %s sec." % (forsleep) 
43 	try: 
44 		open("/proc/stb/fp/rtc_offset", "w").write(str(forsleep)) 
45 	except IOError: 
46 		print "setRTCoffset failed!" 

could someone have a look on it, my knowledge ends here, could be interesting for other boxes that are supported by OpenPLi, too



Re: Clock error in deep standby mode? #27 WanWizard

  • PLi® Core member
  • 70,381 posts

+1,807
Excellent

Posted 22 May 2016 - 21:48

What a horrible hack. I wonder what the rationale behind this all is.

 

An RTC should run in UTC, always, and if that is the case, no offset is needed, UTC can always be converted to local time using the correct timezone information.

 

More research is needed to figure out what the root problem here is.


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: Clock error in deep standby mode? #28 WanWizard

  • PLi® Core member
  • 70,381 posts

+1,807
Excellent

Posted 22 May 2016 - 21:57

p.s. did you follow Dimitrij's suggestion?


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: Clock error in deep standby mode? #29 mrvica

  • Senior Member
  • 1,259 posts

+86
Good

Posted 23 May 2016 - 00:10

p.s. did you follow Dimitrij's suggestion?

yes, I tried system time 1.2, 1.4, I checked "Use RTC time from deep standby", the same, OSD time and standby time OK, deep standby time not ok

I tried this in /usr/bin/enigma2.sh

# enigma2 exit codes:
#
# 1 - halt
# 2 - reboot
# 3 - restart enigma
#
# >128 signal

ret=$?
case $ret in
        1)
		date -D %s -d $(($(date +%s) + 7200))
		/sbin/halt
                ;;
        2)
                /sbin/reboot
                ;;
        3)
                ;;

it didn´t help too



Re: Clock error in deep standby mode? #30 littlesat

  • PLi® Core member
  • 57,117 posts

+698
Excellent

Posted 23 May 2016 - 07:12

I'm afraid to show the time in deepstandby with a rtc the rtc cannot be on zulo time... But when you look good to the patch you see they programmed a offset... So on another location openatv should have something that also should set/program that rtc...

Please help us to point us to the complete picture so I can try to make a good patch of it..

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


Re: Clock error in deep standby mode? #31 WanWizard

  • PLi® Core member
  • 70,381 posts

+1,807
Excellent

Posted 23 May 2016 - 10:41

This smells like a bug in the design, appearently there is quite a list of boxes that suffer from this problem. Guess that shows who is all using the same manufacturer...

 

From the looks of it, the RTC does run in UTC, but the drivers don't or can't handle timezone conversions to convert it to local time for the display. So they resorted to creating a proc entry into which Enigma has to write the difference in seconds between UTC and localtime, so the drivers can correct it with a simple addition. How lame...


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: Clock error in deep standby mode? #32 Rob van der Does

  • Senior Member
  • 7,766 posts

+184
Excellent

Posted 23 May 2016 - 11:12

None of the Xtrends support RTC, all VU's do. Not sure about other brands.



Re: Clock error in deep standby mode? #33 littlesat

  • PLi® Core member
  • 57,117 posts

+698
Excellent

Posted 23 May 2016 - 11:29

Indeed lame... But OpenATV did adapt it this way... so no need for the driver makers to change it :(


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


Re: Clock error in deep standby mode? #34 WanWizard

  • PLi® Core member
  • 70,381 posts

+1,807
Excellent

Posted 23 May 2016 - 13:17

OpenATV, by atvblack64, on 16 sep 2012, to address this issue on a Gigablue box: https://github.com/o...46a6a63ac78a47f

 

Which may suggest that this box has the same origin as quite a few others, and are all manufactured by airsatddt.

 

And they all have the same bug, in that the software in the frontprocessor that updates the time in the display can't handle the conversion from UTC (as stored in the RTC) to local time.


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: Clock error in deep standby mode? #35 Dimitrij

  • PLi® Core member
  • 10,297 posts

+347
Excellent

Posted 23 May 2016 - 13:30

RTC time correct work for VU+ and Formuler models use system time plugin.


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


Re: Clock error in deep standby mode? #36 WanWizard

  • PLi® Core member
  • 70,381 posts

+1,807
Excellent

Posted 23 May 2016 - 13:39

We know that, the problem is not for those boxes. It's for the Miraclebox, the Cloud Ibox, the Gigablue Solo, etc.

 

They seem to need an additional custom "rtc_offset" proc setting because the display logic can not convert RTC time to local time.


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: Clock error in deep standby mode? #37 WanWizard

  • PLi® Core member
  • 70,381 posts

+1,807
Excellent

Posted 23 May 2016 - 13:43

edit: looked at the Systemtime plugin: that RTC code is about taking the RTC time when the box starts or wakes up, and use that to set the linux clock.

 

This is not about that at all. This is about displaying local time in the 7-segment display of the box when the box is switched off / in deep standby.


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: Clock error in deep standby mode? #38 mrvica

  • Senior Member
  • 1,259 posts

+86
Good

Posted 16 August 2016 - 19:33

I borrowed the code from OpenATV, the box boots OK, no errors, still wrong time in deep standby



--- old/StbHardware.py	Tue Aug 16 19:12:55 2016
+++ new/StbHardware.py	Tue Aug 16 19:37:23 2016
@@ -1,3 +1,5 @@
+from time import time, localtime, gmtime
+from os import path
 from fcntl import ioctl
 from struct import pack, unpack
 
@@ -23,7 +25,17 @@
 		except IOError:
 			print "setFPWakeupTime failed!"
 
+def setRTCoffset():
+	forsleep = (localtime(time()).tm_hour-gmtime(time()).tm_hour)*3600
+	print "[RTC] set RTC offset to %s sec." % (forsleep)
+	try:
+		open("/proc/stb/fp/rtc_offset", "w").write(str(forsleep))
+	except IOError:
+		print "setRTCoffset failed!"
+
 def setRTCtime(wutime):
+	if path.exists("/proc/stb/fp/rtc_offset"):
+		setRTCoffset()
 	try:
 		open("/proc/stb/fp/rtc", "w").write(str(wutime))
 	except IOError:

can someone help

 



Re: Clock error in deep standby mode? #39 Dimitrij

  • PLi® Core member
  • 10,297 posts

+347
Excellent

Posted 17 August 2016 - 08:38

1)OpenATV image - displaying local time in the 7-segment display of the box when the box is switched off / in deep standby work OK?

2)Box name?


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


Re: Clock error in deep standby mode? #40 mrvica

  • Senior Member
  • 1,259 posts

+86
Good

Posted 17 August 2016 - 14:30

1) Yes, OpenATV showing the time in deep standby OK
2) cloudibox3 = miraclebox mini
OpenPLi supports some Miracleboxes (Twin and Micro) but not Mini, the code must be changed elsewhere, not only in StbHardware.py, I don´t know where


7 user(s) are reading this topic

0 members, 7 guests, 0 anonymous users