How to configure wifi from the commandline

How to do things, solutions, recipes, tutorials
Message
Author
boone773
Posts: 9
Joined: Mon 07 Jul 2008, 10:25

#46 Post by boone773 »

Thanks for your quick reply guys, I really appreciate it!

I tried with the s: prefix and got a lot further but still I can't browse.
I attached a screenshot of the commandlines.

I am currently using an ASUS WL-167G dongle.

Conncection Wizard recognizes the USB, recognizes my active network, I click on "Wireless", "Scan", click on my network, click on "WEP", enter my network key (actually the password, tried s: as prefix here but that didn't help), click "Use this profile", Wizard reports success, I click on "Acquire DHCP IP", Wizard reports success, but I cannot open any websites?!

I figured since the Wizard won't do the trick I'd try the commandline...

Any ideas?

Thanks, Boone

Edit: Attachment removed
Last edited by boone773 on Wed 09 Jul 2008, 09:46, edited 1 time in total.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#47 Post by tempestuous »

First I would disable encryption at your wifi router and check that a wifi connection will succeed in this unencrypted mode.

If OK, I would now try with WEP encryption again, but I would pre-load all encryption-related modules before running the iwconfig commands, as explained in PART 4 of the Wifi HOWTO.

If still no success, I would try the alternative form of running dhcpcd, like this -

Code: Select all

dhcpcd -I '' -t 30 -h puppypc -d wlan0

pudgypup
Posts: 29
Joined: Fri 11 Apr 2008, 18:44
Location: Alabama

desktop wireless

#48 Post by pudgypup »

In my office, we have 2 desktops, 1 router, 1 USB wireless netopia ralink, rt2570. I can open puppy 3.01 on both, and access internet from the one with the router. When I try to configure on the USB connection, puppy recognizes it is rausb0, says it has a live network, but the light on the wireless device does not come on, and auto dchp cannot connect. I will try the command line instructions at the beginning of this post, but I'm not sure if I'm in the correct thread. If not, please direct me, if so please help.
Thanks
Rick

boone773
Posts: 9
Joined: Mon 07 Jul 2008, 10:25

#49 Post by boone773 »

@tempestous:

No idea what the problem was with WEP, I switched to WPAPSK, used your tutorial and *bang* works perfectly fine right away!

Thanks a ton mate, you really were of great help! I could never have done this without your great howto! You're great!

pudgypup
Posts: 29
Joined: Fri 11 Apr 2008, 18:44
Location: Alabama

Re: desktop wireless

#50 Post by pudgypup »

pudgypup wrote:In my office, we have 2 desktops, 1 router, 1 USB wireless netopia ralink, rt2570. I can open puppy 3.01 on both, and access internet from the one with the router. When I try to configure on the USB connection, puppy recognizes it is rausb0, says it has a live network, but the light on the wireless device does not come on, and auto dchp cannot connect. I will try the command line instructions at the beginning of this post, but I'm not sure if I'm in the correct thread. If not, please direct me, if so please help.
Thanks
Rick
During a retry of config, I did a scan for the network, loaded the module, checked WEP tab, typed in the encryption key, and now I'm on!!!!

I know it looks like a "Duh" moment, but things you've seen a million times can suddenly come clear, which it did for me. Thanks All!
Rick

nath2omt
Posts: 19
Joined: Fri 18 Jul 2008, 13:22

TRENDnet TEW-441PC works with Puppy 4.0 BUT

#51 Post by nath2omt »

Please help, it could be just a few lines of code.

I got a Trendnet TEW-441PC card (Atheros chipset) for an old IBM laptop with Puppy 4.0, I can get to the internet, but I have to use Network Wizard each time the computer turns on. Here's what happens:

1. Click "ath0', then click "Wireless", it says "Unable" to detect the network, but it goes to "test ath0".

2. The testing ("test ath0") finds my network and suggest I go do DHCP.

3. Using automatic DHCP to scan, it finds my network (Buffalo), and I key in my PSK for the WPA, it gets me connected.

4. BUT, the next time I turn on the computer, the connection icon blinks normally, but when I try to get back to the last website (or any), I cannot and the blink stops too. Then I have to do the Network Wizard again.

Don't know enough to tackle the problem, but it seems a piece of cake for you guys. Thanks for any instructions, howtos, links, etc.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#52 Post by tempestuous »

Your query relates to the Network Wizard, and you have not run any manual commands. It is not relevant to this thread.
Please start a separate topic.

nath2omt
Posts: 19
Joined: Fri 18 Jul 2008, 13:22

how to skip?

#53 Post by nath2omt »

It's so close, just one more push please. Question: How to get out of the loop after issuing wpa_supplicant command?

With the wpa_supplicant command, it keep reporting
>
1216511294.948946: Scan results: 1
1111111111.111111: RTM_NEWLINK: operstate=1 ifi_flag=Ox11043 ([UP][RUNNING][LOWER_UP]
1111111111.111111: Wireless event: cmd=0x8b19 len=8
1111111111.111111: Received 291 bytes of scan results (1 BSSes)
>
The numbers change each time, but the messages stay the same (I used 1's instead of the real numbers second line on).

Of course without ending this, the dhcpcd command cannot be issued. But, issuing the dhcpcd command in a second rxvt window, everything goes fine.

So, if I know the command to get out of the wpa-supplicant loop, I can piece together a script to set up the wireless connection in one piece.

Thanks everyone who offered help, and please help with this one.

nath2omt
Posts: 19
Joined: Fri 18 Jul 2008, 13:22

TRENDnet TEW-441PC works in Puppy 4.0!

#54 Post by nath2omt »

I got it. It now runs perfectly. The '-Bw' in the wpa_supplicant command did the trick.
wpa_supplicant -iath0 -Dwext -c/etc/wpa_supplicant.conf -Bw

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#55 Post by tempestuous »

nath2omt wrote:But, issuing the dhcpcd command in a second rxvt window, everything goes fine.
Yes, that's the method I intended users to take, but I now realise I didn't explain it properly. I have just updated the earlier instructions.
nath2omt wrote:The '-Bw' in the wpa_supplicant command did the trick.
Actually you should only need "-B" which will background the wpa_supplicant daemon. I have added this information to the earlier post ... with a warning not to do this until you know for certain that the wpa_supplicant command is successful, because once backgrounded you won't see any error messages.

nath2omt
Posts: 19
Joined: Fri 18 Jul 2008, 13:22

#56 Post by nath2omt »

Thanks for this good thread, tempestuous. It has clear enough instructions and good leads from participants to help me, who knows little about computer, to configure my wireless connection. This could be the first reported case with the Trendnet tew-441pc card (Atheros chipset) in Puppy 4.0. You're right regarding the 'w', I don't think it needs to wait any longer to execute the next command.

frankc
Posts: 15
Joined: Thu 31 Jul 2008, 03:37
Location: California

rt2500

#57 Post by frankc »

I had this old Gateway laptop that I was going to give to charity. Then I read about PuppyLInux and I changed my mind. I did some reading up. The laptop has a Hawking HWC54G wireless PCMCIA card, Rev R. Research told me that the chipset was rt2500. More research led me to tempestous's writeups.

So I installed PuppyLinux 4.0.0. I manually entered the iwpriv and iwconfig commands from the howto. I used WPA2. I made some typos but finally got it right. Then I entered the dhcpcd command. The interface (ra0) acquired an IP address . I was able to surf the internet and start a chat session. Boy was I happy. I then created a script that had all the commands in it. Or so I thought. I rebooted the machine to test it out. I have not been able to get it to work since which is really frustrating.

I also tried re-installing but that also did not work.

I have also used the additional modprobe commands to load the additional encryption modules.

Anyone have any suggestions.

Frank

stevesr0
Posts: 169
Joined: Sun 24 Jun 2007, 17:25

#58 Post by stevesr0 »

I have not been able to setup automatic connection to the Internet on my home wireless network, although the saved configuration in the Network Wizard easily loads and then connects each time when I use the autoDHCP service.

I used the commands listed in this thread in a console and was able to connect, so I added these commands to my /etc/rc.d/rc.local file.

However, this doesn't work automatically when I reboot.

-------------------------------------------
The rc.local file contents are:

#this file called from rc.local0
#you can edit this file
#When firewall is installed, will append lines to this file...
modprobe evdev
#dhcpcd eth0
#added commands to start home2 connection automatically
rmmod bcm43xx
modprobe bcm43xx
sleep 5s
ifconfig eth0 up
iwconfig eth0 essid xxxxxxx
iwconfig eth0 channel x
iwconfig eth0 mode managed
iwconfig eth0 key open xxxxxxxxxxxxxxxx
rm -f /var/lib/dhcpcd/*.info
rm -f /var/run/*.pid
route default gw 192.168.2.1 eth0
dhcpcd -t 30 -h puppypc -d eth0

if [ -x /etc/rc.d/rc.firewall ]; then
/etc/rc.d/rc.firewall start
fi
--------------------------------------------------------------------------------------

I added the section below the #added comments line to the line dealing with firewalls (if [ -x...).

I don't know what the purpose of the modprobe evdev is and I commented the next line out dhcpcd eth0 since I added a line for dhcpcd.

I am not sure what is wrong with this and would appreciate comments.

I should also note that running these commands from the console worked the first time, but after booting with the modified rc.local, and finding I wasn't connected, running the commands sequentially from the console DIDN'T work (but then the network wizard did).

Thanks for any help.

Steve

rodb
Posts: 19
Joined: Thu 02 Mar 2006, 21:32

best in the business

#59 Post by rodb »

windows works ... ( correction: worked, before the big crash, with no recovery cd, no nothing, thx, lenovo 3000 c200), windows vista)

puppy still doesnt, but ethernet finally has me connected, so my happiness quotient is much improved (alpha 6)

wireless connectivity has degraded, for me,, since 4.00 - so i cant really be complaining too much - if i wanted reliability, i would be sticking with 4.00, right?

rodb

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#60 Post by tempestuous »

stevesr0,
When you run the Network Wizard it creates a configuration file somewhere - maybe /etc/netconfig or similar?
I'm away from a Linux computer for several days, so I can't check the details.
This configuration file is then referenced during boot up to automatically configure your saved network settings.
I suspect that this configuration file will conflict with the setup commands that you manually added to /etc/rc.d/rc.local
So the solution would be to delete the configuration file.

rodb,
If the wifi connection that you refer to is configured via the Network Wizard instead of manual commands then your post is off-topic in this thread. The correct thread would be one of the alpha bug reports, or Dougal's thread about improving the Wizard.

stevesr0
Posts: 169
Joined: Sun 24 Jun 2007, 17:25

#61 Post by stevesr0 »

I Googled around and found a statement that the configuration files are saved as /etc/name of adaptermode and /etc/name of adapter wireless.

In /etc, I found /etc/eth0mode, /etc/eth0oldmode, /etc/eth0wireless, /etc/wlan0mode and /etc/wlan0wireless.

The three mode files all have the following content:
echo "Trying to get IP address from DHCP server (60sec timeout)..."
echo "Trying to get IP address from DHCP server (60sec timeout)..." > /dev/console
rm /etc/dhcpc/dhcpcd-adapter name.pid 2>/dev/null #if left over from last session, causes trouble.
rm /etc/dhcpc/dhcpcd-adapter name.cache 2>/dev/null #ditto
rm /etc/dhcpc/dhcpcd-adapter name.info 2>/dev/null #ditto
if [ ! -f /root/.dhcpcd.duid ];then
[ -d /etc/dhcpc ] && dhcpcd adapter name || dhcpcd -I '' eth0
else
#[ ! -d /var/lib/dhcpcd ] && mkdir /var/lib/dhcpcd
#[ -s /root/.dhcpcd.duid ] && cp /root/.dhcpcd.duid /var/lib/dhcpcd/dhcpcd.duid
dhcpcd adapter name
fi
and the two wireless files are very similar:

wlan0wireless:
#Configure the wireless interface
echo "Configuring wireless interface wlan0"
ifconfig wlan0 up

iwconfig wlan0 essid "name"
iwconfig wlan0 mode managed
iwconfig wlan0 key open wep key

eth0wireless:
#Configure the wireless interface
echo "Configuring wireless interface eth0"
ifconfig eth0 up

iwconfig eth0 essid "name"
iwconfig eth0 channel x
iwconfig eth0 mode managed
iwconfig eth0 ap xxxxxxxxxx
iwconfig eth0 key open wep key

The eth0 wireless file is the one I select after rebooting to successfully configure my wifi and I then connect via auto DHCP.

Are you suggesting that my problems may be because there are multiple wireless and/or mode files in addition to the code I wrote into my rc.local file?

...And, as a corollary, eliminating the running of these files at boot (by deleting or renaming them) would then likely lead to the running of the rc.local file?

Steve

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#62 Post by tempestuous »

stevesr0 wrote:Are you suggesting that my problems may be because there are multiple wireless and/or mode files in addition to the code I wrote into my rc.local file?
Yes
stevesr0 wrote:...And, as a corollary, eliminating the running of these files at boot (by deleting or renaming them) would then likely lead to the running of the rc.local file?
Yes

stevesr0
Posts: 169
Joined: Sun 24 Jun 2007, 17:25

Solved, if I broadcast

#63 Post by stevesr0 »

Deleting the files didn't work.

I then tried adjusting the rc.local file by adding the address of the router and removing the route add gw command. No change.

Finally, recalling past experience having a problem configuring when my router wasn't broadcasting (and rarsa's comment about broadcasting NOT improving security), I changed the router setting to broadcast the ssid.

In my next (and only, so far) reboot, the connection was automatically made.

It is peculiar that neither my linux based Nokia internet tablet nor this laptop (with Puppy) when running Windows XP have a problem connecting without my router broadcasting.
Somehow, I still feel more secure if my router is not broadcasting.

In rarsa's thread on getting his bcm43xx using computer to autoconnect, he mentions a revised network file (for 4.01, but said to probably work on earlier puppies) on the developer blog. I read the note and tried to look at the file (following a link to ibiblio) but got a 404 error.

Thanks for your help. I am glad to remove extra files when I can. It makes me feel a little more in charge of my system.

Steve

fleamour
Posts: 158
Joined: Tue 20 May 2008, 00:06
Location: UK

#64 Post by fleamour »

Both my network printers print the boxed out code as gobbledygook?!? Not the greatest of help really.

nic2109
Posts: 405
Joined: Mon 01 Jan 2007, 20:24
Location: Hayslope, near Middlemarch, Midlands, England

#65 Post by nic2109 »

Hi; under Puppy 3 and 4.0 this all works just fine with the now obsolete iwp3945 driver module. But with the newer kernels where the module is iwl3945 it's a different story.

I've tried this all the way including the last section on Trouble-shooting encryption but still it's no good - no WPA encrypted wireless. :( .

Open works, WEP works, but WPA is a no-no. Old Network Wizard; new Network wizard; command-line (as per this How-to) are all the same.

Specifically, with the command-line the wpa_supplicant command just loops round endlessly.

Would it be helpful to capture the output and post it? If so, how? I tried to > it into a logfile but that didn't work as some of the output was treated as a command and did some very strange things.
[color=darkblue][b][size=150]Nick[/size][/b][/color]

Post Reply