http://wiki.webos-internals.org/api.php?action=feedcontributions&user=Bkw&feedformat=atomWebOS Internals - User contributions [en]2024-03-28T15:12:24ZUser contributionsMediaWiki 1.35.1http://wiki.webos-internals.org/index.php?title=Application:Terminus&diff=8942Application:Terminus2010-02-07T01:36:52Z<p>Bkw: </p>
<hr />
<div>SDL/Evas/Ecore Terminal for Webos devices.<br />
<br />
[[Image:Icon_Terminus.png]]<br />
<br />
http://git.webos-internals.org/trac/terminus/wiki</div>Bkwhttp://wiki.webos-internals.org/index.php?title=Portal:Tools&diff=8269Portal:Tools2010-01-12T11:19:44Z<p>Bkw: </p>
<hr />
<div>__notoc__<br />
{{portal-header|<br />
This page lists tools used in any form.<br />
}}<br />
{{portal-two-columns<br />
|column1=<br />
== webOS Internal Related Tools ==<br />
<br />
* [[Getting started|Accessing Developer Mode]]<br />
* [[Backing_Up_via_Rsync|Backing Up via Rsync]]<br />
* [[Com Palm Appinstaller]]<br />
* [[Com Palm Downloadmanager|Com Palm Downloadmanager]] <br />
* [[Crond|Crond]]<br />
* [[Detecting Application Errors, Syslog|Detecting Application Errors, Syslog]] <br />
* [[Important_Personal_Data_Locations|Important Personal Data Locations]]<br />
<!--* [[/var/luna/data|/var/luna/data]]--><br />
* [[/usr/bin/lunaprop|/usr/bin/lunaprop]]<br />
* [[Java Services|Java Services]] <br />
* [[Luna Send|Luna Send]] <br />
* [[PalmDatabase.db3 File|PalmDatabase.db3 File]] <br />
<!--* [[mediadb.db3 File|mediadb.db3 File]]--><br />
<!--* [[fileindexer File|fileindexer File]]--><br />
* [[Profile.d|Profile.d]] <br />
* [[Tellbootie|Tellbootie]]<br />
* [[Webos Doctor Versions|Webos Doctor Versions]]<br />
<br />
==Cross-Compiling and Kernels==<br />
* [[Autobuilder Setup|Autobuilder Setup]]<br />
* [[WebOS Internals PDK]]<br />
* [[Cross Compiling|Cross Compiling]] <br />
* [[Custom Kernels|Custom Kernels]] <br />
* [[Optware Cross Compilation|Optware Cross Compilation]] <br />
* [[Building_a_cross_toolchain|Building a cross-toolchain for armv7 on Gentoo]]<br />
<br />
|column2=<br />
==SDK Related Tools ([[Comparison of Editors|Comparison Chart]]) ==<br />
<!-- Warning Do not edit the order of the top two editors (Eclipse and Komodo) --><br />
===Eclipse===<br />
<br />
[http://www.eclipse.org/downloads/ Eclipse] is the editor officially supported by Palm. You can find the Eclipse WebOS plugin [http://developer.palm.com/index.php?option=com_content&view=article&id=1639 here].<br />
<br />
===Komodo Edit===<br />
<br />
[http://www.activestate.com/komodo_edit/ Komodo Edit] is an easy to use cross platform open source editor. Use along side the webOS [http://www.webos.templarian.com/komodo/ Add-on] for easier development. Complete [http://www.webos.templarian.com/komodo/ Code Completion] is also available for Mojo. [[Komodo|Wiki Page with Screensots and Install Guide]].<br />
<br />
===Aptana Studio===<br />
<br />
[http://www.aptana.com/studio/download Aptana Studio] is a standalone version of an Eclipse plugin. Very easy to use. You can install the Aptana WebOS plugin by directing Aptana to check [https://cdn.downloads.palm.com/sdkdownloads/1.1/eclipse-plugin/eclipse-3.4/site.xml this link]. If you do not know how to set this up, please look at official Palm documentation [http://developer.palm.com/index.php?option=com_content&view=article&id=1639 here].<br />
}}</div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=6922Tutorials Linux DDNS Update Client wget2009-11-05T11:54:28Z<p>Bkw: add note about missing wget / misleading wget in title</p>
<hr />
<div>==Preamble==<br />
This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider), using only software that comes installed stock on the Pre (other than the small shell script you will write) and not requiring a daemon process running all the time to monitor the connection (other than pppd itself, which is what makes the connection in the first place, not anything extra).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a solution that doesn't require an always-on daemon or installing any additional software, this guide may be for you.<br />
<br />
There are many ddns service providers and most of them offer some way to update your ddns entry via URL.<br />
There are two main ways that a ddns service provider obtains your dynamic IP from you. Some providers use one way, some use the other way, some provide both methods and allow you to use whichever way is more convenient for you.<br />
<br />
* In one way, call it Type A, You submit an http request to a cgi on their server, and their server uses the IP that the request came from.<br />
<br />
One potential advantage to this method (for other environments besides the Pre) is that the url is static. It doesn't need any variables, and your script or program doesn't need to figure out what your current IP is when it runs. This can be good for PC's behind NAT routers that don't have a built-in ability to update your particular ddns service.<br />
<br />
However on the Pre this advantage is outweighed by the need to ensure that this request always goes out via the evdo connection even if you happen to be near a wifi access point which would be used otherwise. This is so that the ddns service always gets your evdo IP, never the IP of any wifi access points you might happen to be near at the time. The evdo connection is the only IP that will be useful for remotely accessing the Pre.<br />
<br />
To do that, on the Pre, we momentarily make the ppp0 connection the highest priority by adding a routing table entry just before updating the ddns service, and remove it immediately after. This does not affect any of the existing routing table entries of the moment, just temporarily supercedes them. So when we are done, things are safely & reliably left just as they were before the script ran.<br />
<br />
* In the other way, call it Type B, You submit an http request to a cgi on their server, and you supply the IP you want the ddns service to use, usually via query string arguments.<br />
If you have a choice, this method is optimal for the Pre since it allows us to take advantage of built in features of pppd and doesn't matter if the ppp0 (evdo) connection is currently the default or only route at that moment. (Doesn't matter if you happen to be near, and using, a wifi connection at the time the script runs.)<br />
<br />
If you have the option to use either method (such as with DynDNS.org), try to use Type B.<br><br />
In the particular case of the Pre, it's simpler and may be a little more reliable.<br><br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, novaproxy, or using the homebrew on-device Terminal app.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating.<br />
<br />
==Obtain the Update URL provided by your service==<br />
Some Type A examples:<br />
* [https://www.dyndns.com/developers/specs/syntax.html DynDNS.org/DynDNS.com]: <nowiki>http://username:password@members.dyndns.org/nic/update?hostname=yourhostname&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG</nowiki><br />
* [http://freedns.afraid.org afraid.org]: <nowiki>http://freedns.afraid.org/dynamic/update.php?XXXXXXXXXXXX</nowiki><br />
<br />
Some Type B examples:<br />
* [https://www.dyndns.com/developers/specs/syntax.html DynDNS.org/DynDNS.com]:<nowiki>http://username:password@members.dyndns.org/nic/update?hostname=yourhostname&myip=ipaddress&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG</nowiki><br />
* [http://www.dnsmadeeasy.com/s0306/res/ddnsc.html dnsmadeeasy] <nowiki>http://www.dnsmadeeasy.com/servlet/updateip?username=YOURUSERNAME&password=YOURPASSWORD&id=DNSRECORDID&ip=YOURIPADDRESS</nowiki><br />
* [https://joker.com/faq/content/11/427/en/what-is-dynamic-dns-dyndns.html?highlight=dynamic%20dns joker.com]: <nowiki>http://svc.joker.com/nic/update?username=YOURUSERNAME&password=YOURPASSWORD&hostname=YOURHOSTNAME&myip=YOURIPADDRESS</nowiki><br />
<br />
==Enable write access to the root file system==<br />
<nowiki>mount -o remount,rw /</nowiki><br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
pppd will do this for us automatically by creating a script in the /etc/ppp/ip-up.d/ directory called 09update-ddns. So,<br />
<nowiki>vi /etc/ppp/ip-up.d/09update-ddns</nowiki><br />
<br />
Then write whichever of these scripts applies to your provider.<br />
<br />
Type A:<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides $IFNAME and $IPREMOTE<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
curl -s --retry 6 "http://MYUSERNAME:MYPASSWORD@members.dyndns.org/nic/update?hostname=MYHOSTNAME&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG"<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
</nowiki><br />
<br />
Type B:<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides $IPLOCAL<br />
curl -s --retry 6 "http://MYUSERNAME:MYPASSWORD@members.dyndns.org/nic/update?hostname=MYHOSTNAME&myip=${IPLOCAL}&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG"<br />
</nowiki><br />
<br />
==Make this script executable==<br />
<nowiki>chmod 755 /etc/ppp/ip-up.d/09update-ddns</nowiki><br />
<br />
==Remount the root file system as readonly==<br />
<nowiki>mount -o remount,ro /</nowiki><br />
<br />
==Notes==<br />
* The title of this document says "wget" yet "wget" is not used anywhere in it.<br />
Wget on the Pre is just a busybox built-in and lacks the retry feature we need.<br />
Since curl is also shipped as a stock part of the Pre's OS, and since it's<br />
the full-featured real curl program including --retry,<br />
it's simpler and costs us nothing to just use that instead of writing a retry loop around the fake wget in the shell script.<br />
<br />
== ==<br />
* raeb<br />
* dreadchicken<br />
* [[User:Bkw|Bkw]] 13:09, 1 November 2009 (UTC)</div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=6818Tutorials Linux DDNS Update Client wget2009-11-01T13:09:05Z<p>Bkw: Clarify the two different types of ip update via url, provide more examples, remove the didn't-work section and just specify curl instead of wget from the outset.</p>
<hr />
<div>==Preamble==<br />
This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider), using only software that comes installed stock on the Pre (other than the small shell script you will write) and not requiring a daemon process running all the time to monitor the connection (other than pppd itself, which is what makes the connection in the first place, not anything extra).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a solution that doesn't require an always-on daemon or installing any additional software, this guide may be for you.<br />
<br />
There are many ddns service providers and most of them offer some way to update your ddns entry via URL.<br />
There are two main ways that a ddns service provider obtains your dynamic IP from you. Some providers use one way, some use the other way, some provide both methods and allow you to use whichever way is more convenient for you.<br />
<br />
* In one way, call it Type A, You submit an http request to a cgi on their server, and their server uses the IP that the request came from.<br />
<br />
One potential advantage to this method (for other environments besides the Pre) is that the url is static. It doesn't need any variables, and your script or program doesn't need to figure out what your current IP is when it runs. This can be good for PC's behind NAT routers that don't have a built-in ability to update your particular ddns service.<br />
<br />
However on the Pre this advantage is outweighed by the need to ensure that this request always goes out via the evdo connection even if you happen to be near a wifi access point which would be used otherwise. This is so that the ddns service always gets your evdo IP, never the IP of any wifi access points you might happen to be near at the time. The evdo connection is the only IP that will be useful for remotely accessing the Pre.<br />
<br />
To do that, on the Pre, we momentarily make the ppp0 connection the highest priority by adding a routing table entry just before updating the ddns service, and remove it immediately after. This does not affect any of the existing routing table entries of the moment, just temporarily supercedes them. So when we are done, things are safely & reliably left just as they were before the script ran.<br />
<br />
* In the other way, call it Type B, You submit an http request to a cgi on their server, and you supply the IP you want the ddns service to use, usually via query string arguments.<br />
If you have a choice, this method is optimal for the Pre since it allows us to take advantage of built in features of pppd and doesn't matter if the ppp0 (evdo) connection is currently the default or only route at that moment. (Doesn't matter if you happen to be near, and using, a wifi connection at the time the script runs.)<br />
<br />
If you have the option to use either method (such as with DynDNS.org), try to use Type B.<br><br />
In the particular case of the Pre, it's simpler and may be a little more reliable.<br><br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, novaproxy, or using the homebrew on-device Terminal app.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating.<br />
<br />
==Obtain the Update URL provided by your service==<br />
Some Type A examples:<br />
* [https://www.dyndns.com/developers/specs/syntax.html DynDNS.org/DynDNS.com]: <nowiki>http://username:password@members.dyndns.org/nic/update?hostname=yourhostname&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG</nowiki><br />
* [http://freedns.afraid.org afraid.org]: <nowiki>http://freedns.afraid.org/dynamic/update.php?XXXXXXXXXXXX</nowiki><br />
<br />
Some Type B examples:<br />
* [https://www.dyndns.com/developers/specs/syntax.html DynDNS.org/DynDNS.com]:<nowiki>http://username:password@members.dyndns.org/nic/update?hostname=yourhostname&myip=ipaddress&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG</nowiki><br />
* [http://www.dnsmadeeasy.com/s0306/res/ddnsc.html dnsmadeeasy] <nowiki>http://www.dnsmadeeasy.com/servlet/updateip?username=YOURUSERNAME&password=YOURPASSWORD&id=DNSRECORDID&ip=YOURIPADDRESS</nowiki><br />
* [https://joker.com/faq/content/11/427/en/what-is-dynamic-dns-dyndns.html?highlight=dynamic%20dns joker.com]: <nowiki>http://svc.joker.com/nic/update?username=YOURUSERNAME&password=YOURPASSWORD&hostname=YOURHOSTNAME&myip=YOURIPADDRESS</nowiki><br />
<br />
==Enable write access to the root file system==<br />
<nowiki>mount -o remount,rw /</nowiki><br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
pppd will do this for us automatically by adding a script in the /etc/ppp/ip-up.d/ directory called 09update-ddns. So,<br />
<nowiki>vi /etc/ppp/ip-up.d/09update-ddns</nowiki><br />
<br />
Then write whichever of these scripts applies to your provider.<br />
<br />
Type A:<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides $IFNAME and $IPREMOTE<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
curl --retry 6 "http://MYUSERNAME:MYPASSWORD@members.dyndns.org/nic/update?hostname=MYHOSTNAME&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG"<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
</nowiki><br />
<br />
Type B:<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides $IPLOCAL<br />
curl --retry 6 "http://MYUSERNAME:MYPASSWORD@members.dyndns.org/nic/update?hostname=MYHOSTNAME&myip=${IPLOCAL}&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG"<br />
</nowiki><br />
<br />
==Make this script executable==<br />
<nowiki>chmod 755 /etc/ppp/ip-up.d/09update-ddns</nowiki><br />
<br />
==Remount the root file system as readonly==<br />
<nowiki>mount -o remount,ro /</nowiki><br />
<br />
== ==<br />
* raeb<br />
* dreadchicken<br />
* [[User:Bkw|Bkw]] 13:09, 1 November 2009 (UTC)</div>Bkwhttp://wiki.webos-internals.org/index.php?title=Patch_webOS_CPU_Frequency_or_Voltage_Scaling&diff=5740Patch webOS CPU Frequency or Voltage Scaling2009-09-15T00:02:31Z<p>Bkw: /* Comments and Caveats */</p>
<hr />
<div>{{template:patch}}<br />
= Overview=<br />
There are currently 2 methods to enable further power saving - neither is perfect. Note that '''these 2 methods CANNOT be used together''' so make sure you try only one solution at a time. Using both has been reported to brick your Pre, requiring a visit to the WebOS Doctor. Patches for these are now available in the gitorious repo. See [[Applying Patches]]<br />
<br />
1 CPU Scaling<br />
* This allows the Pre to scale the CPU clock speed up and down in response to changes in CPU utilization. Some people have reported glitching when using scaling when the CPU is under heavy load (lots of multitasking, playing video, etc).<br />
2 SmartReflex<br />
* This allows the Pre to vary the voltage inside the core in response to silicon characteristics, temperature, voltage, etc. This does not save that much power because it is supposed to be used along with CPU scaling to reduce voltage when the CPU is running slower, but the Pre's kernel is missing the modules to do this. This is why using both together will '''freeze''' the Palm Pre. (Remove the battery, restart with the USB plugged into your computer with NovaCom installed, During the phones boot procedure simply telnet to the phone through NovaCom's Proxy port 8023, remove the smartreflex files you installed in the events folder in /etc/ before WebOS panics) <br />
<br />
= CPU Scaling=<br />
== Default Setting==<br />
Frequency scaling does not appear to be active by default on the Pre by default. The directory /sys/devices/system/cpu/cpu0/cpufreq contains information on the current state. The clock seems to be fixed at 500mHz for normal operation (according to cpuinfo_cur_freq), however several other frequencies exist:<br />
<pre><nowiki><br />
root@castle:/sys/devices/system/cpu/cpu0/cpufreq# cat ./scaling_available_frequencies <br />
600000 550000 500000 250000 125000 <br />
</nowiki></pre><br />
The file /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state shows that at some point (probably during startup) the frequency is raised to 550mHz for a short period of time.<br />
<br />
<br />
<br />
== Enabling Scaling==<br />
It is possible to enable frequency scaling using the 'ondemand' governor:<br />
<pre><nowiki><br />
root@castle:/sys/devices/system/cpu/cpu0/cpufreq# echo ondemand > ./scaling_governor <br />
</nowiki></pre><br />
this will cause the frequency to be reduced automatically while idle, and increased as needed during operation, potentially increasing battery life. Because higher frequencies may cause overheating, and TI has noted a significant decrease in the life of the processor when running above 500mHz, you should also restrict the frequency scaling to 500mHz and below by doing the following:<br />
<pre><nowiki><br />
root@castle:/sys/devices/system/cpu/cpu0/cpufreq# echo 500000 > ./scaling_max_freq<br />
</nowiki></pre><br />
If your Pre seems sluggish after enabling scaling, you can try changing the values in /sys/devices/system/cpu/cpu0/cpufreq/ondemand as detailed below.<br />
<br />
<br />
<br />
== 'ondemand' Configuration==<br />
Increasing the value of 'scaling_min_freq' will prevent the CPU from going into extremely low speed configurations, which will significantly improve the responsiveness of the device when it first detects increased CPU usage, at the cost of a little bit of battery life.<br />
<pre><nowiki><br />
root@castle:/sys/devices/system/cpu/cpu0/cpufreq# echo 250000 > ./scaling_min_freq<br />
</nowiki></pre><br />
Setting the value of 'up_threshold' lower will cause the frequency to be increased at lower levels of activity.<br />
<pre><nowiki><br />
root@castle:/sys/devices/system/cpu/cpu0/cpufreq/ondemand# echo 30 > ./up_threshold<br />
</nowiki></pre><br />
Note: The default setting for 'up_threshold' is 80.<br />
<br />
<br />
<br />
== Checking Performance and Stats==<br />
To check how long your Pre has been running and at what frequency, do this:<br />
<br />
<pre><nowiki>cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state</nowiki></pre><br />
<br />
You will see something like this:<br />
<pre><nowiki>600000 906<br />
550000 768<br />
500000 380<br />
250000 0<br />
125000 180505</nowiki></pre><br />
<br />
The first number is the CPU frequency, the second is a time interval. In this example, my Pre has spent the most time @ 125mHz, but you can see it shoots up when needed. Note that if you are overclocking, it really doesn't spend much time at 600mHz, so overheating shouldn't be a problem, but you will definitely notice an improvement. These stats are reset after a reboot.<br />
<br />
== Overclocking==<br />
Overclocking is not recommended, as TI has reported a significant decrease in the life of the CPU at frequencies about 500mHz. However some users have reported better responsiveness, in addition to running cooler and using less battery while overclocking.<br />
<br />
To overclock to the CPU's maximum speed, do:<br />
<pre><nowiki>echo "600000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq</nowiki></pre><br />
<br />
To put it back, do:<br />
<pre><nowiki>echo "500000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq</nowiki></pre><br />
<br />
<br />
<br />
== Making your changes stick after a reboot==<br />
Create a file called '''cpu-scaling''' in /etc/event.d and put this code in it, then reboot.<br />
<pre><nowiki><br />
# Enables cpu scaling<br />
<br />
start on stopped finish<br />
stop on runlevel [!2]<br />
<br />
console none<br />
<br />
script<br />
echo "500000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq<br />
echo "250000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq<br />
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor<br />
echo "30" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold<br />
end script<br />
</nowiki></pre><br />
<br />
<br />
<br />
== Return to Stock Fixed Frequency==<br />
The simple way is just to remove the '''cpu-scaling''' script from /etc/event.d (if you created it) and reboot. None of these changes are persistent without the "sticky" script shown above.<br />
<br />
If you switch back to the 'userspace' governor without rebooting, your frequency could get stuck at a lower setting and the whole system get really bogged down. Here is a quick shell script to help you revert to userspace with the original frequency:<br />
<br />
Copy/paste this whole line as one command:<br />
<pre><nowiki>echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ; echo 500000 >/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed </nowiki></pre><br />
Then confirm the frequency/governor are back the way you want.<br />
<br />
<br />
== Comments and Caveats==<br />
* "I tried this out but video playback was flickery and horrible. The up_threshold tweak setting to 30 seems to improve it a lot , but it's still flickery a bit. Some people may not be happy."<br />
<br />
* "I found that setting the max freq to 600000 with the threshold helps this problem. See relevant warnings above first! I don't really watch video on my Pre, so it's not so big of a deal." -pEEf<br />
<br />
* "A lot of people on the Precentral forums (myself included) are experiencing the phone locking up after a while of using this, and need to pull the battery to reset. (On webOS 1.0.3 at least.)"<br />
<br />
* "I've been running my phone with scaling for nearly a week now without problems, but I'm not 'overlcocking' so to speak. Any specifics on what might cause the locks? (ok had my first locks tonight while attached to the touchstone, weird it never happened before now (and annoying))" -retry<br />
<br />
<br />
= SmartReflex=<br />
== Enable SmartReflex==<br />
SmartReflex can be enabled in the VDD1 and VDD2 areas of the OMAP processor by setting two flags under /sys/power<br />
<pre><nowiki><br />
root@castle:/sys/power# echo -n 1 > ./sr_vdd1_autocomp<br />
root@castle:/sys/power# echo -n 1 > ./sr_vdd2_autocomp<br />
</nowiki></pre><br />
[http://www.celinux.org/elc08_presentations/TI_OMAP3430_Linux_PM_reference.ppt This slide deck] has much of the pertinent information about SmartReflex and other power-saving technologies on the OMAP processor. Unfortunately the kernel modules that provide many of the features mentioned in the slide deck are not present on the Pre. This is the main reason that SmartReflex may not save a terribly large amount of power.<br />
<br />
<br />
== Making your changes stick after a reboot==<br />
To enable SmartReflex, create a file called '''smartreflex''' in /etc/event.d and put this code in it, then reboot.<br />
<pre><nowiki><br />
# -*- mode: shell-script; -*-<br />
description "SmartReflex"<br />
author "Alex Markson"<br />
version 1.0<br />
<br />
start on stopped finish<br />
stop on runlevel [!2]<br />
<br />
console none<br />
<br />
script<br />
<br />
# SmartReflex<br />
# "SmartReflex™ driver allows for auto-compensation of VDD1 and<br />
# VDD2 voltages (around the voltages specified by current OPP)<br />
# by analyzing the silicon characteristics, temperature, voltage etc"<br />
# <br />
# Enable SmartReflex<br />
echo -n 1 > /sys/power/sr_vdd1_autocomp<br />
echo -n 1 > /sys/power/sr_vdd2_autocomp<br />
<br />
end script<br />
</nowiki></pre><br />
<br />
If you want to enable overclocking in addition to SmartReflex, add the following JUST BEFORE the '''end script''' line:<br />
<pre><nowiki><br />
# according to the OEM shell script in /etc/miniboot.sh<br />
# this seems like it needs to be set twice to make sure ?<br />
echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed<br />
echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed<br />
</nowiki></pre><br />
<br />
<br />
== Comments and Caveats==<br />
* "After updating to 1.0.4 my pre would lock up and get really hot using the ONDEMAND cpu scaling method and with smartflex everything running great and battery seems even better than ondemand." -seekis<br />
* "AFter using this for about a week, I find that using SmartReflex causes the Pre to stutter every so often"<br />
* "webos 1.1 w/ no problems to start. Installed ondemand script, full 125-600mhz range, threshold 30: worked fine mostly but on the touchstone it gets hot and locks up kills battery, backlight on behind black screen, every time, within an hour. Switched to smartreflex with 600mhz, no problems, though only a few days so far and no video testing. Media player remix playing to car stereo via bluetooth is smooth." [[User:Bkw|Bkw]] 00:02, 15 September 2009 (UTC)<br />
<br />
= Credits=<br />
* Alex Markson for the SmartReflex find and the script.<br />
* pEEf for numerous discoveries related to cpu scaling.<br />
* sidamos for the info about 'up_threshold'<br />
* garrettwp for the cpu scaling event.d script.<br />
* Jauder Ho for gitorious patches<br />
<br />
= Hacking=<br />
There is still a lot of work to be done in making this work optimally. The following are some resources and thoughts.<br />
* A paper about the ondemand governor http://www.linuxinsight.com/ols2006_the_ondemand_governor.html<br />
* webOS 1.0.4 has CONFIG_PREEMPT set along with CONFIG_HZ=100. CONFIG_NO_HZ aka tickless is not set.<br />
* Possible patch for NOHZ / ondemand governor http://linux.derkeiler.com/Mailing-Lists/Kernel/2009-05/msg10436.html<br />
* Use PowerTop to observe what is going on inside the Pre<br />
* http://www.lesswatts.org/<br />
* http://wiki.davincidsp.com/index.php/Running_PowerTOP_on_OMAP35x_platform<br />
* TI 3430 PM presentation http://www.celinux.org/elc08_presentations/TI_OMAP3430_Linux_PM_reference.ppt</div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=5618Tutorials Linux DDNS Update Client wget2009-09-10T04:41:11Z<p>Bkw: /* It didn't work. What else can I try? */</p>
<hr />
<div>This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a freedns.afraid.org solution that doesn't require an always-on daemon, this guide may be for you.<br />
<br />
This mechanism functions by adding a priority default routing rule that forces all traffic to go over the ppp0 (EV-DO) connection. This ensures we're updating your service with your ppp0 ip and not your eth0 (Wifi) ip. It optionally then finds your IP address from http://checkip.dyndns.org. Then, it calls your update URL. Finally, it removes the default route it created in step 1.<br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, or novaproxy.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating (i.e. http://freedns.afraid.org)<br />
<br />
==Enabling write access to the file system==<br />
mount -o remount,rw /<br />
<br />
==Obtain the Update URL provided by your service==<br />
For http://freedns.afraid.org, log in, and find the 'Direct Update URL' for your dynamic DNS entry. Mine looks like this:<br />
<nowiki>http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==</nowiki><br />
<br />
This updates the IP of my DNS entry to the IP of the client. We need to make sure we call this address from the ppp0 interface so that it updates to the correct IP. When the Pre is connected to a wifi connection, a default routing entry forces all data to go over that connection.<br />
<br />
However, your service may differ, and require different information (example):<br />
<nowiki>http://mydynamicdnsservice.com/?host=myhost.com&Ip=99.123.222.101</nowiki><br />
<br />
This example doesn't require the caller to be from the new target IP address, and won't need the routing entries.<br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
You can do this by adding a script to /etc/ppp/ip-up.d called 09update-ddns.<br />
<br />
This is the script for the first example:<br><br />
Use this one if you don't get to or don't want to submit an IP arbitrarily, and your dynamic dns service just uses whatever IP the http request came from.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IFNAME and IPREMOTE for us<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
wget -qO- http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
</nowiki><br />
<br />
This is the script for the second example:<br><br />
Use this one if you need to or want to supply the IP yourself to the dynamic dns service.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
wget -qO- http://mydynamicdnsservice.com/?host=myhost.com&Ip=$IPLOCAL<br />
</nowiki><br />
<br />
==Make this script executable==<br />
<nowiki><br />
chmod 755 /etc/ppp/ip-up.d/09update-ddns<br />
</nowiki><br />
<br />
Also note that curl is also installed. Wget is a faster and lighter and works in most cases, but curl can do more and harder things than wget so it's something to remember if you want to hit some web pages that weren't necessarily designed to be accessed non-interactively.<br />
<br />
==Remount the file system as readonly==<br />
mount -o remount,ro /<br />
<br />
==It didn't work. What else can I try?==<br />
<br />
Try adding some debugging to the script.<br />
It wasn't working for me so I did this, capture the environment set up by pppd and the output of wget to a file.<br />
<br />
<nowiki><br />
#!/bin/sh<br />
L=/media/internal/ppp_env.txt<br />
set >$L<br />
wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
Then after down/up the evdo connection, get back in and look at that ppp_env.txt file, and it showed me that wget couldn't resolve my dyndns service providers web site:<br />
<br />
<nowiki><br />
less /media/internal/ppp_env.txt<br />
[...]<br />
wget: bad address 'svc.joker.com'<br />
</nowiki><br />
<br />
Most likely it's just being called too soon after the connection is formed, and it just needs to retry a few times, with a delay between retries.<br />
Real wget has such retry & wait options, but the stock wget on the Pre is just the busybox built-in and it doesn't have any of those options.<br />
<br />
You could write a retry loop in the shell script to re-run the same wget command a few times, but, the Pre does also ship with a full-featured standalone version of curl which you could use instead of wget, and take advantage of curls retry options:<br />
<br />
<nowiki><br />
#wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
curl --retry 6 http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
And voila. That fixed it for me. So now just remove the debugging:<br />
<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
curl -s --retry 6 "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}"<br />
</nowiki><br />
<br />
== ==<br />
* raeb<br />
* dreadchicken<br />
* [[User:Bkw|Bkw]] 04:24, 10 September 2009 (UTC)</div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=5617Tutorials Linux DDNS Update Client wget2009-09-10T04:28:55Z<p>Bkw: /* Obtain the Update URL provided by your service */</p>
<hr />
<div>This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a freedns.afraid.org solution that doesn't require an always-on daemon, this guide may be for you.<br />
<br />
This mechanism functions by adding a priority default routing rule that forces all traffic to go over the ppp0 (EV-DO) connection. This ensures we're updating your service with your ppp0 ip and not your eth0 (Wifi) ip. It optionally then finds your IP address from http://checkip.dyndns.org. Then, it calls your update URL. Finally, it removes the default route it created in step 1.<br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, or novaproxy.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating (i.e. http://freedns.afraid.org)<br />
<br />
==Enabling write access to the file system==<br />
mount -o remount,rw /<br />
<br />
==Obtain the Update URL provided by your service==<br />
For http://freedns.afraid.org, log in, and find the 'Direct Update URL' for your dynamic DNS entry. Mine looks like this:<br />
<nowiki>http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==</nowiki><br />
<br />
This updates the IP of my DNS entry to the IP of the client. We need to make sure we call this address from the ppp0 interface so that it updates to the correct IP. When the Pre is connected to a wifi connection, a default routing entry forces all data to go over that connection.<br />
<br />
However, your service may differ, and require different information (example):<br />
<nowiki>http://mydynamicdnsservice.com/?host=myhost.com&Ip=99.123.222.101</nowiki><br />
<br />
This example doesn't require the caller to be from the new target IP address, and won't need the routing entries.<br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
You can do this by adding a script to /etc/ppp/ip-up.d called 09update-ddns.<br />
<br />
This is the script for the first example:<br><br />
Use this one if you don't get to or don't want to submit an IP arbitrarily, and your dynamic dns service just uses whatever IP the http request came from.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IFNAME and IPREMOTE for us<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
wget -qO- http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
</nowiki><br />
<br />
This is the script for the second example:<br><br />
Use this one if you need to or want to supply the IP yourself to the dynamic dns service.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
wget -qO- http://mydynamicdnsservice.com/?host=myhost.com&Ip=$IPLOCAL<br />
</nowiki><br />
<br />
==Make this script executable==<br />
<nowiki><br />
chmod 755 /etc/ppp/ip-up.d/09update-ddns<br />
</nowiki><br />
<br />
Also note that curl is also installed. Wget is a faster and lighter and works in most cases, but curl can do more and harder things than wget so it's something to remember if you want to hit some web pages that weren't necessarily designed to be accessed non-interactively.<br />
<br />
==Remount the file system as readonly==<br />
mount -o remount,ro /<br />
<br />
==It didn't work. What else can I try?==<br />
<br />
Try adding some debugging to the script.<br />
It wasn't working for me so I did this, capture the environment set up by pppd and the output of wget to a file.<br />
<br />
<nowiki><br />
#!/bin/sh<br />
L=/media/internal/ppp_env.txt<br />
set >$L<br />
wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
Then after down/up the evdo connection, get back in and look at that ppp_env.txt file, and it showed me that wget couldn't resolve my dyndns service providers web site:<br />
<br />
<nowiki><br />
less /media/internal/ppp_env.txt<br />
[...]<br />
wget: bad address 'svc.joker.com'<br />
</nowiki><br />
<br />
Most likely it's just being called too soon after the connection is formed, and it just needs to retry a few times, with a delay between retries.<br />
Real wget has such retry & wait options, but the stock wget on the Pre is just the busybox built-in and it doesn't have any of those options.<br />
<br />
You could write a retry loop in the shell script to re-run the same wget command a few times, but, the Pre does also ship with a full-featured standalone version of curl which you could use instead of wget, and take advantage of curls retry options:<br />
<br />
<nowiki><br />
#wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
curl --retry 6 http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
And voila. That fixed it for me. So now just remove the debugging:<br />
(Commented out the L=..., set >..., and the >>$L ... at the end of the curl command<br />
and added "-s" to the curl options)<br />
<br />
<nowiki><br />
#!/bin/sh<br />
#L=/media/internal/ppp_env.txt<br />
#set >$L<br />
curl -s --retry 6 "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" # >>$L 2>&1<br />
</nowiki><br />
<br />
== ==<br />
* raeb<br />
* dreadchicken<br />
* [[User:Bkw|Bkw]] 04:24, 10 September 2009 (UTC)</div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=5616Tutorials Linux DDNS Update Client wget2009-09-10T04:26:08Z<p>Bkw: /* It didn't work. What else can I try? */</p>
<hr />
<div>This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a freedns.afraid.org solution that doesn't require an always-on daemon, this guide may be for you.<br />
<br />
This mechanism functions by adding a priority default routing rule that forces all traffic to go over the ppp0 (EV-DO) connection. This ensures we're updating your service with your ppp0 ip and not your eth0 (Wifi) ip. It optionally then finds your IP address from http://checkip.dyndns.org. Then, it calls your update URL. Finally, it removes the default route it created in step 1.<br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, or novaproxy.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating (i.e. http://freedns.afraid.org)<br />
<br />
==Enabling write access to the file system==<br />
mount -o remount,rw /<br />
<br />
==Obtain the Update URL provided by your service==<br />
For http://freedns.afraid.org, log in, and find the 'Direct Update URL' for your dynamic DNS entry. Mine looks like this:<br />
http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
<br />
This updates the IP of my DNS entry to the IP of the client. We need to make sure we call this address from the ppp0 interface so that it updates to the correct IP. When the Pre is connected to a wifi connection, a default routing entry forces all data to go over that connection.<br />
<br />
However, your service may differ, and require different information (example):<br />
http://mydynamicdnsservice.com/?host=myhost.com&Ip=99.123.222.101<br />
<br />
<br />
This example doesn't require the caller to be from the new target IP address, and won't need the routing entries.<br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
You can do this by adding a script to /etc/ppp/ip-up.d called 09update-ddns.<br />
<br />
This is the script for the first example:<br><br />
Use this one if you don't get to or don't want to submit an IP arbitrarily, and your dynamic dns service just uses whatever IP the http request came from.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IFNAME and IPREMOTE for us<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
wget -qO- http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
</nowiki><br />
<br />
This is the script for the second example:<br><br />
Use this one if you need to or want to supply the IP yourself to the dynamic dns service.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
wget -qO- http://mydynamicdnsservice.com/?host=myhost.com&Ip=$IPLOCAL<br />
</nowiki><br />
<br />
==Make this script executable==<br />
<nowiki><br />
chmod 755 /etc/ppp/ip-up.d/09update-ddns<br />
</nowiki><br />
<br />
Also note that curl is also installed. Wget is a faster and lighter and works in most cases, but curl can do more and harder things than wget so it's something to remember if you want to hit some web pages that weren't necessarily designed to be accessed non-interactively.<br />
<br />
==Remount the file system as readonly==<br />
mount -o remount,ro /<br />
<br />
==It didn't work. What else can I try?==<br />
<br />
Try adding some debugging to the script.<br />
It wasn't working for me so I did this, capture the environment set up by pppd and the output of wget to a file.<br />
<br />
<nowiki><br />
#!/bin/sh<br />
L=/media/internal/ppp_env.txt<br />
set >$L<br />
wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
Then after down/up the evdo connection, get back in and look at that ppp_env.txt file, and it showed me that wget couldn't resolve my dyndns service providers web site:<br />
<br />
<nowiki><br />
less /media/internal/ppp_env.txt<br />
[...]<br />
wget: bad address 'svc.joker.com'<br />
</nowiki><br />
<br />
Most likely it's just being called too soon after the connection is formed, and it just needs to retry a few times, with a delay between retries.<br />
Real wget has such retry & wait options, but the stock wget on the Pre is just the busybox built-in and it doesn't have any of those options.<br />
<br />
You could write a retry loop in the shell script to re-run the same wget command a few times, but, the Pre does also ship with a full-featured standalone version of curl which you could use instead of wget, and take advantage of curls retry options:<br />
<br />
<nowiki><br />
#wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
curl --retry 6 http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
And voila. That fixed it for me. So now just remove the debugging:<br />
(Commented out the L=..., set >..., and the >>$L ... at the end of the curl command<br />
and added "-s" to the curl options)<br />
<br />
<nowiki><br />
#!/bin/sh<br />
#L=/media/internal/ppp_env.txt<br />
#set >$L<br />
curl -s --retry 6 "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" # >>$L 2>&1<br />
</nowiki><br />
<br />
== ==<br />
* raeb<br />
* dreadchicken<br />
* [[User:Bkw|Bkw]] 04:24, 10 September 2009 (UTC)</div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=5615Tutorials Linux DDNS Update Client wget2009-09-10T04:25:07Z<p>Bkw: /* attributions */</p>
<hr />
<div>This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a freedns.afraid.org solution that doesn't require an always-on daemon, this guide may be for you.<br />
<br />
This mechanism functions by adding a priority default routing rule that forces all traffic to go over the ppp0 (EV-DO) connection. This ensures we're updating your service with your ppp0 ip and not your eth0 (Wifi) ip. It optionally then finds your IP address from http://checkip.dyndns.org. Then, it calls your update URL. Finally, it removes the default route it created in step 1.<br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, or novaproxy.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating (i.e. http://freedns.afraid.org)<br />
<br />
==Enabling write access to the file system==<br />
mount -o remount,rw /<br />
<br />
==Obtain the Update URL provided by your service==<br />
For http://freedns.afraid.org, log in, and find the 'Direct Update URL' for your dynamic DNS entry. Mine looks like this:<br />
http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
<br />
This updates the IP of my DNS entry to the IP of the client. We need to make sure we call this address from the ppp0 interface so that it updates to the correct IP. When the Pre is connected to a wifi connection, a default routing entry forces all data to go over that connection.<br />
<br />
However, your service may differ, and require different information (example):<br />
http://mydynamicdnsservice.com/?host=myhost.com&Ip=99.123.222.101<br />
<br />
<br />
This example doesn't require the caller to be from the new target IP address, and won't need the routing entries.<br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
You can do this by adding a script to /etc/ppp/ip-up.d called 09update-ddns.<br />
<br />
This is the script for the first example:<br><br />
Use this one if you don't get to or don't want to submit an IP arbitrarily, and your dynamic dns service just uses whatever IP the http request came from.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IFNAME and IPREMOTE for us<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
wget -qO- http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
</nowiki><br />
<br />
This is the script for the second example:<br><br />
Use this one if you need to or want to supply the IP yourself to the dynamic dns service.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
wget -qO- http://mydynamicdnsservice.com/?host=myhost.com&Ip=$IPLOCAL<br />
</nowiki><br />
<br />
==Make this script executable==<br />
<nowiki><br />
chmod 755 /etc/ppp/ip-up.d/09update-ddns<br />
</nowiki><br />
<br />
Also note that curl is also installed. Wget is a faster and lighter and works in most cases, but curl can do more and harder things than wget so it's something to remember if you want to hit some web pages that weren't necessarily designed to be accessed non-interactively.<br />
<br />
==Remount the file system as readonly==<br />
mount -o remount,ro /<br />
<br />
==It didn't work. What else can I try?==<br />
<br />
Try adding some debugging to the script.<br />
It wasn't working for me so I did this, capture the environment set up by pppd and the output of wget to a file.<br />
<br />
<nowiki><br />
#!/bin/sh<br />
L=/media/internal/ppp_env.txt<br />
set >$L<br />
wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
Then after down/up the evdo connection, get back in and look at that ppp_env.txt file, and it showed me that wget couldn't resolve my dyndns service providers web site:<br />
<br />
<nowiki><br />
less /media/internal/ppp_env.txt<br />
[...]<br />
wget: bad address 'svc.joker.com'<br />
</nowiki><br />
<br />
Most likely it's just being called too soon after the connection is formed, and it just needs to retry a few times, with a delay between retries.<br />
Real wget has such retry & wait options, but the stock wget on the Pre is just the busybox built-in and it doesn't have any of those options.<br />
<br />
You could write a retry loop in the shell script to re-run the same wget command a few times, but, the Pre does also ship with a full-featured standalone version of curl which you could use instead of wget, and take advantage of curls retry options:<br />
<br />
<nowiki><br />
#wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
curl --retry 6 http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
And voila. That fixed it for me. So now just remove the debugging:<br />
(Commented out the L=..., set >..., and the >>$L ... at the end of the curl command<br />
and added "-s" to the curl options)<br />
<br />
<nowiki><br />
#!/bin/sh<br />
#L=/media/internal/ppp_env.txt<br />
#set >$L<br />
curl -s --retry 6 "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" # >>$L 2>&1<br />
</nowiki><br />
<br />
----<br />
* raeb<br />
* dreadchicken<br />
* [[User:Bkw|Bkw]] 04:24, 10 September 2009 (UTC)</div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=5614Tutorials Linux DDNS Update Client wget2009-09-10T04:24:01Z<p>Bkw: </p>
<hr />
<div>This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a freedns.afraid.org solution that doesn't require an always-on daemon, this guide may be for you.<br />
<br />
This mechanism functions by adding a priority default routing rule that forces all traffic to go over the ppp0 (EV-DO) connection. This ensures we're updating your service with your ppp0 ip and not your eth0 (Wifi) ip. It optionally then finds your IP address from http://checkip.dyndns.org. Then, it calls your update URL. Finally, it removes the default route it created in step 1.<br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, or novaproxy.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating (i.e. http://freedns.afraid.org)<br />
<br />
==Enabling write access to the file system==<br />
mount -o remount,rw /<br />
<br />
==Obtain the Update URL provided by your service==<br />
For http://freedns.afraid.org, log in, and find the 'Direct Update URL' for your dynamic DNS entry. Mine looks like this:<br />
http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
<br />
This updates the IP of my DNS entry to the IP of the client. We need to make sure we call this address from the ppp0 interface so that it updates to the correct IP. When the Pre is connected to a wifi connection, a default routing entry forces all data to go over that connection.<br />
<br />
However, your service may differ, and require different information (example):<br />
http://mydynamicdnsservice.com/?host=myhost.com&Ip=99.123.222.101<br />
<br />
<br />
This example doesn't require the caller to be from the new target IP address, and won't need the routing entries.<br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
You can do this by adding a script to /etc/ppp/ip-up.d called 09update-ddns.<br />
<br />
This is the script for the first example:<br><br />
Use this one if you don't get to or don't want to submit an IP arbitrarily, and your dynamic dns service just uses whatever IP the http request came from.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IFNAME and IPREMOTE for us<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
wget -qO- http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
</nowiki><br />
<br />
This is the script for the second example:<br><br />
Use this one if you need to or want to supply the IP yourself to the dynamic dns service.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
wget -qO- http://mydynamicdnsservice.com/?host=myhost.com&Ip=$IPLOCAL<br />
</nowiki><br />
<br />
==Make this script executable==<br />
<nowiki><br />
chmod 755 /etc/ppp/ip-up.d/09update-ddns<br />
</nowiki><br />
<br />
Also note that curl is also installed. Wget is a faster and lighter and works in most cases, but curl can do more and harder things than wget so it's something to remember if you want to hit some web pages that weren't necessarily designed to be accessed non-interactively.<br />
<br />
==Remount the file system as readonly==<br />
mount -o remount,ro /<br />
<br />
==It didn't work. What else can I try?==<br />
<br />
Try adding some debugging to the script.<br />
It wasn't working for me so I did this, capture the environment set up by pppd and the output of wget to a file.<br />
<br />
<nowiki><br />
#!/bin/sh<br />
L=/media/internal/ppp_env.txt<br />
set >$L<br />
wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
Then after down/up the evdo connection, get back in and look at that ppp_env.txt file, and it showed me that wget couldn't resolve my dyndns service providers web site:<br />
<br />
<nowiki><br />
less /media/internal/ppp_env.txt<br />
[...]<br />
wget: bad address 'svc.joker.com'<br />
</nowiki><br />
<br />
Most likely it's just being called too soon after the connection is formed, and it just needs to retry a few times, with a delay between retries.<br />
Real wget has such retry & wait options, but the stock wget on the Pre is just the busybox built-in and it doesn't have any of those options.<br />
<br />
You could write a retry loop in the shell script to re-run the same wget command a few times, but, the Pre does also ship with a full-featured standalone version of curl which you could use instead of wget, and take advantage of curls retry options:<br />
<br />
<nowiki><br />
#wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
curl --retry 6 http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
And voila. That fixed it for me. So now just remove the debugging:<br />
(Commented out the L=..., set >..., and the >>$L ... at the end of the curl command<br />
and added "-s" to the curl options)<br />
<br />
<nowiki><br />
#!/bin/sh<br />
#L=/media/internal/ppp_env.txt<br />
#set >$L<br />
curl -s --retry 6 "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" # >>$L 2>&1<br />
</nowiki><br />
<br />
==attributions==<br />
* raeb<br />
* dreadchicken<br />
* [[User:Bkw|Bkw]] 04:24, 10 September 2009 (UTC)</div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=5613Tutorials Linux DDNS Update Client wget2009-09-10T04:17:44Z<p>Bkw: /* Remount the file system as readonly */</p>
<hr />
<div>This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a freedns.afraid.org solution that doesn't require an always-on daemon, this guide may be for you.<br />
<br />
This mechanism functions by adding a priority default routing rule that forces all traffic to go over the ppp0 (EV-DO) connection. This ensures we're updating your service with your ppp0 ip and not your eth0 (Wifi) ip. It optionally then finds your IP address from http://checkip.dyndns.org. Then, it calls your update URL. Finally, it removes the default route it created in step 1.<br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, or novaproxy.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating (i.e. http://freedns.afraid.org)<br />
<br />
==Enabling write access to the file system==<br />
mount -o remount,rw /<br />
<br />
==Obtain the Update URL provided by your service==<br />
For http://freedns.afraid.org, log in, and find the 'Direct Update URL' for your dynamic DNS entry. Mine looks like this:<br />
http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
<br />
This updates the IP of my DNS entry to the IP of the client. We need to make sure we call this address from the ppp0 interface so that it updates to the correct IP. When the Pre is connected to a wifi connection, a default routing entry forces all data to go over that connection.<br />
<br />
However, your service may differ, and require different information (example):<br />
http://mydynamicdnsservice.com/?host=myhost.com&Ip=99.123.222.101<br />
<br />
<br />
This example doesn't require the caller to be from the new target IP address, and won't need the routing entries.<br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
You can do this by adding a script to /etc/ppp/ip-up.d called 09update-ddns.<br />
<br />
This is the script for the first example:<br><br />
Use this one if you don't get to or don't want to submit an IP arbitrarily, and your dynamic dns service just uses whatever IP the http request came from.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IFNAME and IPREMOTE for us<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
wget -qO- http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
</nowiki><br />
<br />
This is the script for the second example:<br><br />
Use this one if you need to or want to supply the IP yourself to the dynamic dns service.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
wget -qO- http://mydynamicdnsservice.com/?host=myhost.com&Ip=$IPLOCAL<br />
</nowiki><br />
<br />
==Make this script executable==<br />
<nowiki><br />
chmod 755 /etc/ppp/ip-up.d/09update-ddns<br />
</nowiki><br />
<br />
Also note that curl is also installed. Wget is a faster and lighter and works in most cases, but curl can do more and harder things than wget so it's something to remember if you want to hit some web pages that weren't necessarily designed to be accessed non-interactively.<br />
<br />
==Remount the file system as readonly==<br />
mount -o remount,ro /<br />
<br />
==It didn't work. What else can I try?==<br />
<br />
Try adding some debugging to the script.<br />
It wasn't working for me so I did this, capture the environment set up by pppd and the output of wget to a file.<br />
<br />
<nowiki><br />
#!/bin/sh<br />
L=/media/internal/ppp_env.txt<br />
set >$L<br />
wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
Then after down/up the evdo connection, get back in and look at that ppp_env.txt file, and it showed me that wget couldn't resolve my dyndns service providers web site:<br />
<br />
<nowiki><br />
less /media/internal/ppp_env.txt<br />
[...]<br />
wget: bad address 'svc.joker.com'<br />
</nowiki><br />
<br />
Most likely it's just being called too soon after the connection is formed, and it just needs to retry a few times, with a delay between retries.<br />
Real wget has such retry & wait options, but the stock wget on the Pre is just the busybox built-in and it doesn't have any of those options.<br />
<br />
You could write a retry loop in the shell script to re-run the same wget command a few times, but, the Pre does also ship with a full-featured standalone version of curl which you could use instead of wget, and take advantage of curls retry options:<br />
<br />
<nowiki><br />
#wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
curl --retry 6 http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
And voila. That fixed it for me. So now just remove the debugging:<br />
(Commented out the L=..., set >..., and the >>$L ... at the end of the curl command<br />
and added "-s" to the curl options)<br />
<br />
<nowiki><br />
#!/bin/sh<br />
#L=/media/internal/ppp_env.txt<br />
#set >$L<br />
curl -s --retry 6 "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" # >>$L 2>&1<br />
</nowiki></div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=5612Tutorials Linux DDNS Update Client wget2009-09-10T04:17:27Z<p>Bkw: move credits to new eof</p>
<hr />
<div>This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a freedns.afraid.org solution that doesn't require an always-on daemon, this guide may be for you.<br />
<br />
This mechanism functions by adding a priority default routing rule that forces all traffic to go over the ppp0 (EV-DO) connection. This ensures we're updating your service with your ppp0 ip and not your eth0 (Wifi) ip. It optionally then finds your IP address from http://checkip.dyndns.org. Then, it calls your update URL. Finally, it removes the default route it created in step 1.<br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, or novaproxy.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating (i.e. http://freedns.afraid.org)<br />
<br />
==Enabling write access to the file system==<br />
mount -o remount,rw /<br />
<br />
==Obtain the Update URL provided by your service==<br />
For http://freedns.afraid.org, log in, and find the 'Direct Update URL' for your dynamic DNS entry. Mine looks like this:<br />
http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
<br />
This updates the IP of my DNS entry to the IP of the client. We need to make sure we call this address from the ppp0 interface so that it updates to the correct IP. When the Pre is connected to a wifi connection, a default routing entry forces all data to go over that connection.<br />
<br />
However, your service may differ, and require different information (example):<br />
http://mydynamicdnsservice.com/?host=myhost.com&Ip=99.123.222.101<br />
<br />
<br />
This example doesn't require the caller to be from the new target IP address, and won't need the routing entries.<br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
You can do this by adding a script to /etc/ppp/ip-up.d called 09update-ddns.<br />
<br />
This is the script for the first example:<br><br />
Use this one if you don't get to or don't want to submit an IP arbitrarily, and your dynamic dns service just uses whatever IP the http request came from.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IFNAME and IPREMOTE for us<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
wget -qO- http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
</nowiki><br />
<br />
This is the script for the second example:<br><br />
Use this one if you need to or want to supply the IP yourself to the dynamic dns service.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
wget -qO- http://mydynamicdnsservice.com/?host=myhost.com&Ip=$IPLOCAL<br />
</nowiki><br />
<br />
==Make this script executable==<br />
<nowiki><br />
chmod 755 /etc/ppp/ip-up.d/09update-ddns<br />
</nowiki><br />
<br />
Also note that curl is also installed. Wget is a faster and lighter and works in most cases, but curl can do more and harder things than wget so it's something to remember if you want to hit some web pages that weren't necessarily designed to be accessed non-interactively.<br />
<br />
==Remount the file system as readonly==<br />
mount -o remount,ro /<br />
<br />
==It didn't work. What else can I try?==<br />
<br />
Try adding some debugging to the script.<br />
It wasn't working for me so I did this, capture the environment set up by pppd and the output of wget to a file.<br />
<br />
<nowiki><br />
#!/bin/sh<br />
L=/media/internal/ppp_env.txt<br />
set >$L<br />
wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
Then after down/up the evdo connection, get back in and look at that ppp_env.txt file, and it showed me that wget couldn't resolve my dyndns service providers web site:<br />
<br />
<nowiki><br />
less /media/internal/ppp_env.txt<br />
[...]<br />
wget: bad address 'svc.joker.com'<br />
</nowiki><br />
<br />
Most likely it's just being called too soon after the connection is formed, and it just needs to retry a few times, with a delay between retries.<br />
Real wget has such retry & wait options, but the stock wget on the Pre is just the busybox built-in and it doesn't have any of those options.<br />
<br />
You could write a retry loop in the shell script to re-run the same wget command a few times, but, the Pre does also ship with a full-featured standalone version of curl which you could use instead of wget, and take advantage of curls retry options:<br />
<br />
<nowiki><br />
#wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
curl --retry 6 http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
And voila. That fixed it for me. So now just remove the debugging:<br />
(Commented out the L=..., set >..., and the >>$L ... at the end of the curl command<br />
and added "-s" to the curl options)<br />
<br />
<nowiki><br />
#!/bin/sh<br />
#L=/media/internal/ppp_env.txt<br />
#set >$L<br />
curl -s --retry 6 "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" # >>$L 2>&1<br />
</nowiki></div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=5611Tutorials Linux DDNS Update Client wget2009-09-10T04:16:24Z<p>Bkw: make script code more cut/paste friendly and prevent trying to make sample urls clickable</p>
<hr />
<div>This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a freedns.afraid.org solution that doesn't require an always-on daemon, this guide may be for you.<br />
<br />
This mechanism functions by adding a priority default routing rule that forces all traffic to go over the ppp0 (EV-DO) connection. This ensures we're updating your service with your ppp0 ip and not your eth0 (Wifi) ip. It optionally then finds your IP address from http://checkip.dyndns.org. Then, it calls your update URL. Finally, it removes the default route it created in step 1.<br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, or novaproxy.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating (i.e. http://freedns.afraid.org)<br />
<br />
==Enabling write access to the file system==<br />
mount -o remount,rw /<br />
<br />
==Obtain the Update URL provided by your service==<br />
For http://freedns.afraid.org, log in, and find the 'Direct Update URL' for your dynamic DNS entry. Mine looks like this:<br />
http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
<br />
This updates the IP of my DNS entry to the IP of the client. We need to make sure we call this address from the ppp0 interface so that it updates to the correct IP. When the Pre is connected to a wifi connection, a default routing entry forces all data to go over that connection.<br />
<br />
However, your service may differ, and require different information (example):<br />
http://mydynamicdnsservice.com/?host=myhost.com&Ip=99.123.222.101<br />
<br />
<br />
This example doesn't require the caller to be from the new target IP address, and won't need the routing entries.<br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
You can do this by adding a script to /etc/ppp/ip-up.d called 09update-ddns.<br />
<br />
This is the script for the first example:<br><br />
Use this one if you don't get to or don't want to submit an IP arbitrarily, and your dynamic dns service just uses whatever IP the http request came from.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IFNAME and IPREMOTE for us<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
wget -qO- http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
</nowiki><br />
<br />
This is the script for the second example:<br><br />
Use this one if you need to or want to supply the IP yourself to the dynamic dns service.<br />
<nowiki><br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
wget -qO- http://mydynamicdnsservice.com/?host=myhost.com&Ip=$IPLOCAL<br />
</nowiki><br />
<br />
==Make this script executable==<br />
<nowiki><br />
chmod 755 /etc/ppp/ip-up.d/09update-ddns<br />
</nowiki><br />
<br />
Also note that curl is also installed. Wget is a faster and lighter and works in most cases, but curl can do more and harder things than wget so it's something to remember if you want to hit some web pages that weren't necessarily designed to be accessed non-interactively.<br />
<br />
==Remount the file system as readonly==<br />
mount -o remount,ro /<br />
<br />
* by raeb<br />
* big thanks to dreadchicken's tutorial<br />
<br />
==It didn't work. What else can I try?==<br />
<br />
Try adding some debugging to the script.<br />
It wasn't working for me so I did this, capture the environment set up by pppd and the output of wget to a file.<br />
<br />
<nowiki><br />
#!/bin/sh<br />
L=/media/internal/ppp_env.txt<br />
set >$L<br />
wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
Then after down/up the evdo connection, get back in and look at that ppp_env.txt file, and it showed me that wget couldn't resolve my dyndns service providers web site:<br />
<br />
<nowiki><br />
less /media/internal/ppp_env.txt<br />
[...]<br />
wget: bad address 'svc.joker.com'<br />
</nowiki><br />
<br />
Most likely it's just being called too soon after the connection is formed, and it just needs to retry a few times, with a delay between retries.<br />
Real wget has such retry & wait options, but the stock wget on the Pre is just the busybox built-in and it doesn't have any of those options.<br />
<br />
You could write a retry loop in the shell script to re-run the same wget command a few times, but, the Pre does also ship with a full-featured standalone version of curl which you could use instead of wget, and take advantage of curls retry options:<br />
<br />
<nowiki><br />
#wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
curl --retry 6 http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
And voila. That fixed it for me. So now just remove the debugging:<br />
(Commented out the L=..., set >..., and the >>$L ... at the end of the curl command<br />
and added "-s" to the curl options)<br />
<br />
<nowiki><br />
#!/bin/sh<br />
#L=/media/internal/ppp_env.txt<br />
#set >$L<br />
curl -s --retry 6 "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" # >>$L 2>&1<br />
</nowiki></div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=5610Tutorials Linux DDNS Update Client wget2009-09-10T04:07:12Z<p>Bkw: /* It didn't work. What else can I try? */</p>
<hr />
<div>This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a freedns.afraid.org solution that doesn't require an always-on daemon, this guide may be for you.<br />
<br />
This mechanism functions by adding a priority default routing rule that forces all traffic to go over the ppp0 (EV-DO) connection. This ensures we're updating your service with your ppp0 ip and not your eth0 (Wifi) ip. It optionally then finds your IP address from http://checkip.dyndns.org. Then, it calls your update URL. Finally, it removes the default route it created in step 1.<br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, or novaproxy.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating (i.e. http://freedns.afraid.org)<br />
<br />
==Enabling write access to the file system==<br />
mount -o remount,rw /<br />
<br />
==Obtain the Update URL provided by your service==<br />
For http://freedns.afraid.org, log in, and find the 'Direct Update URL' for your dynamic DNS entry. Mine looks like this:<br />
http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
<br />
This updates the IP of my DNS entry to the IP of the client. We need to make sure we call this address from the ppp0 interface so that it updates to the correct IP. When the Pre is connected to a wifi connection, a default routing entry forces all data to go over that connection.<br />
<br />
However, your service may differ, and require different information (example):<br />
http://mydynamicdnsservice.com/?host=myhost.com&Ip=99.123.222.101<br />
<br />
<br />
This example doesn't require the caller to be from the new target IP address, and won't need the routing entries.<br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
You can do this by adding a script to /etc/ppp/ip-up.d called 09update-ddns.<br />
<br />
This is the script for the first example:<br><br />
Use this one if you don't get to or don't want to submit an IP arbitrarily, and your dynamic dns service just uses whatever IP the http request came from.<br />
#!/bin/sh<br />
# pppd provides IFNAME and IPREMOTE for us<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
wget -qO- http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
<br />
This is the script for the second example:<br><br />
Use this one if you need to or want to supply the IP yourself to the dynamic dns service.<br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
wget -qO- http://mydynamicdnsservice.com/?host=myhost.com&Ip=$IPLOCAL<br />
<br />
===Make this script executable===<br />
chmod 755 /etc/ppp/ip-up.d/09update-ddns<br />
<br />
Also note that curl is also installed. Wget is a faster and lighter and works in most cases, but curl can do more and harder things than wget so it's something to remember if you want to hit some web pages that weren't necessarily designed to be accessed non-interactively.<br />
<br />
==Remount the file system as readonly==<br />
mount -o remount,ro /<br />
<br />
* by raeb<br />
* big thanks to dreadchicken's tutorial<br />
<br />
==It didn't work. What else can I try?==<br />
<br />
Try adding some debugging to the script.<br />
It wasn't working for me so I did this, capture the environment set up by pppd and the output of wget to a file.<br />
<br />
<nowiki><br />
#!/bin/sh<br />
L=/media/internal/ppp_env.txt<br />
set >$L<br />
wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
Then after down/up the evdo connection, get back in and look at that ppp_env.txt file, and it showed me that wget couldn't resolve my dyndns service providers web site:<br />
<br />
<nowiki><br />
less /media/internal/ppp_env.txt<br />
[...]<br />
wget: bad address 'svc.joker.com'<br />
</nowiki><br />
<br />
Most likely it's just being called too soon after the connection is formed, and it just needs to retry a few times, with a delay between retries.<br />
Real wget has such retry & wait options, but the stock wget on the Pre is just the busybox built-in and it doesn't have any of those options.<br />
<br />
You could write a retry loop in the shell script to re-run the same wget command a few times, but, the Pre does also ship with a full-featured standalone version of curl which you could use instead of wget, and take advantage of curls retry options:<br />
<br />
<nowiki><br />
#wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
curl --retry 6 http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
</nowiki><br />
<br />
And voila. That fixed it for me. So now just remove the debugging:<br />
(Commented out the L=..., set >..., and the >>$L ... at the end of the curl command<br />
and added "-s" to the curl options)<br />
<br />
<nowiki><br />
#!/bin/sh<br />
#L=/media/internal/ppp_env.txt<br />
#set >$L<br />
curl -s --retry 6 "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" # >>$L 2>&1<br />
</nowiki></div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=5609Tutorials Linux DDNS Update Client wget2009-09-10T03:52:30Z<p>Bkw: /* It didn't work. What else can I try? */</p>
<hr />
<div>This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a freedns.afraid.org solution that doesn't require an always-on daemon, this guide may be for you.<br />
<br />
This mechanism functions by adding a priority default routing rule that forces all traffic to go over the ppp0 (EV-DO) connection. This ensures we're updating your service with your ppp0 ip and not your eth0 (Wifi) ip. It optionally then finds your IP address from http://checkip.dyndns.org. Then, it calls your update URL. Finally, it removes the default route it created in step 1.<br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, or novaproxy.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating (i.e. http://freedns.afraid.org)<br />
<br />
==Enabling write access to the file system==<br />
mount -o remount,rw /<br />
<br />
==Obtain the Update URL provided by your service==<br />
For http://freedns.afraid.org, log in, and find the 'Direct Update URL' for your dynamic DNS entry. Mine looks like this:<br />
http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
<br />
This updates the IP of my DNS entry to the IP of the client. We need to make sure we call this address from the ppp0 interface so that it updates to the correct IP. When the Pre is connected to a wifi connection, a default routing entry forces all data to go over that connection.<br />
<br />
However, your service may differ, and require different information (example):<br />
http://mydynamicdnsservice.com/?host=myhost.com&Ip=99.123.222.101<br />
<br />
<br />
This example doesn't require the caller to be from the new target IP address, and won't need the routing entries.<br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
You can do this by adding a script to /etc/ppp/ip-up.d called 09update-ddns.<br />
<br />
This is the script for the first example:<br><br />
Use this one if you don't get to or don't want to submit an IP arbitrarily, and your dynamic dns service just uses whatever IP the http request came from.<br />
#!/bin/sh<br />
# pppd provides IFNAME and IPREMOTE for us<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
wget -qO- http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
<br />
This is the script for the second example:<br><br />
Use this one if you need to or want to supply the IP yourself to the dynamic dns service.<br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
wget -qO- http://mydynamicdnsservice.com/?host=myhost.com&Ip=$IPLOCAL<br />
<br />
===Make this script executable===<br />
chmod 755 /etc/ppp/ip-up.d/09update-ddns<br />
<br />
Also note that curl is also installed. Wget is a faster and lighter and works in most cases, but curl can do more and harder things than wget so it's something to remember if you want to hit some web pages that weren't necessarily designed to be accessed non-interactively.<br />
<br />
==Remount the file system as readonly==<br />
mount -o remount,ro /<br />
<br />
* by raeb<br />
* big thanks to dreadchicken's tutorial<br />
<br />
==It didn't work. What else can I try?==<br />
<br />
Try adding some debugging to the script.<br />
It wasn't working for me so I did this, capture the environment set up by pppd and the output of wget to a file.<br />
<br />
#!/bin/sh<br />
L=/media/internal/ppp_env.txt<br />
set >$L<br />
wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.briankwhite.net&myip=${IPLOCAL}" >>$L 2>&1<br />
<br />
Then after down/up the evdo connection, get back in and look at that ppp_env.txt file, and it showed me that wget couldn't resolve my dyndns service providers web site:<br />
<br />
less /media/internal/ppp_env.txt<br />
[...]<br />
wget: bad address 'svc.joker.com'<br />
<br />
Most likely it's just being called too soon after the connection is formed, and it just needs to retry a few times, with a delay between retries.<br />
Real wget has such retry & wait options, but the stock wget on the Pre is just the busybox built-in and it doesn't have any of those options.<br />
<br />
You could write a retry loop in the shell script to re-run the same wget command a few times, but, the Pre does also ship with a full-featured standalone version of curl which you could use instead of wget, and take advantage of curls retry options:<br />
<br />
#wget -O - "http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
curl --retry 6 http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" >>$L 2>&1<br />
<br />
And voila. That fixed it for me. So now just remove the debugging:<br />
(Commented out the L=..., set >..., and the >>$L ... at the end of the curl command<br />
and added "-s" to the curl options)<br />
<br />
#!/bin/sh<br />
#L=/media/internal/ppp_env.txt<br />
#set >$L<br />
curl -s --retry 6 http://svc.joker.com/nic/update?username=MYDDNSUSERNAME&password=MYDDNSPASSWORD&hostname=pre.mydomain.net&myip=${IPLOCAL}" # >>$L 2>&1</div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=5608Tutorials Linux DDNS Update Client wget2009-09-10T03:15:31Z<p>Bkw: additional info section</p>
<hr />
<div>This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a freedns.afraid.org solution that doesn't require an always-on daemon, this guide may be for you.<br />
<br />
This mechanism functions by adding a priority default routing rule that forces all traffic to go over the ppp0 (EV-DO) connection. This ensures we're updating your service with your ppp0 ip and not your eth0 (Wifi) ip. It optionally then finds your IP address from http://checkip.dyndns.org. Then, it calls your update URL. Finally, it removes the default route it created in step 1.<br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, or novaproxy.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating (i.e. http://freedns.afraid.org)<br />
<br />
==Enabling write access to the file system==<br />
mount -o remount,rw /<br />
<br />
==Obtain the Update URL provided by your service==<br />
For http://freedns.afraid.org, log in, and find the 'Direct Update URL' for your dynamic DNS entry. Mine looks like this:<br />
http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
<br />
This updates the IP of my DNS entry to the IP of the client. We need to make sure we call this address from the ppp0 interface so that it updates to the correct IP. When the Pre is connected to a wifi connection, a default routing entry forces all data to go over that connection.<br />
<br />
However, your service may differ, and require different information (example):<br />
http://mydynamicdnsservice.com/?host=myhost.com&Ip=99.123.222.101<br />
<br />
<br />
This example doesn't require the caller to be from the new target IP address, and won't need the routing entries.<br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
You can do this by adding a script to /etc/ppp/ip-up.d called 09update-ddns.<br />
<br />
This is the script for the first example:<br><br />
Use this one if you don't get to or don't want to submit an IP arbitrarily, and your dynamic dns service just uses whatever IP the http request came from.<br />
#!/bin/sh<br />
# pppd provides IFNAME and IPREMOTE for us<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
wget -qO- http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
<br />
This is the script for the second example:<br><br />
Use this one if you need to or want to supply the IP yourself to the dynamic dns service.<br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
wget -qO- http://mydynamicdnsservice.com/?host=myhost.com&Ip=$IPLOCAL<br />
<br />
===Make this script executable===<br />
chmod 755 /etc/ppp/ip-up.d/09update-ddns<br />
<br />
Also note that curl is also installed. Wget is a faster and lighter and works in most cases, but curl can do more and harder things than wget so it's something to remember if you want to hit some web pages that weren't necessarily designed to be accessed non-interactively.<br />
<br />
==Remount the file system as readonly==<br />
mount -o remount,ro /<br />
<br />
* by raeb<br />
* big thanks to dreadchicken's tutorial<br />
<br />
==It didn't work. What else can I try?==</div>Bkwhttp://wiki.webos-internals.org/index.php?title=Tutorials_Linux_DDNS_Update_Client_wget&diff=5597Tutorials Linux DDNS Update Client wget2009-09-09T22:12:15Z<p>Bkw: efficiency, robustness/correctness. remove unnecessary subprocesses, pipelines, and parsing of executables output.</p>
<hr />
<div>This document contains instructions for setting up your Pre to automatically update a dynamic DNS hostname to your Palm Pre's IP address (assigned by your data service provider).<br />
<br />
If you're using the Optware Package Feed you might want to check out [[Tutorials_Linux_DDNS_Update_Client_ez-ipupdate|ez-ipupdate]] or [[Tutorials_Linux_DDNS_Update_Client_INADYN|INADYN]]. However, if your dynamic DNS service isn't supported by either of these, you're building a custom service, or you want a freedns.afraid.org solution that doesn't require an always-on daemon, this guide may be for you.<br />
<br />
This mechanism functions by adding a priority default routing rule that forces all traffic to go over the ppp0 (EV-DO) connection. This ensures we're updating your service with your ppp0 ip and not your eth0 (Wifi) ip. It optionally then finds your IP address from http://checkip.dyndns.org. Then, it calls your update URL. Finally, it removes the default route it created in step 1.<br />
<br />
==Prerequisites==<br />
* This page assumes that you have just finished the procedure on the [[Portal:Accessing_Linux]] page, and are still logged in as root via telnet, novaterm, or novaproxy.<br />
* This page assumes you have a Dynamic DNS service account with a service that provides URL based updating (i.e. http://freedns.afraid.org)<br />
<br />
==Enabling write access to the file system==<br />
mount -o remount,rw /<br />
<br />
==Obtain the Update URL provided by your service==<br />
For http://freedns.afraid.org, log in, and find the 'Direct Update URL' for your dynamic DNS entry. Mine looks like this:<br />
http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
<br />
This updates the IP of my DNS entry to the IP of the client. We need to make sure we call this address from the ppp0 interface so that it updates to the correct IP. When the Pre is connected to a wifi connection, a default routing entry forces all data to go over that connection.<br />
<br />
However, your service may differ, and require different information (example):<br />
http://mydynamicdnsservice.com/?host=myhost.com&Ip=99.123.222.101<br />
<br />
<br />
This example doesn't require the caller to be from the new target IP address, and won't need the routing entries.<br />
<br />
==Update your service whenever your ppp0 (EV-DO) IP address changes==<br />
You can do this by adding a script to /etc/ppp/ip-up.d called 09update-ddns.<br />
<br />
This is the script for the first example:<br><br />
Use this one if you don't get to or don't want to submit an IP arbitrarily, and your dynamic dns service just uses whatever IP the http request came from.<br />
#!/bin/sh<br />
# pppd provides IFNAME and IPREMOTE for us<br />
ip route add default via $IPREMOTE dev $IFNAME metric 1<br />
wget -qO- http://freedns.afraid.org/dynamic/update.php?ZzYyXxWwUuTtSsRr==<br />
ip route del default via $IPREMOTE dev $IFNAME metric 1<br />
<br />
This is the script for the second example:<br><br />
Use this one if you need to or want to supply the IP yourself to the dynamic dns service.<br />
#!/bin/sh<br />
# pppd provides IPLOCAL for us<br />
wget -qO- http://mydynamicdnsservice.com/?host=myhost.com&Ip=$IPLOCAL<br />
<br />
===Make this script executable===<br />
chmod 755 /etc/ppp/ip-up.d/09update-ddns<br />
<br />
Also note that curl is also installed. Wget is a faster and lighter and works in most cases, but curl can do more and harder things than wget so it's something to remember if you want to hit some web pages that weren't necessarily designed to be accessed non-interactively.<br />
<br />
==Remount the file system as readonly==<br />
mount -o remount,ro /<br />
<br />
* by raeb<br />
* big thanks to dreadchicken's tutorial</div>Bkw