1) Create a new file as /etc/wpa_supplicant.conf containing the following:
Code: Select all
ctrl_interface=/var/run/wpa_supplicant
ap_scan=2
update_config=1
network={
id_str="some name to identify the connection you are creating"
ssid="the SSID name of your router"
psk="the shared key password for your router"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
priority=1
}
type: rm /etc/dhcpc/* (This step removes the dhcpcd config file which persists in an installed pupngo from the previous session and prevents the new dhcpcd from running correctly)
type: ifconfig eth1 up
(this brings up the network adapter - obviously not always eth1 for everyone)
type: wpa_supplicant -B -D wext -i eth1 -c /etc/wpa_supplicant.conf
(this will then connect but the terminal may appear to hang. Wait for about 30 seconds to allow the connection to be made between the PC and the router, then open a new terminal and continue...)
3) type: dhcpcd -t 30 -h pupngo -d eth1
(the pupngo is the hostname, which ordinarily should be made unique so each PC stays separately identified, but for the sake of testing the connection script I stayed with the default of pupngo for now)
4) type: ifconfig (and check that IP has been correctly assigned)
When I first tried to write the terminal commands up as a single script it didn't work because I did not have the -B switch in the string. The issue was that the script got hung up at the wpa_supplicant step and wouldn't proceed on to the dhcpcd step. Tempestuous offers a way around this by including the -B switch in the wpa_supplicant string.
http://www.murga-linux.com/puppy/viewto ... 9&start=10tempestuous wrote:wpa_supplicant may take about 30 seconds to negotiate the connection.
Hopefully you will see a connection reported, then you can open a second console and proceed to obtain an IP address (DHCP).
It's possible to background the wpa_supplicant process in order to keep using the same xterminal by adding "-B" to the command
... but do this only once you know that the wpa_supplicant command is successful, because once backgrounded you won't see any error messages.
So, my final script is:
Code: Select all
#!/bin/sh
rm /etc/dhcpc/*
ifconfig eth1 up
sleep 2
wpa_supplicant -B -D wext -i eth1 -c /etc/wpa_supplicant.conf
sleep 30
dhcpcd -t 30 -h pupngo -d eth1
I have included this script in the /root/startup folder so that my machine now connects quickly after each boot. I think it might be possible for me to make it connect even faster if I can get the script to run earlier on, maybe by putting it into one of the files within /etc/rc.d I think? More research to do.