VectorLinux
December 19, 2014, 07:23:15 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: inserting delays into rc.local (automating Wireless)  (Read 6062 times)
mick12345678
Vectorite
***
Posts: 140


« on: July 28, 2008, 11:24:15 am »

I have succeeded in getting a Netgear WG111T to connect to my WiFi router using WPA, much to my surprise  Grin. (using Standard 5.8, ndiswrapper, Vista drivers).

What works is this :

Ifplugd brings up the wlan0 interface, then

Code:
iwconfig wlan0 essid "myrouter"
Code:

Wait for the ssid association to happen, then

Code:
wpa_supplicant -Dwext -i wlan0 -c/etc/wpa_supplicant.conf
Code:

Wait a bit, then

Code:
dhcpcd wlan0
Code:

I am now ready to put this into rc.local, so as to automate it.

Question is - how do I configure the delays ?
Better question - can I avoid hard-coded delays by getting stage 2 to trigger on completion of stage 1 ?
Logged
M0E-lnx
Administrator
Vectorian
*****
Posts: 3195



« Reply #1 on: July 28, 2008, 11:57:58 am »

You can automate just the exact time to wait by concatenating your commands into one line
in your case
Code:
iwconfig wlan0 essid "yourRouter" && wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf && dhcpcd wlan0 &
That will automate the entire thing
Logged

mick12345678
Vectorite
***
Posts: 140


« Reply #2 on: July 28, 2008, 02:00:42 pm »

thanks - hole in one, by the sound of it  Grin
I will try that.
Logged
mick12345678
Vectorite
***
Posts: 140


« Reply #3 on: July 30, 2008, 11:18:10 am »

well, everything worked except the dhcp bit - I had to do that manually (which did then work).
It seems running dhcp on completion of the WPA setup is not enough - it needs a definite delay.

So, I'll try static addressing.
I know what I need to add to the "rc.inet<n>" file to do this, but how do I know what value of <n> to use ?
I know its not "inet1", as that is for eth0, which is the LAN port (which works).
"inet2" references "eth1", but my wireless port is "wlan0". Is "wlan0" an alias for "eth1" ?

 
« Last Edit: July 30, 2008, 12:00:42 pm by mick12345678 » Logged
nightshift
Member
*
Posts: 22


« Reply #4 on: July 30, 2008, 05:19:12 pm »

Hi mick12345678:

    The command you are looking for is "sleep <n>" where <n> it the seconds you want to sleep.

from MOE-lnx
Quote
iwconfig wlan0 essid "yourRouter" && wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf && dhcpcd wlan0 &

I am not sure if sleep lets say 10 seconds will work in MOE-lnx's command but you can try it.
iwconfig wlan0 essid "yourRouter" && wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf && sleep 10 && dhcpcd wlan0 &

nightshift
Logged
mick12345678
Vectorite
***
Posts: 140


« Reply #5 on: July 31, 2008, 02:30:12 pm »

thanks - I'll try that when I revert back to dhcp.

For now, I have got everything working using static. Here is what I have in rc.local

Code:
ifconfig wlan0 192.168.1.7 netmask 255.255.255.0
route add default gw 192.168.1.254
iwconfig wlan0 essid "mrstestalot" && wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf  &

« Last Edit: July 31, 2008, 02:32:50 pm by mick12345678 » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!