Jump to content


Photo

System Time

plugin

  • Please log in to reply
58 replies to this topic

Re: System Time #41 Dimitrij

  • PLi® Core member
  • 6,597 posts

+212
Excellent

Posted 29 November 2014 - 12:33

Hello @Dima73

Slovakian translation

language folder must be ck?


Lunix3-4K/VU+solo4k(thanks guys to gisclub.tv)


Re: System Time #42 dym1

  • Member
  • 11 posts

+5
Neutral

Posted 29 November 2014 - 13:03

Language folder sk



Re: System Time #43 Dimitrij

  • PLi® Core member
  • 6,597 posts

+212
Excellent

Posted 29 November 2014 - 13:05

Language folder sk

ok

ver. 1.2

I ask you to check


Edited by Dima73, 29 November 2014 - 13:06.

Lunix3-4K/VU+solo4k(thanks guys to gisclub.tv)


Re: System Time #44 dym1

  • Member
  • 11 posts

+5
Neutral

Posted 29 November 2014 - 13:36

Everything okay. Thank you.



Re: System Time #45 beniman

  • Member
  • 5 posts

0
Neutral

Posted 26 June 2015 - 11:15

Hi 

 

I can`t install system time plugin on my et4000.

I try install it from the feed and from local  and nothing happen.

I recieve messege plugin can´t be installed.

 

help please



Re: System Time #46 Kosh

  • Senior Member
  • 424 posts

+5
Neutral

Posted 26 June 2015 - 14:38

Is that all the info you get, or is there more text available?


ET10K user i.c.w. Samsung UE40B6000 LED HDTV. ET9K alas not functioning anymore.


Re: System Time #47 Erik Slagter

  • PLi® Core member
  • 45,365 posts

+498
Excellent

Posted 28 June 2015 - 09:55

Wrong arch. Arch of xp1000, hd1100 and et4000 = mips32el-nf, arch of plugin is mips32el or mipsel. The maker of the plugin should make versions for both arch's.


Edited by Erik Slagter, 28 June 2015 - 09:55.

* Wavefrontier T90 with 28E/23E/19E/13E/9E/4.8E/0.8W/5W via SCR switches 2 x 2 x 6 user bands
* Ziggo digital cable TV (FTA)
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.

Re: System Time #48 Dimitrij

  • PLi® Core member
  • 6,597 posts

+212
Excellent

Posted 20 January 2016 - 19:50

Version 1.3

Support: sh4,mips,vu+solo4k


Lunix3-4K/VU+solo4k(thanks guys to gisclub.tv)


Re: System Time #49 Dimitrij

  • PLi® Core member
  • 6,597 posts

+212
Excellent

Posted 21 January 2016 - 17:32

update ipk

 


Lunix3-4K/VU+solo4k(thanks guys to gisclub.tv)


Re: System Time #50 athoik

  • PLi® Core member
  • 7,926 posts

+295
Excellent

Posted 21 January 2016 - 18:27

@Dimitrij,

IF you really like to make this "all" as architechure I suggest to start moving out the binaries.

Eg for ntp you can use python ntplib and for set time you can use CDLL.
 
# http://stackoverflow.com/questions/5222951/easy-way-to-get-the-correct-time-in-python
# http://stackoverflow.com/questions/12081310/python-module-to-change-system-date-and-time

def _get_ntp_time(server="pool.ntp.org"):
    import ntplib
    import time
    client = ntplib.NTPClient()
    response = client.request('pool.ntp.org')
    return time.localtime(response.tx_time)

def _linux_set_time(time_tuple):
    import ctypes
    import ctypes.util
    import datetime
    import time

    # /usr/include/linux/time.h:
    #
    # define CLOCK_REALTIME                     0
    CLOCK_REALTIME = 0

    # /usr/include/time.h
    #
    # struct timespec
    #  {
    #    __time_t tv_sec;            /* Seconds.  */
    #    long int tv_nsec;           /* Nanoseconds.  */
    #  };
    class timespec(ctypes.Structure):
        _fields_ = [("tv_sec", ctypes.c_long),
                    ("tv_nsec", ctypes.c_long)]

    librt = ctypes.CDLL(ctypes.util.find_library("rt"))

    ts = timespec()
    ts.tv_sec = int( time.mktime( datetime.datetime( *time_tuple[:6]).timetuple() ) )
    ts.tv_nsec = time_tuple[6] * 1000000 # Millisecond to nanosecond

    # http://linux.die.net/man/3/clock_settime
    librt.clock_settime(CLOCK_REALTIME, ctypes.byref(ts))

if __name__ == "__main__":
    import time

    print "Local Time Before:", time.localtime()
    tm = _get_ntp_time()
    print "NTP Time:", tm
    _linux_set_time(tm)
    print "Local Time After:", time.localtime()
Example:
 
# python t.py
Local Time Before: time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=2, tm_min=1, tm_sec=55, tm_wday=3, tm_yday=1, tm_isdst=0)
NTP Time: time.struct_time(tm_year=2016, tm_mon=1, tm_mday=21, tm_hour=19, tm_min=14, tm_sec=47, tm_wday=3, tm_yday=21, tm_isdst=0)
Local Time After: time.struct_time(tm_year=2016, tm_mon=1, tm_mday=21, tm_hour=19, tm_min=14, tm_sec=47, tm_wday=3, tm_yday=21, tm_isdst=0)

Edited by athoik, 21 January 2016 - 18:27.

Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: System Time #51 Dimitrij

  • PLi® Core member
  • 6,597 posts

+212
Excellent

Posted 21 January 2016 - 20:01

todo :)


Lunix3-4K/VU+solo4k(thanks guys to gisclub.tv)


Re: System Time #52 athoik

  • PLi® Core member
  • 7,926 posts

+295
Excellent

Posted 21 January 2016 - 22:54

todo :)


This one will make no unnecessary (and wrong caclulation in nanoseconds) convertions. Hopefully I did it correctly now.

Although you can simply omit nanoseconds, nobody will ever complaint.

def _get_ntp_time(server="pool.ntp.org"):
    import ntplib
    client = ntplib.NTPClient()
    response = client.request(server)
    return response.tx_time

def _linux_set_time(tm):
    import ctypes
    import ctypes.util

    # /usr/include/linux/time.h:
    #
    # define CLOCK_REALTIME                     0
    CLOCK_REALTIME = 0

    # /usr/include/time.h
    #
    # struct timespec
    #  {
    #    __time_t tv_sec;            /* Seconds.  */
    #    long int tv_nsec;           /* Nanoseconds.  */
    #  };
    class timespec(ctypes.Structure):
        _fields_ = [("tv_sec", ctypes.c_long),
                    ("tv_nsec", ctypes.c_long)]

    librt = ctypes.CDLL(ctypes.util.find_library("rt"))

    ts = timespec()
    ts.tv_sec = int(tm)
    ts.tv_nsec = int((tm - int(tm) * 1000) * 1000000) # Millisecond to nanosecond

    # http://linux.die.net/man/3/clock_settime
    librt.clock_settime(CLOCK_REALTIME, ctypes.byref(ts))

if __name__ == "__main__":
    import time

    print "Local Time Before:", time.localtime()
    tm = _get_ntp_time()
    print "NTP Time:", tm
    _linux_set_time(tm)
    print "Local Time After:", time.localtime()
Also python-ntplib soon will be in the feeds, I have a recipe ready.
Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: System Time #53 Dimitrij

  • PLi® Core member
  • 6,597 posts

+212
Excellent

Posted 22 January 2016 - 06:38

update again

Attached Files


Lunix3-4K/VU+solo4k(thanks guys to gisclub.tv)


Re: System Time #54 Erik Slagter

  • PLi® Core member
  • 45,365 posts

+498
Excellent

Posted 22 January 2016 - 09:18

If the package is arch independent now, we can put it in the enigma2-plugins repo! Please supply patch!


* Wavefrontier T90 with 28E/23E/19E/13E/9E/4.8E/0.8W/5W via SCR switches 2 x 2 x 6 user bands
* Ziggo digital cable TV (FTA)
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.

Re: System Time #55 Dimitrij

  • PLi® Core member
  • 6,597 posts

+212
Excellent

Posted 2 March 2016 - 22:22

Version 1.4

-as suggested by athoik

 

Attached Files


Lunix3-4K/VU+solo4k(thanks guys to gisclub.tv)


Re: System Time #56 athoik

  • PLi® Core member
  • 7,926 posts

+295
Excellent

Posted 2 March 2016 - 22:29

@Dimitrij,

Since dvbdate is included on the feeds please remove binaries from systemtime plugin.

Also do not delete dvbdate on uninstall..

[ -x /usr/bin/dvbdate ] && rm -rf /usr/bin/dvbdate
Finally use ntpd everywhere when ntpdate doesn't exists.
Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: System Time #57 Erik Slagter

  • PLi® Core member
  • 45,365 posts

+498
Excellent

Posted 3 March 2016 - 10:57

Plugins or any other code should NEVER remove files that are managed by the package system. Very bad practise!


* Wavefrontier T90 with 28E/23E/19E/13E/9E/4.8E/0.8W/5W via SCR switches 2 x 2 x 6 user bands
* Ziggo digital cable TV (FTA)
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.

Re: System Time #58 harrys13

  • Member
  • 1 posts

0
Neutral

Posted 1 February 2017 - 05:01

No work on DM 500HD with openpli 2.1



Re: System Time #59 Dimitrij

  • PLi® Core member
  • 6,597 posts

+212
Excellent

Posted 1 February 2017 - 06:45

https://openpli.org/...eambox/DM500 HD


Lunix3-4K/VU+solo4k(thanks guys to gisclub.tv)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users