Time and Date drifting


test_alarm.sh:


NOW=`date -u +%s`
THEN=`expr $NOW + 30`

echo " NOW=$NOW"
echo "THEN=$THEN"


echo 0 > /sys/class/rtc/rtc0/wakealarm

hwclock && date

sleep 1

#echo `date '+%s' -d '+15 seconds'` > /sys/class/rtc/rtc0/wakealarm

echo $THEN > /sys/class/rtc/rtc0/wakealarm

cat /proc/driver/rtc

echo "alarm scheduled at:"
cat /sys/class/rtc/rtc0/wakealarm
echo "."

#sleep 2

#/usr/pandora/scripts/op_power.sh suspend_real
#/usr/pandora/scripts/op_power.sh 2

(added hwclock && date)

output:


pandora:/home/bsp# . ./test_alarm.sh
NOW=1382055448
THEN=1382055478
Fri Oct 18 02:17:28 2013 0.000000 seconds
Fri Oct 18 02:17:28 CEST 2013
rtc_time : 02:17:29
rtc_date : 2013-10-18
alrm_time : 02:22:29
alrm_date : 2013-10-18
alarm_IRQ : no
alrm_pending : no
update IRQ enabled : no
periodic IRQ enabled : no
periodic IRQ frequency : 1
max user IRQ frequency : 64
24hr : yes
alarm scheduled at:
.

So when I set an alarm of 1382040600, 20:10, it turns on when expected.
nobody's questioning that it works on your device, on FBnil's and mine it does not.

Do you have a classic or Rebirth Pandora, or one of the new DM3730 "1Ghz" ones ?

p.s.: and could you please run the testscript and post the output ?
 
Last edited by a moderator:
"date +%s" gives unix time which is always UTC, the "-u" is unnecessary.

1382055448 is Friday, October 18th 00:17:28.

00:17:28 is before 2:17:28 :p

Add 7200 to your timestamp and it should work.

edit: alternatively, probably set hwclock equal to UTC as well

hwclock -wu
 
Last edited by a moderator:
  • Like
Reactions: bsp
Add 7200 to your timestamp and it should work.
WizardStan, you are the man!

works like a charme..now I'm a happy camper \o/

edit: alternatively, probably set hwclock equal to UTC as well
hwclock -wu
tried that before but that did not work. the +7200 did the trick :D

for completeness' sake:


NOW=`date +%s`
THEN=`expr $NOW + 30`

THEN=`expr $THEN + 7200`

echo " NOW=$NOW"
echo "THEN=$THEN"

echo $THEN > /sys/class/rtc/rtc0/wakealarm

cat /proc/driver/rtc

echo "alarm scheduled at:"
cat /sys/class/rtc/rtc0/wakealarm
echo "."

# suspend:
/usr/pandora/scripts/op_power.sh 2

# --> Pandora wakes up after 30 seconds. yay!

output:


pandora:/home/bsp# . ./test_alarm.sh
NOW=1382058814
THEN=1382066044
rtc_time : 03:13:35
rtc_date : 2013-10-18
alrm_time : 03:14:04
alrm_date : 2013-10-18
alarm_IRQ : yes
alrm_pending : no
update IRQ enabled : no
periodic IRQ enabled : no
periodic IRQ frequency : 1
max user IRQ frequency : 64
24hr : yes
alarm scheduled at:
1382066044
.


EDIT: this is really very cool since my old alarm clock wasted ~2.5W. Using the Pandora instead is a huge improvement in regards to power consumption and it's fully programmable, heh :D (not to mention the various other applications this has..) thanks a lot for your time and patience !
 
Last edited by a moderator:
Any chance of this being made into a PND or added as an option to the OS? I'm having a ton of trouble with this lately, both with drift and with it forgetting the TZ that I'm in. It's been that way for quite a while, I've made a script that I run habitually when I connect to wifi, but it's kind of a PITA and doesn't work if I don't have wifi available.

Considering that it's one of my two biggest annoyances, I have to admit that overall I'm pleased with my unit.

Failing that, what's the easiest way of making this change on my own Pandora?
 
It's already done, run "upgrade OS", do one reboot and set time, then it should stop changing timezones at least.
 
Last edited by a moderator:
It's already done, run "upgrade OS", do one reboot and set time, then it should stop changing timezones at least.
When did that happen? I think the last time I updated was in the last week or so.

Anyways, I'll try that, and thanks for the update, that makes 2 of the 3 most annoying things fixed.

I see that there is a new update, so I'll see how that works and report back if it doesn't work. But, I'm sure it will work.
 
Last edited by a moderator:
Last edited by a moderator:
It's already done, run "upgrade OS", do one reboot and set time, then it should stop changing timezones at least.
When did that happen? I think the last time I updated was in the last week or so.
There is a log here that I try to keep updated:

http://boards.openpandora.org/topic/12202-superzaxxon-incremental-update-changelog/

Normally things are announced only when ED releases an update.
Thanks, I'll keep that book marked. So far the change seems to be working. So, it probably was the same cause as the other people in this thread.

As much drama as there was getting my Pandy, you guys really do a bang up job on the software end of things, and the hardware designs were ultimately pretty good as well.
 
Last edited by a moderator:
Back
Top