AutoAP

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 03:39, 14 December 2006 (edit)
Whiteboy (Talk | contribs)

← Previous diff
Revision as of 03:39, 14 December 2006 (edit) (undo)
Whiteboy (Talk | contribs)
(relinked to glossary)
Next diff →
Line 1: Line 1:
-[[autoap | AutoAP]] is a script that continuously scans for open wifi 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 wifi 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.
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]].

Revision as of 03:39, 14 December 2006

AutoAP is a script that continuously scans for open wifi 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.

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

Contents

Prerequisites

Installation

There are several ways to install and use autoap:

Built Into Image

  • You can flash your router using an image with autoap built in. Go here for instructions on flashing for your device.
  • After flashing with the autoap image, go to tab "Administration", subtab "Command".
  • Copy and paste the following into the edit box:
nvram set autoap_logger="html" 
nvram commit
/bin/autoap &
  • Click the Save Startup button.
  • After rebooting the router, repeater status will then be available at http://YourRouterIP/user/autoap.htm (where YourRouterIP is the IP address of your router).
  • Additional info on autoap nvram variable usage (settings) is below.

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:
  • 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=""
nvram set autoap_logger="html" 
nvram commit
`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.
  • After rebooting the router, repeater status will then be available at http://YourRouterIP/user/autoap.htm (where YourRouterIP is the IP/name of 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, router tries to download autoap script. Once downloaded, autoap runs in the background which connects based on strongest signal.
  • For those that do not have autoap built-in, here is the stand-alone autoap.sh extracted from JP's autoap image.

JFFS and Samba

  • You can use JFFS or Samba to directly call the autoap script.
  • Obtain the stand-alone autoap.sh script here (extracted from JP's autoap image).
  • Use the same startup as "Built Into Image" above but reference your jffs or Samba path instead of /bin/autoap.

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 to 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 seperated 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 you're 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 rotuers 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 active connections.
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.

Links