AutoAP

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 23:29, 28 December 2006 (edit)
Marcjohnson (Talk | contribs)
m (Built-in Image)
← Previous diff
Revision as of 19:00, 4 January 2007 (edit) (undo)
P1415 (Talk | contribs)
(separate section for 'autoap.htm')
Next diff →
Line 1: Line 1:
-[[glossary#autoap| AutoAP]] is a script that continuously scans for open Wi-Fi connections, tests them for validity, and connects to the strongest signal. If the connection is lost, the script scans again and finds the strongest valid signal again, and maintains a continuous connection to the internet in a mobile or portable environment. The script paremeters are highly configurable, including ability to configure secure connections.+[[glossary#autoap| AutoAP]] is a script that continuously scans for open Wi-Fi connections, tests them for validity, and connects to the strongest signal. If the connection is lost, the script scans again and finds the strongest valid signal again, and maintains a continuous connection to the internet in a mobile or portable environment. The script paremeters are highly configurable, including ability to configure secure WEP connections.
Typically, you would use this script on your router while in [[Client_Mode_Wireless | Client Mode]], [[Wireless_Bridge | Client-Bridged Mode]], or [[UWR | Repeater Mode]]. Typically, you would use this script on your router while in [[Client_Mode_Wireless | Client Mode]], [[Wireless_Bridge | Client-Bridged Mode]], or [[UWR | Repeater Mode]].
Line 11: Line 11:
=Installation= =Installation=
-There are several ways to install and use AutoAP:+There are several ways to install AutoAP:
==Built-in Image== ==Built-in Image==
Line 18: Line 18:
:* After flashing go to tab "Administration", subtab "Command". :* After flashing go to tab "Administration", subtab "Command".
:* Copy and paste the following into the edit box: :* Copy and paste the following into the edit box:
- nvram set autoap_logger="html"  
- nvram commit 
/bin/autoap & /bin/autoap &
-:* Click the Save Startup button.+:* Click the Save Startup button
-:* After rebooting the router, repeater status will then be available at <code><nowiki>http://RouterIP/user/autoap.htm</nowiki></code> (where RouterIP is the IP address of your router).+:* Reboot your router
 +Note: some users reported that version [http://www.partners.biz/autoap/v24/dd-wrt.v24_AAPw_102-generic.bin dd-wrt.v24_AAPw_102-generic.bin] works better than dd-wrt.v24_AAPw-stable_generic.bin (Dec 28 2006), listed on SourceForge site as latest.
 + 
 +==JFFS or Samba==
 +You can use [[JFFS]] or [[Samba]] to directly call the AutoAP script.
 +:* Obtain the stand-alone [http://d4308987.u22.infinology.com/code/autoap.sh autoap.sh script] (extracted from JP's AutoAP image).
 +:* Put it into your router flash memory (using JFFS) or somewhere on your local network (using Samba).
 +:* Use the same startup script as in "Built-in Image" above but reference your JFFS or Samba path instead of <code>/bin/autoap</code>.
==Dynamically Download== ==Dynamically Download==
-If you're using a build that does not have AutoAP built-in, you may dynamically download just the script. Also use this approach if you don't have enough nvram for [[JFFS]].+If you cannot use the approaches above you might want to try the following script. It clears wl_ssid to dynamically connect to any open AP and then every 30 seconds tries to download stand-alone [http://d4308987.u22.infinology.com/code/autoap.sh AutoAP script] (extracted from JP's AutoAP image). Once downloaded, AutoAP starts.
:* Go to tab "Administration", subtab "Command". :* Go to tab "Administration", subtab "Command".
:* Copy and paste the following into the edit box (make sure to get the "&" at the end): :* Copy and paste the following into the edit box (make sure to get the "&" at the end):
nvram set wl_ssid="" nvram set wl_ssid=""
- nvram set autoap_logger="html"  
- nvram commit 
`cd /tmp; until [ 2 = 1 ];do /bin/sleep 30; `cd /tmp; until [ 2 = 1 ];do /bin/sleep 30;
/usr/bin/wget <nowiki>http://d4308987.u22.infinology.com/code/autoap.sh;</nowiki> /usr/bin/wget <nowiki>http://d4308987.u22.infinology.com/code/autoap.sh;</nowiki>
chmod 777 ./autoap.sh;./autoap.sh;done` & chmod 777 ./autoap.sh;./autoap.sh;done` &
-:* Click the Save Startup button.+:* Click the Save Startup button
-:* After rebooting the router, repeater status will then be available at <code><nowiki>http://RouterIP/user/autoap.htm</nowiki></code> (where RouterIP is the IP address of your router).+:* Reboot your router
-The above startup script does this: clears wl_ssid to dynamically connect to any open AP, and sets logging to html. Every 30 seconds script tries to download stand-alone [http://d4308987.u22.infinology.com/code/autoap.sh AutoAP script] (extracted from JP's AutoAP image). Once downloaded, AutoAP runs in the background and connects based on strongest signal. 
-==JFFS or Samba==+=Usage=
-You can use [[JFFS]] or [[Samba]] to directly call the AutoAP script. + 
-:* Obtain the stand-alone [http://d4308987.u22.infinology.com/code/autoap.sh autoap.sh script] (extracted from JP's AutoAP image). +You can change the behavior of AutoAP script by setting [[Hardware#NVRAM|NVRAM]] variables. For example, let's set AutoAP logging to html file.
-:* Put it into your router flash memory (using JFFS) or somewhere on your local network (using Samba).+:* Go to tab "Administration", subtab "Command".
-:* Use the same startup script as in "Built-in Image" above but reference your JFFS or Samba path instead of <code>/bin/autoap</code>.+:* Copy and paste the following into the edit box:
 + nvram set autoap_logger="html"
 + nvram commit
 +:* Click the Run Commands button
 +:* Reboot your router
 +Now the repeater status will be available at <code><nowiki>http://RouterIP/user/autoap.htm</nowiki></code> (where RouterIP is the IP address of your router).
 + 
=NVRAM Variables= =NVRAM Variables=
-What follows is a complete list of included nvram variables and what they do (with default values): +What follows is a complete list of included [[Hardware#NVRAM|NVRAM]] variables and what they do (with default values):
:'''nvram set autoap_logger="syslog"''' [Valid values: syslog, html, /path/to/logfile] :'''nvram set autoap_logger="syslog"''' [Valid values: syslog, html, /path/to/logfile]

Revision as of 19:00, 4 January 2007

AutoAP is a script that continuously scans for open Wi-Fi connections, tests them for validity, and connects to the strongest signal. If the connection is lost, the script scans again and finds the strongest valid signal again, and maintains a continuous connection to the internet in a mobile or portable environment. The script paremeters are highly configurable, including ability to configure secure WEP connections.

Typically, you would use this script on your router while in Client Mode, Client-Bridged Mode, or Repeater Mode.


Before using this guide, it is recommended that you know how to:

... flash your device
... use the Web Interface
... use Client Mode, Client-Bridged Mode, or Repeater Mode

Contents

Installation

There are several ways to install AutoAP:

Built-in Image

  • Download an image with AutoAP built in.
  • Flash your router with this image.
  • After flashing go to tab "Administration", subtab "Command".
  • Copy and paste the following into the edit box:
/bin/autoap &
  • Click the Save Startup button
  • Reboot your router

Note: some users reported that version dd-wrt.v24_AAPw_102-generic.bin works better than dd-wrt.v24_AAPw-stable_generic.bin (Dec 28 2006), listed on SourceForge site as latest.

JFFS or Samba

You can use JFFS or Samba to directly call the AutoAP script.

  • Obtain the stand-alone autoap.sh script (extracted from JP's AutoAP image).
  • Put it into your router flash memory (using JFFS) or somewhere on your local network (using Samba).
  • Use the same startup script as in "Built-in Image" above but reference your JFFS or Samba path instead of /bin/autoap.

Dynamically Download

If you cannot use the approaches above you might want to try the following script. It clears wl_ssid to dynamically connect to any open AP and then every 30 seconds tries to download stand-alone AutoAP script (extracted from JP's AutoAP image). Once downloaded, AutoAP starts.

  • Go to tab "Administration", subtab "Command".
  • Copy and paste the following into the edit box (make sure to get the "&" at the end):
nvram set wl_ssid=""
`cd /tmp; until [ 2 = 1 ];do /bin/sleep 30;
/usr/bin/wget http://d4308987.u22.infinology.com/code/autoap.sh;
chmod 777 ./autoap.sh;./autoap.sh;done` & 
  • Click the Save Startup button
  • Reboot your router


Usage

You can change the behavior of AutoAP script by setting NVRAM variables. For example, let's set AutoAP logging to html file.

  • Go to tab "Administration", subtab "Command".
  • Copy and paste the following into the edit box:
nvram set autoap_logger="html" 
nvram commit
  • Click the Run Commands button
  • Reboot your router

Now the repeater status will be available at http://RouterIP/user/autoap.htm (where RouterIP is the IP address of your router).


NVRAM Variables

What follows is a complete list of included NVRAM variables and what they do (with default values):

nvram set autoap_logger="syslog" [Valid values: syslog, html, /path/to/logfile]
When set to 'syslog', AutoAP will send all logdata to syslog. Depending on your log level settings, you will see more or less data. AutoAP has quite a bit of log data it sends, however if your log level is set to high, the router should only send out important autoap notices, like new connections, disconnections, or errors. If set to low, it will show you debug data.
When set to 'html', the log data is written to a file available via the web interface at http://RouterIP/user/autoap.htm. This log is kept trimmed to 1000 lines.
When set to a path, i.e. '/tmp/newautoap.log', the log data will be saved to that location. This will also be trimmed to 1000 lines.
nvram set autoap_findopen="1"
When set to 1, AutoAP will search for unencrypted, open access points. When set to 0, it will not connect to any open access points.
nvram set autoap_findwep="0"
When set to 1, AutoAP will search for WEP encrypted access points. If you set this to one, make sure to add keys in the next settings. Set to 0 keeps AutoAP from trying to connect with any WEP networks. This is far too slow to use as a brute force tool, so if you don't know the WEP keys to networks you're trying to connect with, just keep this at 0.
nvram set autoap_wepkeys=""
This is a space separated list of WEP keys you want AutoAP to use when trying to connect to WEP networks. For instance, if you set "AAABBBCCC1 4455993322 1111122222" it will attempt to use those three keys, in that order, to connect to any WEP (not WPA) access points.
nvram set autoap_aplimit="10"
The number of AP's that AutoAP should keep track of at one time. The default is 10, so after trying to connect to 10 access points, AutoAP will take another full scan and get a fresh list of URLs. If you live in a Wi-Fi heavy area, and your router doesn't move much, you can safely increase this to 15 or so. If you are in a sparse area, or routers around you tend to have weak signals, set it lower.
Also, if you're moving (i.e. router is in a car) you'll want this number to be somewhere between 2 and 5.
nvram set autoap_inet="1"
When set to 1, it will check to make sure internet is active on an AP before considering it valid. When set to 0, it only checks for connection to the gateway.
nvram set autoap_ineturl="www.google.com"
The URL to check.
nvram set autoap_dhcpw="15"
The amount of time to wait for a DHCP renewal to complete. If the routers you're accessing are fairly quick, you can decrease this to ~8-10 and save some time on the scans. However if the signal is low quality, or the router is slow to respond, you can increase it. The default should be a safe bet for most.
nvram set autoap_scanfreq="60"
The amount of time to wait between scans. When AutoAP finds a valid connection, it checks every so often to ensure that the connection is still active. If it isn't, it seeks out a new AP. This number controls how often it should check.
This only applies to the frequency of scans when the connection is good. When there is no connection, or no APs, it will automatically scan more frequently.
nvram set autoap_macfilter=""
A space seperated list of MAC addresses that AutoAP should avoid. If you have routers that you don't want to log on to, add them here. The MAC filter is more accurate than the SSID filter, as no two routers share a MAC address. (Unless cloned I suppose)
nvram set autoap_ssidfilter=""
A space seperated list of SSIDs to avoid. Normally the macfilter will be a safer bet, but occasionally there may be a WDS network, etc, that you don't want to connect to that includes many APs with the same SSID.

External Links

  • SourceForge site where you may download the latest image with AutoAP built in (updated 12/28/2006).
  • Stand-alone autoap.sh script (extracted from AutoAP image with latest bug fixes from Mathilda - updated 12/17/2006). Here is a link to Mathilda's latest which may be slightly newer code in development.
  • The AutoAP discussion thread is here.