Setting date/time with a python GUI

Setting your local timezone

To have your FreeRunner display time appropriate to your local timezone, update the /etc/localtime symlink to point to the file in /usr/share/zoneinfo that represents your timezone. For example, in an SSH session to the phone, or in a terminal running on the phone:

You may want to try this if the above returns something like "file exists".

# ln -sf /usr/share/zoneinfo/CST6CDT /etc/localtime

the -f (--force) removes existing destination files. (CQ).

Setting the date/time automatically with NTP

If your FreeRunner is connected to the internet, you can instead set the time automatically:

opkg install ntpclient
ntpclient -s -h pool.ntp.org

If your FreeRunner is connecting to the internet through a USB host, make sure you allow UDP traffic to pass through on port 123 (NTP) on your host machine or you may get a "no route to host" error from ntpclient.

Have a look over over here where this process is automated whilst udhcpc is started, which happens automatically for wifi connections initiated by Mofi and friends.

Syncing the hardware clock

No matter which method you used above, sync the hardware clock with the system time to make your change persist over reboots:

hwclock --systohc

Note:
If you run the ASU or Qtopia image, hwclock will not work. The missing /dev/misc/rtc could be establish with

mkdir /dev/misc;
ln -s /dev/rtc /dev/misc/rtc

but the device is usually busy due to the atd daemon.
Instead you can use:

echo -e "W\n" > /var/spool/at/trigger

Here is a link from the community mailing list for using hwclock with the ASU image:

The last step is the actual syncing of the clock. For this, simply run the GPS Sight program from the main menu, wait for it to find the gps time and click the button labeled "Sync clock".

Future Work

Presumably it might also be possible to use gpspipe (or something else) to set the date once you have a gps fix automatically? In addition, the phone stack should set the date, time, and timezone once connected to a network.

Setting date/time with a python GUI

Setting your local timezone

To have your FreeRunner display time appropriate to your local timezone, update the /etc/localtime symlink to point to the file in /usr/share/zoneinfo that represents your timezone. For example, in an SSH session to the phone, or in a terminal running on the phone:

You may want to try this if the above returns something like "file exists".

# ln -sf /usr/share/zoneinfo/CST6CDT /etc/localtime

the -f (--force) removes existing destination files. (CQ).

Setting the date/time automatically with NTP

If your FreeRunner is connected to the internet, you can instead set the time automatically:

opkg install ntpclient
ntpclient -s -h pool.ntp.org

If your FreeRunner is connecting to the internet through a USB host, make sure you allow UDP traffic to pass through on port 123 (NTP) on your host machine or you may get a "no route to host" error from ntpclient.

Have a look over over here where this process is automated whilst udhcpc is started, which happens automatically for wifi connections initiated by Mofi and friends.

Syncing the hardware clock

No matter which method you used above, sync the hardware clock with the system time to make your change persist over reboots:

hwclock --systohc

Note:
If you run the ASU or Qtopia image, hwclock will not work. The missing /dev/misc/rtc could be establish with

mkdir /dev/misc;
ln -s /dev/rtc /dev/misc/rtc

but the device is usually busy due to the atd daemon.
Instead you can use:

echo -e "W\n" > /var/spool/at/trigger

Here is a link from the community mailing list for using hwclock with the ASU image:

The last step is the actual syncing of the clock. For this, simply run the GPS Sight program from the main menu, wait for it to find the gps time and click the button labeled "Sync clock".

Future Work

Presumably it might also be possible to use gpspipe (or something else) to set the date once you have a gps fix automatically? In addition, the phone stack should set the date, time, and timezone once connected to a network.