Hi,
I’m trying to use rtcwake on GLi MiFi to put it to sleep and wake up at a certain hour so I can save battery.
I’ve compiled the firmware with rtcwake added to busybox, but when I try and use it i get an error saying that /dev/rtc is missing.
Is there a built in rtc that I can use to achieve this and what do I need to do to enable it?
alzhao
December 26, 2016, 1:01pm
2
Do you have a RTC module as in AR150?
You need to buit the rtc kernel module ds1307.
Hi alzhao,
Thanks for your reply.
I was trying to avoid using an external rtc, but since it seems like that’s not possible, I do have a ds1307 module on hand that I can use.
I’ve been trying to follow the steps discussed here: https://www.gl-inet.com/forums/topic/gl-inet6416-and-i2c-rtc-ds1307-at24c32-rtc/ but I’m stuck at the step where I need to install kmod-rtc-ds1307. I get an Unknown package ‘kmod-rtc-ds1307’ error when I try to install it.
Any help with getting this module running will be much appreciated.
Thanks in advance.
EDIT: while writing this I remembered I was using a firmware that I compiled myself. I just re-flashed the latest official firmware for the MiFi ( from here: http://www.gl-inet.com/firmware/mifi/ ) and managed to install kmod-rtc-ds1307 successfully.
Now I’m stuck with another error. When I try to use hwclock I get the following error:
root@GL-MIFI:~# hwclock -s
hwclock: can’t open ‘/dev/misc/rtc’: No such file or directory
alzhao
January 4, 2017, 2:53pm
4
after you install the package, did you insmod the module successfully?
yes, insmod rtc-ds1307 inserted the module successfully and I can see it listed in the output of lsmod.
Hi hivemind:
Our package have some problem,I will solve it in few days,if you want use it now,you can compile your own firmware.
You can get code use command:
git clone git://git.openwrt.org/openwrt.git openwrt
or
git clone GitHub - domino-team/openwrt-cc: openwrt CC with Domino/GL patches openwrt
At make menuconfig,select GL-MIFI at Target Profile and choose this packages:
Kernel modules —> I2C support —> kmod-i2c-gpio-custom
At make kernel_menuconfig choose this packages:
Device Drivers —> Real Time Clock —> Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025
Thanks xiaoxin, this got me a step closer. I compiled from source following your instructions and hwclock works now.
Unfortunately I still can’t put the router to sleep using rtcwake.
root@GL-MIFI:~# rtcwake -s 30
rtcwake: /dev/rtc0 not enabled for wakeup events
Any ideas how I can get this working?
1 Like
alzhao
January 9, 2017, 1:30pm
8
I think this is because the router doesn’t have “sleep” and “wakeup” state.
I don’t know how to do that actually.
Hi hivemind:
I test again,I found everything is OK.
The problem <em style=“outline: none; vertical-align: baseline; margin: 0px; padding: 0px; color: #222222 ; font-family: source_sans_proregular, ‘Helvetica Neue’, Arial, Helvetica, Geneva, sans-serif; font-size: 14.6667px; line-height: 22px; background: #f9f9f9 ;”>hwclock: can’t open ‘/dev/misc/rtc’: No such file or directory shouldn’t appear.
I will give you my command information in the attachment ,you can test again.
You can tell me which GPIO you use for IIC,I will test at mifi like you.
In additon to this,you can give me some more command information,like my attachment and logread.