Want to have easy config for network: Start/stop GPRS, and set AP name Start/stop wireless, and set AP name So: Big "GPRS" button toggles on/off text entry for AP name Big "WLAN" button toggles on/off If on and no ESSID chosen, try to fill in box. AP name is stored in /media/card/gprs -------------------------- There are 4 network connections: - usb - bluetooth - wifi - GPRS Each of the first three could be a source or sink of the default route. GPRS can only be a source. usb: notebook runs dnsmasq. On 'power' we attempt to connect each creates a low-prio default route through the other On 'wake' or explicit request we probe for a network: - turn in wifi and wpa_supplicant and see if we manage to connect - turn on bluetooth and try to connect - if neither of those work, allow GPRS?? Once we get a connection on one network we switch the others to receive: - wifi goes ad-hoc as 'internet' - bluetooth listens for network Use cases: 1/ development. USB cable connects freerunner with notebook and sets up network. No default route needed, but might be useful if route goes out through notebook incase it is on a wired network or for other reason freerunner cannot see wireless. 2/ Internet access for freerunner use wifi if connection can be made, else usb or bluetooth if it has been set up else GPRS 3/ Access point for tethering As above but listen on bluetooth and wifi if there aren't in use for Internet access. Notebook always initiates connection whether usb (cable plug) or bluetooth. freerunner runs dhcp. If Internet is available, notebook runs dns server which freerunner polls for. If a nameserver is found, default route is configured. Accesspoint mode must be explicitly enabled, possibly by ssh request once local connection set up. That is just setting ip_forward. So: on wake up and possibly other times: - write '0' to ip_forward - wifi: power on, scan for network if we find one, set route and resolv.conf if not, configure ad-hoc mode - bluetooth: enable iscan and listen for connection with pand - usb: always have dnsmasq running if there is a bluetooth On 'request for internet': If wifi connected, then OK If usb or bluetooth connected, ping dns server. If found, set resolv.conf and OK Attempt GPRS On 'request for access point' request internet, enable routing --------------------------- dnsmasq: - listen on usb0 bnep0 and wifi0 - each is configured with /5 192.168.222.{129,161,193} - hand out addreses as appropriate usb: configure when power connected ?? how to enable default route on notebook? Need to restart dnsmasq? Maybe on noteboot us a dhclient hook to avoid over-riding the default route.