Page 2 of 8

Re: [App] Get/Set Current Time From TV C/D/E

Posted: Sat Mar 01, 2014 7:36 pm
by juusso

Code: Select all

export TZ=GMT+2
./getsetcurrenttimefromtv -n exeDSP -s
maybe... or maybe not? or CET, or CET+1, no idea :D

Re: [App] Get/Set Current Time From TV C/D/E

Posted: Sat Mar 01, 2014 7:48 pm
by sectroyer
greenhorn wrote:I've got this:
SpoilerShow
# date
Thu Jan 1 00:07:04 UTC 1970
# ./getsetcurrenttimefromtv -n exeDSP -d -s
pc=42a64158 lr=42a67928 sp=bec1a8e0 fp=bec1a934
r0=fffffe00 r1=0
r2=1 r3=0
symbol: g_AppTV -> @0x03bf172c
symbol: _ZN4TCTv11GetTimeZoneEPiS0_i -> @0x0003f008
symbol: _ZN4TCTv17GetSystemInfoTimeEPmi -> @0x000398f4
Error getting symbol: adbg_CheckSystem
Adding libc addr to found symaddress @0x000c81a0 + @0x42c2d000 = @0x42cf51a0
symbol: mprotect -> @0x42cf51a0
Stack: @0xbec06000 - @0xbec1b000
pc=42a64158 lr=42a67928 sp=bec1a8e0 fp=bec1a934
r0=fffffe00 r1=0
r2=1 r3=0
Executing injection code at 0xbec1a850
Found new time value.
Current Time: 1393698757
Current TimeZone Number: 9
Current TimeZone Offset: 120
The current date/time is: Sat Mar 1 18:32:37 2014
Current Time+Offset: 1393705957
The current date/time+offset is: Sat Mar 1 20:32:37 2014
Succesfully set current time.
Patching completed!
# date
Sat Mar 1 18:32:40 UTC 2014
#
What am I doing wrong? If ask date, it gives GMT time. It should GMT+2
Use latest version with -S switch. It will add time offset.
juuso wrote:Omg :o
SpoilerShow

Code: Select all

root@[TV] /> date
Thu Jan  1 02:33:44 UTC 1970

Code: Select all

 getsetcurrenttimefromtv -n exeDSP -d -s
pc=41cdb670 lr=41cdb65c sp=befbc088 fp=5b0e13c
r0=fffffe00 r1=80
r2=1 r3=0
Error getting symbol: g_AppTV
symbol: g_pAppTV -> @0x05afe818
Error getting symbol: _ZN4TCTv11GetTimeZoneEPiS0_i
symbol: _ZN4TCTv11GetTimeZoneEPiS0_ -> @0x00c10778
symbol: _ZN4TCTv17GetSystemInfoTimeEPmi -> @0x00c10c44
Error getting symbol: adbg_CheckSystem
symbol: mprotect -> @0x419b2be0
Stack: @0xbefa8000 - @0xbefbd000
pc=41cdb670 lr=41cdb65c sp=befbc088 fp=5b0e13c
r0=fffffe00 r1=80
r2=1 r3=0
Executing injection code at 0xbefbbff8
Found new time value.
Current Time: 1393697879
Current TimeZone Number: 9
Current TimeZone Offset: 120
The current date/time is: Sat Mar  1 18:17:59 2014
Current Time+Offset: 1393705079
The current date/time+offset is: Sat Mar  1 20:17:59 2014
Succesfully set current time.
Patching completed!

Code: Select all

root@[TV] /> date
Sat Mar  1 20:18:04 UTC 2014
juuso, juuso... I thought you used it hours ago ;)

However I would like to warn all of you that setting time using my tool, ntpclient or any other tool can cause problems. For instance it can cancel all of your scheduled recordings. It's much better to use "date mode" (-D) and put alias in /dtv/.ashrc

Re: [App] Get/Set Current Time From TV C/D/E

Posted: Sat Mar 01, 2014 7:51 pm
by juusso
:)

Re: [App] Get/Set Current Time From TV C/D/E

Posted: Sat Mar 01, 2014 8:16 pm
by M11
I have a stupid question, why are you all so excited about time? :-)
And one more serious question, does the TV report time in seconds or milliseconds? I saw that Netflix app checks time and I did read in other forums that it refuses to start if time doesn't match server time.

Re: [App] Get/Set Current Time From TV C/D/E

Posted: Sat Mar 01, 2014 8:24 pm
by sectroyer
M11 wrote:I have a stupid question, why are you all so excited about time? :-)
And one more serious question, does the TV report time in seconds or milliseconds? I saw that Netflix app checks time and I did read in other forums that it refuses to start if time doesn't match server time.
I will say it that way. TV uses timers. For some timers it uses seconds, for some milliseconds and for other minutes. I assume the same is (as with everything on these TVs) with time :) There is probably 2 or 3 ways of getting time from TV. Not sure which way Netflix app uses. This app get's time in seconds :)

Re: [App] Get/Set Current Time From TV C/D/E

Posted: Sat Mar 01, 2014 10:36 pm
by zoelechat
Is it a wanted behavior that app sets localtime as UTC?
For example my localtime is UTC+1

Code: Select all

date
Sat Mar  1 22:24:09 UTC 2014

Code: Select all

date -u
Sat Mar  1 22:24:09 UTC 2014
date and date -u give the same result while date -u should give one hour less, right? :)

This can't be solved by any export TZ since UTC is wrong.
More, I see that all files on TV samba server are offset by one hour too much, since Windows corrects time that is already corrected...

Re: [App] Get/Set Current Time From TV C/D/E

Posted: Sat Mar 01, 2014 10:43 pm
by sectroyer
For now the app sets current time to whatever timezone it was before you did run the app. Probably we should set time zone based on info from the app... Maybe tomorrow ;)

Re: [App] Get/Set Current Time From TV C/D/E

Posted: Sat Mar 01, 2014 10:56 pm
by zoelechat
What I supposed is simply set UTC as real UTC (there's only one UTC, expected by date -u command)

Code: Select all

Current Time: 1393708266
...and apply your retrieved offset to TimeZone, instead of adding it to UTC (expected by date command)

Code: Select all

Current Time+Offset: 1393711866
Hoping that is clear :mrgreen:

Re: [App] Get/Set Current Time From TV C/D/E

Posted: Sat Mar 01, 2014 10:58 pm
by sectroyer
zoelechat wrote:What I supposed is simply set UTC as real UTC (there's only one UTC, expected by date -u command)

Code: Select all

Current Time: 1393708266
...and apply your retrieved offset to TimeZone, instead of adding it to UTC (expected by date command)

Code: Select all

Current Time+Offset: 1393711866
Hoping that is clear :mrgreen:
Doesn't work correctly :) Read post before. One user already had a problem with. Setting "real" UTC doesn't give you correct time/date when you don't set timezone at the same time.

Re: [App] Get/Set Current Time From TV C/D/E

Posted: Sat Mar 01, 2014 11:13 pm
by zoelechat
I precisely read posts above and that's why I asked the question "is it a wanted behavior?" :)
Isn't it necessary to set timezone when you're not in UTC zone? (maybe your app should do it automatically? Using this famous offset)
What I see is just that "date -u" value is wrong, giving localtime instead of expected UTC time. I don't know if that can really be a problem (especially when sync is needed...) ;)