LaFonera Software Heartbeat

From DD-WRT Wiki

Revision as of 17:13, 14 September 2007 by Pepsimax2k (Talk | contribs)
Jump to: navigation, search

You are here: DD-WRT wiki mainpage / LaFonera / Software / Heartbeat

The Fon heartbeat

This is the way to simulate the fon heartbeat, so that the LaFonera with dd-wrt is shown as active on the fon maps.

It is based on the work of freddy (http://fon.freddy.eu.org), futejia (http://futejia.blogspot.com) and krikkit (http://www.krikkit.net)


At first you have to register your LaFonera on www.fon.com

If you have done this successfully there are two ways you can enable it on maps.fon.com.

Fast and simple

This is the most easy way (This guide is also available on http://www.wildblue.de/fonera/heartbeat/howto). It is for simply putting your LaFonera on maps.fon.com without any need to set up your own WEBserver / FTPserver.


Version changed to 2.0.4. You have to update the code from this page on your LaFonera, everything else is done automatically.


made by wildblue!

Actual Version: 2.0.4

version 2.0.0 (modified for DD-WRT)   (md5 362706c581b9c7d1c1799d6936cde455)

version 2.0.1 (autodetection MAC)     (md5 dd9c50e0ff86c4ed87315d00a892a076)

version 2.0.2 (added cron mode)       (md5 c12695b038a37bf789477cd6864578f7)

version 2.0.3 (changed MAC-retrival)  (md5 15f4b146765511140b73f87eba7cfe12)

version 2.0.4 (changed update freq.)  (md5 0726ceba23bb4e3fbcca4ca02d443f41)

You can verify the md5 hashes with the linux-command "md5sum simthefon_2.0.x"

Feel free to ask me for an update of the code.


  1. Open the web-based configuration on your DD-WRT-Fonera (e.g. 192.168.1.1)
  2. Go to the "Administration" section, then to "Commands" (German: "Diagnose")
  3. paste the follwing commands and select "Save Startup" (German: "Startup speichern")
#!/bin/sh
mkdir /tmp/simthefon

echo '#!/bin/sh
sleep 30
cd /tmp/simthefon
/usr/bin/wget http://www.wildblue.de/fonera/heartbeat/key
/usr/bin/wget http://www.wildblue.de/fonera/heartbeat/simthefon
/usr/bin/wget http://www.wildblue.de/fonera/heartbeat/known_hosts
cat /tmp/simthefon/known_hosts >> /tmp/root/.ssh/known_hosts
chmod a+x /tmp/simthefon/simthefon
( /tmp/simthefon/simthefon cron >/tmp/simthefon/simthefon.log & ) &' >> /tmp/simthefon/heartbeat

echo 'SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/tmp/root

*/5 * * * * root /tmp/simthefon/simthefon cron >/tmp/simthefon/simthefon.log' >> /tmp/cron.d/heartbeat

chmod a+x /tmp/simthefon/heartbeat
/tmp/simthefon/heartbeat

stopservice cron && startservice cron


Alternative Hotspot Script

Having tried wildblue's 2.0.4 and previous scripts I've found that they don't show my own La Fonera as active the majority of the time. If it works for you then by all means keep using it, otherwise you can use the below method that works much better for me.

It is a modified version of freddy's thinclient script that uses cron to run and only downloads two files to the Fonera. To install, just copy and paste the following in to the commands box on the Administration > Commands tab in the web control panel, click Save Startup (ensuring non of wildblue's script remains) and reboot the router. If you think it will take longer for an internet connection to be established by the Fonera, just increase the sleep time (in seconds) that is currently set to 10 minutes. Also ensure that Cron is enabled on the Administration > Management tab.

#!/bin/sh

# wait until net connection established
sleep 600

# get heartbeat files
cd /tmp
wget http://www.inaudible.co.uk/perm/fonera/thinclient
wget http://fon.freddy.eu.org/heartbeat/fonkey
chmod 755 /tmp/thinclient

# start heartbeat script
/tmp/thinclient start

As mentioned, the script downloads from my personal web server a modified version of Freddy's original thinclient script ( http://fon.freddy.eu.org/heartbeat/thinclient ) using additional information from wildblue's simthefon script to make it work with the La Fonera, and also downloads freddy's original fonkey file from freddy's webserver.

Changes include "/jffs" changed to "/tmp", FONREV and FIRMWARE changed to the La Fonera's, DEVICE="fonera" added with extra device variables in exec_start_mode, and "| logger" replaced by >/dev/null to stop logging.