Moderator Control Panel ]

[SOLVED] MOI Setting - Time Zone - Time / Date

Anything from the case design to the chip inside, from expectation to suggestion, the most important thing is, you are IN.

[SOLVED] MOI Setting - Time Zone - Time / Date

Postby marcelp1 » Mon Aug 05, 2013 3:46 am

I have upgraded to v1.2, but my EPG is still out of sync.

So finally today I had a bit of play round with it.

Setting the time via web interface http://xxx.xxx.xxx.xxx/moi-setting.html does not work.
I set the Time Zone and Month : Day : Year : Hour : Minute : Second manualy as getTimeandZone button does not work for me :(
" GMT 8, 4, 2013, 20, 33, 49"

when typing "date" I get:
Sun Aug 4 20:34:20 MDT 2013

date -u will give me time I want to see set, but its different:
Mon Aug 5 02:34:54 UTC 2013




How do I set the time "when tying date" to UTC time zone?

I have tried:

Set the Hardware Clock to the current System Time.
hwclock --systohc

Set the System Time from the Hardware Clock.
hwclock --hctosys

but noting works :(

when looking at the
vi /etc/TZ
file I see that is set to "MST7MDT", looking what that is I have found
http://twiki.org/cgi-bin/xtra/tzdate?tz=MST7MDT
Timezone: MST7MDT
Date&time: Sun, 04 Aug 2013 13:44:57 -0600 (MDT)

but when looking at http://twiki.org/cgi-bin/xtra/tzdatepick.html
there is not one for UTC.

Can anyone help me please?
Last edited by marcelp1 on Tue Aug 06, 2013 4:52 pm, edited 1 time in total.
marcelp1
 
Posts: 31
Joined: Mon Mar 18, 2013 1:01 am

Re: MOI Setting - Time Zone - Time / Date

Postby gfi » Tue Aug 06, 2013 1:39 am

manually.

In console type:
./tzfix <nr_of_time_offset_from_UTC> <use_daylight_saving_time>

1st parameter (between -11 up to 13), 2nd parameter 0 or 1 (0 = don't use dst, 1 = use dst)

for example:
./tzfix 1 1
(UTC +1, use Summer Time (dst))

or
./tzfix 3 0
(UTC +3, don't use dst)

or
./tzfix -5 1
(New York, EST)

etc.

You need to set correct value of time in UTC (!!). Script ask You for that.
Kernel read UTC time from Bios (this is right, cause EIT, EPG using UTC time with offset defined). Don't use local time in Bios. Never be working properly.
Reboot MOI from WebUI - important.

Note:
This is not true fixations of Timezone. uClibc need a full Values with month, week, hour, where is time changed in Your country.
But mostly working. Full value looking similar like that: CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00
Attachments
tzfix.zip
(630 Bytes) Downloaded 642 times
gfi
 
Posts: 114
Joined: Tue Mar 05, 2013 10:55 pm

[SOLVED] Re: MOI Setting - Time Zone - Time / Date

Postby marcelp1 » Tue Aug 06, 2013 4:47 pm

This is what I did:

(I have inserted memory card into MMC card slot)
cd /mnt/mmc

(to get the file direct does not work with wget)
wget download/file.php?id=2177

(so I placed the tzfix.zip file onto my local web server that is on address 10.0.0.100)
wget http://10.0.0.100/moi/tzfix.zip
unzip tzfix.zip -d /mnt/mmc/

this worked work me:

# ./tzfix 0 1
Current Value of Timezone (/etc/TZ): GMT1BST
Enter correct time in UTC check this for UTC times http://www.timeanddate.com/worldclock/c ... html?n=136
Format: yyyy.mm.dd-hh:mm
2013.08.06-08:39
Tue Aug 6 08:39:00 BST 2013
New Value of Timezone: GMT0BST
Tue Aug 6 09:39:00 BST 2013
#
# date
Tue Aug 6 09:39:02 BST 2013
# date -u
Tue Aug 6 08:39:06 UTC 2013


cat /etc/TZ
GMT0BST

finally my EPG works as it should.




What's is going to happened on power down of the device?
Last edited by marcelp1 on Wed Aug 14, 2013 4:58 pm, edited 1 time in total.
marcelp1
 
Posts: 31
Joined: Mon Mar 18, 2013 1:01 am

Re: [SOLVED] Re: MOI Setting - Time Zone - Time / Date

Postby gfi » Tue Aug 06, 2013 5:51 pm

marcelp1 Wrote:What's is going to happened on power down of the device?


Looking forward, You're more curiously, than me...

Ok, when You reboot Your box (or power off/on), kernel read date in UTC. If You prepared Your data/time in local time, by date --set and hwclock, kernel will always read that value as UTC date/time. Not local. And then going to read offset (defined in TZ). For DVB application with EIT parsing (or xmltv parses) is this needed.

Data from EIT (EPG) comming in UTC. Applications reading timezone offset and assuming EPG to Your local time. In Your satellite box, You need setup Your timezone too.

Script isn't ideal, I thing better way is little application, for automatic recalculate time, or reading online time from known server.
Next important: As I wrote, uClibc haven't expansions by iana.org (little bug) like glibc, so is always better use full setup of Timezone, directly for Your country.
To be box know, where (hour, date) is change to DST and back.
This is ONLY for countries using DST (daylight saving time / summer time).

Full docu, when and where is dst:
http://en.wikipedia.org/wiki/Daylight_s ... by_country

Next way, create full table with correct TZ for all countries of the world.
gfi
 
Posts: 114
Joined: Tue Mar 05, 2013 10:55 pm

Re: [SOLVED] MOI Setting - Time Zone - Time / Date

Postby fantasticn » Wed Aug 14, 2013 2:42 pm

Actually I did not really get your solution and the steps outlined by marcelp1 did not work for me. I tried SSH-connection via WinSCP (Terminal Windows) and Putty, but was not able to download the TZfix-file via wget. So I did it manually from the other link and inserted the file then via WinSCP. When I then tried to execute the "./tzfix 1 1"-command I just received errors ("Permission Denied").

So finally I decided to just go to "etc"-folder and edit the "TZ"-file manually via WinSCP. I inserted "GMT1BST" (which I hope is right for Germany - or should I use GMT2BST because we have summer time right now?). I then went to the MOI-Settings, selected "Greenwich Mean Time, Universal Coordinated Time" and adjusted hour, minutes and seconds to my current time, and pressed "setTimeandZone". Then I let the MOI reboot.

After reboot I checked the TZ-File and was happy to find that the settings ("GMT1BST") had remained. And now it seems I am getting EPG-data for almost every channel just perfect. So my questions are:

1. Did I do something wrong by just editing the TZ-File? Do I need to follow a different procedure (somehow applying the tzfix) and/or use other values?
2. What about the summer-time settings? Will it adjust to winter-time again automatically or do I need to adjust the settings then again manually?

Brgds,

FantasticN
fantasticn
 
Posts: 24
Joined: Wed Jul 31, 2013 2:28 pm

Re: [SOLVED] MOI Setting - Time Zone - Time / Date

Postby marcelp1 » Wed Aug 14, 2013 5:53 pm

Try this for Germany / Europe

cd /tmp
wget http://ftp.swfwmd.state.fl.us/pub/in/tzfix.zip
unzip tzfix.zip


./tzfix 1 1
= enter current time lest 1 hour
= then check with
date
date -u
marcelp1
 
Posts: 31
Joined: Mon Mar 18, 2013 1:01 am

Re: [SOLVED] MOI Setting - Time Zone - Time / Date

Postby fantasticn » Thu Aug 15, 2013 2:59 pm

Hello marcelp1,

thanks for your reply. I now set back the TZ-file to "MST7MDT" (the standard-value) and rebooted the MOI, to be axactly at the position I started with. Then I tried the steps you just outlined with Putty, but after "./tzfix 1 1" I am getting the message "Access denied". However,

"date" gives me "Thu Aug 15 02:44:44 MDT 2013" (which is current time minus 6)
"date -u" gives me "Thu Aug 15 08:45:45 UTC 2013" (which is current time).


So I edited TZ-File again, inserted "GMT1BST" manually again and rebooted. After that

"date" gives me "Thu Aug 15 08:51:00 BST 2013" (which is current time)
"date -u" gives me "Thu Aug 15 08:51:36 UTC 2013" (which is current time as well).

So my questions are:

1. What about the "Access denied error"? Is there something elso I have to do first to get "access"?
2. Why do I need the tzfix-precedure anyway? Is the manual adjustment of the TZ-file not sufficient?
3. What about summer and winter-time? Will it be adjusted automatically or do I need to do something manually then (e.g. edit the TZ-file again).
4. And what about the vaules in the webinterface? I now have "(GMT) Greenwich Mean Time, Universal Coordinated Time" selected and inserted my current local time in hours, minutes and seconds. Is that the correct? Will it cause any difference to the TZ-file if I select something else?

Actually I am totally puzzled by this time adjustment procedure.

Brgds,

FantasticN
fantasticn
 
Posts: 24
Joined: Wed Jul 31, 2013 2:28 pm

Re: [SOLVED] MOI Setting - Time Zone - Time / Date

Postby marcelp1 » Thu Aug 15, 2013 4:36 pm

I should have tried it myself before posting. :(

For some strange reason the MOI box would not let you execute that file,
permissions maybe, who know I am not an expert, someone over here will correct me ...


the script can only be executed from either MMC card or USB stick/disk
(That is why it worked for me, as I downloaded it to MMC card)
I have now tried with USB stick, formatted as FAT32 and it works,
and I think my MMC card is formatted as FAT32 as well, but blkid nor fsdisk -l
work on the MOI so not sure hot to check, without taking the card out)

so for MMC card do this:
cd /mnt/mmc

for USB stick/disk do this:
cd /mnt/usb

wget http://ftp.swfwmd.state.fl.us/pub/in/tzfix.zip
unzip tzfix.zip


./tzfix 1 1
= enter current time lest 1 hour

= then check with:
date
date -u
cat /etc/TZ


= then log in into the MOI user interface and reboot the box pressing "Reboot MOI" button
http://your_MOI_box_IP/moi-setting.html
marcelp1
 
Posts: 31
Joined: Mon Mar 18, 2013 1:01 am

Re: [SOLVED] MOI Setting - Time Zone - Time / Date

Postby fantasticn » Fri Aug 16, 2013 8:13 pm

Hi marcelp1,

thank you very much! That seemed to work. I now have:

date = current time
date -u = current time minus 2 hours

The TZ-File now shows the following content:
CET-1CEST

My remaining questions are:
1. Will time stay synchonrized (e.g. sync with internet-clock) or will the clock run slowely out of sync and therefore has to be adjusted every once in a while?
2. Do I have to adjust the clock again when we turn from summer time to winter time, or will it adjust automatically then?

Best regards,

FantasticN
fantasticn
 
Posts: 24
Joined: Wed Jul 31, 2013 2:28 pm

Re: [SOLVED] MOI Setting - Time Zone - Time / Date

Postby marcelp1 » Fri Aug 16, 2013 10:12 pm

fantasticn Wrote:
My remaining questions are:
1. Will time stay synchonrized (e.g. sync with internet-clock) or will the clock run slowely out of sync and therefore has to be adjusted every once in a while?
2. Do I have to adjust the clock again when we turn from summer time to winter time, or will it adjust automatically then?


I have tried "ntpdate -u ntp.ubuntu.com" but it does not work.
When you swich off the box from the mains, it will forget the time (I did not check if the zone too, so have a try ;).

I gues it should adjust itself, but we will see in when BST ends on Sunday October 27th ;)
or you can try setting the date / time to the October 27 2:59am and see if the clock goes to 2am after a minute ;)

I have TVHeadend running on Raspberry Pi with 2 x PCTV Systems DVB-T2 290e nanoStick HD TV Tuner (picekd for bargain price at PC World 40 quid on sale)
and it is much easier (for beginner like me) to configure then the MOI :(
marcelp1
 
Posts: 31
Joined: Mon Mar 18, 2013 1:01 am

Next

Return to General discussion

Who is online

Users browsing this forum: No registered users and 3 guests