[maemo-developers] [maemo-developers] Initiating connections programatically

From: D. Scott Brown d.scott.brown at gmail.com
Date: Tue Aug 29 21:55:12 EEST 2006
My team is developing an application that will be used by tech- 
clueless consumers. All data is displayed in a portrait screen  
orientation, and our application is intended to run directly from  
startup in place of the default Hildon launcher.

Because of this, we need to provide our own UI for selecting a WLAN  
connection. We've tried using both LIBOSSO and Linux wireless tools  
without success.

#####libosso using python
	import osso
#####lend python

It always seems to complain about an interface not found (or  
something similar like that). We've tried many variants of this  
without success:

Our second approach was to write code that will bring up the wlan  
network and then scan for hotspots:
#####file wifi_scan.sh
	sudo gainroot < /sbin/ifconfig wlan0 down
	/sbin/ifconfig wlan0 up
	/usr/sbin/iwlist wlan0 scanning

Here's the code that will connect to the network (at least partially):
#####file wifi_connect.sh
	sudo gainroot < /usr/sbin/iwconfig wlan0 essid $1
	/usr/sbin/iwconfig wlan0 key $2
	/usr/sbin/iwconfig wlan0 commit

Running it as ./wifi_connect.sh MyNetworkSid MyWEPpassword works,  
except that when geting the wifi info (using /usr/sbin/iwconfig or / 
sbin/ifconfig) it doesn't seem to assign an IP address to the network  
interface (or at least something is preventing the internet from  

Assuming that the problem with the wifi_connect.sh script is that the  
DHCP isn't working, then there may be extra logic needed to link to  
dhcp server on the router….
There is code under /etc/udhcpc/ that appears to drive the assignment  
of ip addresses to the Nokia via DHCP from the network you become  
connected to. We haven't been able to get it to do anything useful.  
There is some vague info on this directory at http:// 

The only other last-ditch idea we've thought about (and we have no  
idea if this is even remotely feasible) was to use the built-in  
Connection Manager, but hide it behind our application's window and  
somehow send stylus click events to it.

Right now, this mailing list is all that stands between us and  
dropping support for wifi connectivity in our application (ouch).

Your wise counsel is humbly sought,
More information about the maemo-developers mailing list