Page 1 of 4 123 ... LastLast
Results 1 to 15 of 57

Thread: Real time clock with Oleg's firmware

  1. #1

    Real time clock with Oleg's firmware

    Hi,

    I was wondering how I could get the hardware clock from my WL HDD using Oleg's latest firmwares. I can't see any /dev/rtc devices, but this is something in hardware. This would be very usefull for using the WL without any internet connection and still log correct timestamps.

    Does it need a kernel module? I can find the one from WL-hdd root fs, but it doesn't create any devices (as splink_led)
    Last edited by hugo; 03-02-2005 at 16:52.

  2. #2
    Join Date
    Dec 2003
    Location
    Russian Federation
    Posts
    8,353
    Yes, kernel module is required, but I've no idea how this works - probably they've changed something in the kernel.
    The module itself contains bunch of code, which is providing I2C access via GPIO pins to the RTC.
    Have you determined name of RTC chip?

    BTW, I'm pretty sure, that this code is subject to GPL, but ASUS is violating it as USUAL.

  3. #3
    Ok, here is the answer:

    Use the module attached
    insmod rtcdrv.o

    then
    mknod /dev/rtc c 12 0

    Using cat /dev/rtc, you get the real time. Just have to set up some progs to use it, and maybe set this as an option in firmware?
    Attached Files Attached Files

  4. #4
    should this work for wl-500g?
    [root@WL500G:/]# insmod rtcdrv.o
    rtcdrv.o: kernel-module version mismatch
    rtcdrv.o was compiled for kernel version 2.4.5
    while this kernel is version 2.4.20.
    [root@WL500G:/]# insmod -f rtcdrv.o
    Warning: kernel-module version mismatch
    rtcdrv.o was compiled for kernel version 2.4.5
    while this kernel is version 2.4.20
    Warning: loading rtcdrv.o will taint the kernel: no license
    See http://www.tux.org/lkml/#export-tainted for information about tainted modules
    Warning: loading rtcdrv.o will taint the kernel: forced load
    Module rtcdrv loaded, with warnings
    [root@WL500G:/]# mknod /dev/rtc c 12 0
    [root@WL500G:/]# cat /dev/rtc
    20ff:7f:ff:ff:ff:ff:ff[root@WL500G:/]#

  5. #5
    Join Date
    Nov 2003
    Location
    Eindhoven
    Posts
    2,407
    Quote Originally Posted by Alice
    should this work for wl-500g?
    no, the wl500g does not have a RTC

    My little Asus Collection: Too much to fit inhere, my 2 babies:WL500w 1.9.2.7-10(OLEG) VX2SE Yellow Lamborghini notebook



    WL500g Forum Asus Files OpenDir

    Asusforum.NL -- Asusforum.DE -- Asusforum.RU -- Asusforum.PL -- Asusforum.NET -- Asusforum.EU -- Asusforum.BE -- Asusforum.ES -- Asusforum.INFO

  6. #6
    For the owners of Wl-HDD using Oleg firmwares, you don't have real time clock available. I still cannot set time (so you need to use normal Wl-hdd firmware for that), but here is an how -to to get your clock set on boot up if you are not connected to internet:

    First read my previous post, and place the rtcdrv.o in a folder on hd.

    You must also get the full busybox from the forum, or from the package (use ipkg.sh install busybox)
    Check you can get awk working using busybox awk command.

    Then edit your post-mount like this:

    Code:
    [admin@wl-hdd sbin]$ cat post-mount
    #!/bin/sh
    insmod /tmp/hd/wl-hdd/lib/modules/2.4.20/rtcdrv.o
    mknod /dev/rtc c 12 0
    date -s "`/tmp/hd/conf/bin/busybox awk 'BEGIN {FS=":"}; {print $2"/"$3"/"$1" "$5":"$6":"$7}' /dev/rtc`"
    Be sure to change path to your module path.

    I think date command is from the coreutils package. You might check compatibility with standard one.

    Also, using sed might be lighter, not using the full busybox.
    Also, use copy and paste, as i'm using 3 different quote types.

  7. #7
    I was able to set the clock by using the following after Telnetting into my WL-HDD:

    [admin@LG-Music harddisk]$ date
    Wed Dec 31 19:57:03 EST 1969
    [admin@LG-Music harddisk]$ date -?
    date: illegal option -- ?
    BusyBox v1.00 (2005.05.11-18:29+0000) multi-call binary

    Usage: date [OPTION]... [MMDDhhmm[[CC]YY][.ss]] [+FORMAT]

    [admin@LG-Music harddisk]$ date -s "122920352005"
    Thu Dec 29 20:35:00 EST 2005

  8. #8
    Hi Hugo,

    Thank you for your answer, I am now able to set the time during boot. But do you know if there is already a way to change the time in the hardware clock itself (without installing the asus firmware) because my hardware time is half a hour behind. I searched everywhere but couldn’t find anything.

  9. #9

    Better late than never

    You can remove your awk with a little sh trick:
    Code:
    if [ `date +%s` -lt 10000 ]; then
        #we are before Jan 1 1970, 3am, the clock has not been set up
        cat /dev/rtc|(IFS=:;read Y M D dow h m s
        # dow is day of week, 0=sunday
        date $M$D$h$m$Y.$s
    fi
    In the /usr/local/sbin/pre-shutdown script, you can add
    Code:
    [ -c /dev/rtc ] && date +%Y:%m:%d:%w:%H:%M:%S > /dev/rtc
    SurJector

  10. #10
    Hi,

    Quote Originally Posted by SurJector View Post
    You can remove your awk with a little sh trick:
    Code:
    if [ `date +%s` -lt 10000 ]; then
        #we are before Jan 1 1970, 3am, the clock has not been set up
        cat /dev/rtc|(IFS=:;read Y M D dow h m s
        # dow is day of week, 0=sunday
        date $M$D$h$m$Y.$s
    fi
    The cat /dev/rtc... line seems to be incomplete, a bracket seems to be missing, furthermore, the variables aren't set at my WL-HDD.
    I have to use the following line which unfortunately requires awk again

    Code:
    date -s "`awk 'BEGIN {FS=":"}; {print $2$3$5$6$1"."$7}' /dev/rtc`"
    Quote Originally Posted by SurJector View Post
    In the /usr/local/sbin/pre-shutdown script, you can add
    Code:
    [ -c /dev/rtc ] && date +%Y:%m:%d:%w:%H:%M:%S > /dev/rtc
    Although it returns with no error, the clock still remains at the previous time set if I run this on command line. Or will it only work at pre-shutdown?
    Could it be somehow read-only (even for root) or some other process still using it?

    CU!

    Frederik.

  11. #11
    Could set date via RTC too. But how to set the RTC?

    The

    [ -c /dev/rtc ] && date +%Y:%m:%d:%w:%H:%M:%S > /dev/rtc

    doesn't work for me to.

  12. #12
    Sorry for being late. I was hibernating.
    The first script lacks a closing parenthesis immediately after the date command:
    Code:
    date $M$D$h$m$Y.$s)
    There should be no problem, but you might need to load the driver (I can't check because I don't have my HDD: I've loaned it to a friend).
    SurJector

  13. #13
    Hi,

    sorry for my late reply, too, was without DSL for two weeks ...

    Quote Originally Posted by SurJector View Post
    The first script lacks a closing parenthesis immediately after the date command:
    Code:
    date $M$D$h$m$Y.$s)
    Great, works now. Maybe you could edit your previous post to have it correct there for other people who might not read the complete thread?

    As for the problem with setting the RTC via the command mentioned above, I found out the following: Although the command does not return with an error, dmesg gives me the following output:

    Code:
    Write RTC string:2006:11:25:6:14:14:00
    
    Error: RTC format mismatch!!
    I then tried something obvious like
    Code:
    cat /dev/rtc > /dev/rtc
    which gave me
    Code:
    Write RTC string:2006:11:25:6:14:25:08
    4:
    Error: RTC format mismatch!!
    So I assumed that 24-hours time could be a problem and set manually
    Code:
    echo "2006:11:25:6:02:25:08" > /dev/rtc
    Which gave me a strange
    Code:
    Write RTC string:2006:11:25:6:02:25:08
    Å
    Error: RTC format mismatch!!
    
    Write RTC string:2006:11:25:6:02:25:08
    Å
    Error: RTC format mismatch!!
    (Right, it threw two errors with one single command issued.)
    If I change the "02" to just "2", the "Å"-character disappears in the error message.

    Any ideas anyone?

    CU!

    Frederik.

  14. #14
    wanna bring this topic up again.
    Someone know how to set the RTC? It's possible with the origin firmware, but for sure I don't wanna flash and back it just to set time

  15. #15
    Join Date
    Jan 2005
    Location
    konstanz, germany
    Posts
    90

    Smile Howto ... comming soon

    Hi :-)

    rtcdrv.o works fine on my WLHDD ... the only ASUS device with a RTC (!) ... I add a howto to german discussion thread from wengi ... end of the week :-)

    Martin

    Edit: Sorry no time at the moment ... hope to get it in 2 weeks ...
    Last edited by Martin1802; 05-04-2007 at 16:41.

Page 1 of 4 123 ... LastLast

Similar Threads

  1. oleg's firmware vs openwrt
    By sophana in forum WL-500g Custom Development
    Replies: 5
    Last Post: 15-07-2005, 18:46
  2. Hoe is filestructuur van OLEG's firmware?
    By newbie in forum Dutch Discussion - Nederlands
    Replies: 4
    Last Post: 24-06-2005, 15:23
  3. Real-time bandwidth use
    By gwl in forum WL-500g Q&A
    Replies: 8
    Last Post: 12-01-2005, 04:16
  4. Flashing Oleg's Firmware in WL HDD
    By hugo in forum WL-HDD Custom Development
    Replies: 29
    Last Post: 21-10-2004, 15:55

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •