osdir.com
mailing list archive F.A.Q. -since 2001!



Subject: Re: Re: Connect to WLAN from command line -
msg#00070

List: handhelds.maemo.user

Mail Archive Navigation:
by Date: Prev Next Date Index by Thread: Prev Next Thread Index



On 1/6/07, Pigeon <pigeon@xxxxxxxxxxx> wrote: >      Download the iwconfig packages, once you got them you will have the
>      iwconfig iwspy iwlist etc. Look for a howto to use it. Remember
>      first to ifup wlan0.
>      iwlist will give you the broadcast AP, but if you want to put one
>      manually you should use
>      iwconfig wlan0 ssid "XYZ" key 1011010101AB
>
>    Well, I installed wireless tools package and tried to use it:


    I had to do something similiar. However iwconfig simply won't work
properly for some reason, I asked around a while ago:

    http://www.mail-archive.com/maemo-users@xxxxxxxxx/msg01896.html


    Anyway, I figured a working but dodgy way to get it working.

    Firstly you have to setup the wireless connection at the usual GUI
configuration. Make sure this works.

    Then I have a script that runs:

    dbus-send --type=method_call --system --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:${IAP} uint32:0

    where $IAP is the identifier (name) of the wireless connection you've
setup in the GUI config.
Good way!

    What's even worse is, I have to run that command line every 5
seconds or so (I put it in the script in a while loop to run that and
then sleep 5), as the connection daemon seems to disconnect
automatically. I think it disconnects if there's no application using
the N770 framework/lib to make network connections. So if I have some
custom software that uses the network it won't help either.
Did you specify an option in the connection manager do not break WLAN connection never? Maybe it may help to resolve this problem.

Pigeon.

_______________________________________________
maemo-users mailing list
maemo-users@xxxxxxxxx
https://maemo.org/mailman/listinfo/maemo-users



--
Cheers,
Michael

Thread at a glance:

Previous Message by Date:

Re: Connect to WLAN from command line

On 12/28/06, inigo@xxxxxxxxxxxx <inigo@xxxxxxxxxxxx> wrote: Wlan is up in the boot through the service wlancond (at /init.d) associated to runlevel 3. The graphical user interaction doesn't allow to set up but configure the values of wlan. So you have to define these in order to wlan starts at runlevel 3 with that configuration.To do that you have to edit file /etc/network/interfaces with the values of the wlan (iface, name, address, essid, etc.). Look at here:http://www.debian.org/doc/manuals/reference/ch-gateway.en.html A bit more complicate situation is if wlan is not always the same. In such a situation you must write a script that allows to distinguish between the different wlans (for instance, via comparison of known mac address and sniffed mac addres).Yes, you're right. Here is an example of this script which I found recently at http://planet.igalia.com:The /etc/network/interfaces could be like this one (being HomeNET and WorkNET two existing ESSID network identifiers): auto eth1 mapping eth1 script /root/WIFI/wldetect.sh map HomeNET HomeNET map WorkNET WorkNET iface HomeNET inet static address 192.168.1.2 netmask 255.255.255.0 gateway 192.168.1.1 wireless-essid HomeNET wireless-key s:mysecretpass1 open dns-nameservers 127.0.0.1 192.168.1.1 iface WorkNET inet dhcp wireless-essid WorkNET wireless-key s:mysecretpass2 open dns-nameservers 127.0.0.1 192.168.100.1The script /root/WIFI/wldetect.sh lists the available networks and chooses one of them being in a whitelist (HomeNET|WorkNET): #!/bin/sh # Config WL_IFACE=`iwconfig 2>/dev/null | { read A _; echo $A; };` # Reset the interface ifconfig $WL_IFACE down ifconfig $WL_IFACE 0.0.0.0 ifconfig $WL_IFACE up # Search networks NETWORKS=`iwlist $WL_IFACE scanning | grep ESSID | sed -e 's/.*"\(.*\)"/\1/'` # Bring down the interface ifconfig $WL_IFACE down # Select preferred networks for NET in $NETWORKS do case $NET in HomeNEt|WorkNET) echo $NET; exit 0; ;; esac done exit 1;iñ On Jue Dic 28 8:20 , 'Michael Stepanov' sent: On 12/28/06, Gary <gary@xxxxxxxxxxxx> wrote: Michael Stepanov wrote:> Maybe somebody knows how to connect to wlan from background or command> line? I'd like to avoid user interaction to up wlan. I use OS 2005. Why not set it to auto connect if you don't want user input...? I need to connect to WLAN right after boot of Nokia. But there is no possibility to configure it. User has to press connect icon to bring up network. -Gary_______________________________________________maemo-users mailing listmaemo-users@xxxxxxxxx https://maemo.org/mailman/listinfo/maemo-users -- Cheers,Michael _______________________________________________maemo-users mailing listmaemo-users@xxxxxxxxx https://maemo.org/mailman/listinfo/maemo-users-- Cheers,Michael

Next Message by Date:

Re: Connect to WLAN from command line

On 1/8/07, Kalle Valo <Kalle.Valo@xxxxxxxxx> wrote: "ext Michael Stepanov" <michael@xxxxxxxxxxxxx> writes:> ifconfig wlan0 up> iwconfig wlan0 enc MY_KEY mode managed essid MY_ESSID channel 6> > But I didn't see that IP address was assigned to wlan0 interface.You didn't run the DHCP client:udhcpc -i wlan0Correct! After I run this command the WLAN connection is establish. --Kalle Valo-- Cheers, Michael

Previous Message by Thread:

Re: Re: Connect to WLAN from command line

On 5 Jan 2007, pigeon@xxxxxxxxxxx wrote: > What's even worse is, I have to run that command line every 5 > seconds or so (I put it in the script in a while loop to run that and > then sleep 5), as the connection daemon seems to disconnect > automatically. I think it disconnects if there's no application using > the N770 framework/lib to make network connections. So if I have some > custom software that uses the network it won't help either. Quoting Kalle Valo: > You are interested in osso_iap_connect() call with OSSO_IAP_ANY IAP. > This document gives more information: > http://maemo.org/platform/docs/howtos/howto_connectivity_guide.html So you just need a very small program that calls this, then sleeps forever, I'd assume (maybe it needs an exit handler, I don't know). I can't install Scratchbox to develop for ITOS2006 on my machine here, so maybe someone else can compile that and try it. Hmm, is there a way to call osso_* functions from Perl? Ted

Next Message by Thread:

Re: Re: Connect to WLAN from command line

On 1/9/07, Michael Stepanov <michael@xxxxxxxxxxxxx> wrote: Did you specify an option in the connection manager do not break WLAN connection never? Maybe it may help to resolve this problem. I've got the same problem. With gconftool I can set the value of "timeout_wlan" to any value, but after fee seconds (about ten) it disconnects. My connectivity settings at the moment are: gconftool-2 -a /system/osso/connectivity/IAP timeout_dun_cs = 30 wlan_tx_power = 8 current = (no value set) timeout_wlan = 60 flightmode_wlan = false last_used_iap = rfid auto_connect = WLAN timeout_dun_ps = 0 disconnect_on_cover = true Any idea? -- Fabio Forno, PhD Istituto Superiore Mario Boella Jabber ID: xmpp:ff@xxxxxxxxxxxxxxx ** Try Jabber http://www.jabber.org
blog comments powered by Disqus

Home | News | Sitemap | FAQ | advertise | OSDir is an Inevitable website. GBiz is too!