Re: [maemo-developers] Initiating connections programatically

2006-09-04 Thread Kimmo Hämäläinen
On Mon, 2006-09-04 at 13:21, ext Patrik Flykt wrote:
>   Hi,
> 
> On Tue, 2006-08-29 at 14:55 -0400, ext D. Scott Brown wrote:
> > connection. We've tried using both LIBOSSO and Linux wireless tools  
> > without success.
> 
> ICd listens on the system bus. I think libosso connects only to the
> session bus and/or allows only some messages through from system bus.

Libosso connects to both busses. See osso_rpc_run_system_* functions.

BR; Kimmo

___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] Initiating connections programatically

2006-09-04 Thread Patrik Flykt

Hi,

On Tue, 2006-08-29 at 14:55 -0400, ext D. Scott Brown wrote:
> connection. We've tried using both LIBOSSO and Linux wireless tools  
> without success.

ICd listens on the system bus. I think libosso connects only to the
session bus and/or allows only some messages through from system bus.

> #libosso using python
>   import osso
>   osso_c=osso.Context("wifi","0.0.1",False)
>   ret=osso_c.rpc_run("com.nokia.icd","/com/nokia/ 
> icd","com.nokia.icd","get_ipinfo",wait_reply=True,use_system_bus=True)
> #lend python

Try using the d-bus system bus "natively" from python, not via libosso.

> sbin/ifconfig) it doesn't seem to assign an IP address to the network  

DHCP is started by ICd, so if the wlan script is run only wlan level
stuff is configured. After wlan works, start udhcpc or assign IP
adressess manually.

> Connection Manager, but hide it behind our application's window and  
> somehow send stylus click events to it.

Hiding the osso-connectivity-ui dialogs is going to be hard as they are
system modal.

Hope this helps.

Patrik

-- 
Patrik Flykt <[EMAIL PROTECTED]>

___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


[maemo-developers] Initiating connections programatically

2006-08-29 Thread D. Scott Brown
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
osso_c=osso.Context("wifi","0.0.1",False)
	ret=osso_c.rpc_run("com.nokia.icd","/com/nokia/ 
icd","com.nokia.icd","get_ipinfo",wait_reply=True,use_system_bus=True)

#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:
	ret=osso_c.rpc_run("com.nokia.icd","/com/nokia/ 
icd","com.nokia.icd","connect",rpc_args=[name, 
1],wait_reply=True,use_system_bus=True)


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
END

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
END

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  
working).


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:// 
stefans.datenbruch.de/nokia770/.


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,
Scott___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers