WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Atheros WiFi Howto -- feedback wanted  (Read 8179 times)

Offline spillz

  • Newbie
  • *
  • Posts: 29
Atheros WiFi Howto -- feedback wanted
« on: July 12, 2009, 04:21:51 PM »
This is a first draft of a howto on wifi. Comments/edits welcome. I'm not all that familiar with tinycore internals, network tech and network jargon so I'm sure there are mistakes.

Can merge some info from the existing wifi howto (e.g. getting other drivers)

---------------------------------------------

Here are some instructions for getting wifi to work in tinycore with minimal dependencies and not too much fuss.

Note: If you want a more out of the box wifi setup, you can install the wicd package, which will offer you a gui to take care of all the connection details. The only price is extra package dependencies.

Prerequisites:
1. You have a working tinycore system with some support for persistence (a tce directory and either a backup/restore point or a persistent /opt directory) <-- link to appropriate howtos
2. Your wireless hardware is supported by the open source Atheros wifi drivers
3. You want to connect to an open access point or WPA-PSK secured AP (you do care about security don't you?)

Initial Preparation

1. boot tinycore and install the needed wireless packages if you haven't already
* wireless_tools.tce -- gives you iwconfig and other tools
* wireless-2.6.29.1-tinycore.tcem -- open source atheros wifi drivers
* wpa-supplicant.tce (which depends on openssl-0.9.8h.tcel) -- wpa_supplicant tool for negotiating secured access points
If you will be installing to a system that depends on wifi access you may find it easier to pre-download these files and copy them to your tinycore tce directory so that they are installed at boot time.

2. the wireless-2.6.29.1-tinycore package automatically installs the open source atheros drivers (ath5k/ath9k), these will autoload into tinycore once you have the pacakages installed.
double check they are there by running the following at the command line:
Code: [Select]
modprobe -l | grep ath
you should see the ath9k.ko.gz and ath5k.ko.gz device driver files

you can also
Code: [Select]
lsmod | grep ath
to verify modules are actually loaded


3. now make sure you can see your wireless hardware. in the console run:

Code: [Select]
iwconfig

you should see a list of interfaces with some status info. your wireless interface will likely show up as wlan0 (but maybe ath0 or eth0?). You need to remember the name of this interface as it will be used later

Connecting to an open access point (haven't actually tested this properly yet)

1. To connection to a particular access point, all you need to do is type in the console
Code: [Select]
iwconfig <interface> essid <network-id>

to search for access points, use the command
Code: [Select]
iwlist scanning.

to connect to the nearest access point, just use:
Code: [Select]
iwconfig <interface> essid any
2.To finalize the connection (getting IP address etc),  go to control panel, open the netcardconfig tool. switch eth0 to the name of your interface (e.g. wlan0). Change "use DHCP Broadcast?" to yes, leave "Save Configuration" as yes. Hit apply. This will save and run a script /opt/<interface>.sh. In addition, the /opt/bootlocal.sh (the script run at boot) will now include /opt/<interface>.sh. If your /opt directory is not persistent, make sure you do a backup when you boot or you will need to rerun this tool each time you boot.

3. At this point you should have a working network connection. If it doesn't work you might need to play around with the udhcpc commandline (the gui in step 2 makes a udhcpc call, but there are additional options that may be needed)

4. If you don't want to have to run step 1 and 2 every time you boot, you can add the command to your /opt/bootlocal.sh file before the line that calls /opt/<interface>.sh script (make sure you backup!)

Connecting to a WPA-PSK secured access point

Before you start, you need to look up your access point id (ssid) and passphrase (a string).

1. At the command line, run
Code: [Select]
wpa_passphrase <essid> <passphrase>

For example:
Code: [Select]
~$ wpa_passphrase mynetwork mypassphrase
network={
ssid="mynetwork"
#psk="mypassphrase"
psk=f242925f83787084d58101d5eb52485989e2a553983bfe6fc5b8d27fdfa063bd
}

2. Now create a file in your favorite editor replacing the ssid and psk values below with result from step 1:

Code: [Select]
ctrl_interface=/var/run/wpa_supplicant

network={
        ssid=mynetwork
        proto=WPA
        key_mgmt=WPA-PSK
        pairwise=TKIP
        group=TKIP
        psk=f242925f83787084d58101d5eb52485989e2a553983bfe6fc5b8d27fdfa063bd
}

Note that this assumes a fairly conventional WPA-PSK setup. If you need to use other security (e.g. WEP) or are connecting to a more sophisticated network you may have to tweak this file. See the wpa_supplicant manual for more info. (What if you connect to more than one WPA-PSK network -- can add as many network sections to the conf file as needed)

save it as /opt/wpa_configure.conf (then to ensure it is persistent in the system, add the line opt/wpa_configure.conf to /opt/.filetool.lst)

3. to connect to the access point, run in the console:
Code: [Select]
wpa_supplicant -i<interface> -c/opt/wpa_supplicant.conf &
(what diagnostics can be run here to verify the connection? iwconfig etc)

4. now to finalize the connection (getting IP address etc), go to control panel, open the netcardconfig tool. switch eth0 to the name of your interface (e.g. wlan0). Change "use DHCP Broadcast?" to yes, leave "Save Configuration" as yes. Hit apply. This will save and run a script /opt/<interface>.sh. In addition, the /opt/bootlocal.sh (the script run at boot) will now include /opt/<interface>.sh. If your /opt directory is not persistent, make sure you do a backup when you boot or you will need to rerun this tool each time you boot.

5. At this point you should have a working network connection. If it doesn't work you might need to tweak the wpa_supplicant configuration or the udhcpc command line.

6. If you don't want to have to run step 3 and 4 every time you boot, you can add the wpa_supplicant command in line 3 to your /opt/bootlocal.sh file before the line that calls /opt/<interface>.sh script (make sure you backup!)
« Last Edit: July 13, 2009, 04:50:53 PM by spillz »

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Atheros WiFi Howto -- feedback wanted
« Reply #1 on: July 14, 2009, 09:37:34 AM »
Looks good to me. Thanks for sharing.
Now if it was just in the Wiki it would be easier to find and update.

Instead of calling netcardconfig you could just issue the command udhcpc -i <interface>, e.g.,
udhcpc -i wlan0 but either is fine.
10+ Years Contributing to Linux Open Source Projects.

Offline spillz

  • Newbie
  • *
  • Posts: 29
Re: Atheros WiFi Howto -- feedback wanted
« Reply #2 on: July 14, 2009, 09:46:51 AM »
Looks good to me. Thanks for sharing.
Now if it was just in the Wiki it would be easier to find and update.

will do.

Quote
Instead of calling netcardconfig you could just issue the command udhcpc -i <interface>, e.g.,
udhcpc -i wlan0 but either is fine.

yeah, will put that in as alternative

Offline spillz

  • Newbie
  • *
  • Posts: 29

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Atheros WiFi Howto -- feedback wanted
« Reply #4 on: July 20, 2009, 03:17:28 PM »
Thank you for your contribution to the Wiki.
Documentation is an area that can always use much help from the community.
10+ Years Contributing to Linux Open Source Projects.

Offline OldAdamUser2

  • Full Member
  • ***
  • Posts: 199
Re: Atheros WiFi Howto -- feedback wanted
« Reply #5 on: October 03, 2009, 08:55:35 PM »
I have had a little difficulty getting a reliable wifi connection, but final success seems to have come by following your instructions very closely.

In particular, I may have run into problems by first connecting with eth0 and installing the various .tce packages as per instructions and then unplugging the ethernet connection and trying an immediate wifi (wlan0) connection. I got that to work once or twice and then I ran into problems.

Success may have come (fingers crossed) by first getting the relevant packages installed to a persistent directory, then removing my backup to a usb, and starting over with no ethernet connection. (I saved your instructions to a text file so that they would be availabe to me.) That worked.

Thanks for your help.

To summarize my experience, the key things are:

First install to a persistent directory --

    * wireless_tools.tce
    * wireless-2.6.29.1-tinycore.tcem
    * wpa-supplicant.tce

Then  open a terminal window and type

    iwconfig *interface* essid *network-id*

(I'm not sure about "iwlist scanning"--I'll try it on next boot.)

And finally,

    udhcpc -i *interface*

(The Control Panel > Netcardconfig system wasn't as easy, but may work too.)

THE BOTTOM LINE: Thanks for your instructions!

Offline OldAdamUser2

  • Full Member
  • ***
  • Posts: 199
Re: Atheros WiFi Howto -- Faliure after first Success
« Reply #6 on: October 04, 2009, 08:00:12 AM »
So I have gotten wifi working several times with my Eee900 by following the instructions on the wiki, but many more times it has failed to work. When it works, iwconfig finds my wifi signal and lists its essid. When it fails to work, iwconfig finds a signal but lists its essid as "" and connection is impossible. I tried resetting my modem/router with no results.

Baffling. . . . By the way Xandros and PupEee can connect to this wifi signal every time.

I like Tiny Core very much so I'm going to keep trying to figure this out. I'd appreciate any nudges in the right direction.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Atheros WiFi Howto -- feedback wanted
« Reply #7 on: October 04, 2009, 01:09:21 PM »
You might want to add the nodhcp boot option, as the default, in Tiny Core, is to launch a udhcpc request for each recognized  wired ethernet port.
10+ Years Contributing to Linux Open Source Projects.

Offline OldAdamUser2

  • Full Member
  • ***
  • Posts: 199
Re: Atheros WiFi Howto -- feedback wanted
« Reply #8 on: October 04, 2009, 05:09:48 PM »
I have added nodhcp to the boot codes, and it worked as it was supposed to do, but I still have the problem of iwconfig finding wifi signals but not indicating any essid. This occurs on three different wifi networks so it is not just my router/modem.

I wonder if Tiny Core might need a couple of additional modules to work reliably with the Eeepc900. I notice that both Xandros and PupEee have these two modules under lsmod that don't show up in Tiny Core:

wlan_scan_sta
ath_rate_atheros

Could they be causing wifi to fail more often than it succeeds  for me? (I have an 80-90% failure rate . . . but I HAVE connected, so I know this could be solved somehow.)

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Atheros WiFi Howto -- feedback wanted
« Reply #9 on: October 04, 2009, 05:50:44 PM »
There is a replacement for wireless-2.6.29.1-tinycore.tcem, see madwifi-hal.tczm
However, I have no problems with wireless-2.6.29.1-tinycore.tcem.
10+ Years Contributing to Linux Open Source Projects.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Atheros WiFi Howto -- feedback wanted
« Reply #10 on: October 04, 2009, 07:14:48 PM »
  Try wireless-2.6.29.1-tinycore_mod.tczm, which is specifically for atheros cards.  
  wireless-2.6.29.1-tinycore.tcem also fails with my atheros card, which is why I submitted the mod.

« Last Edit: October 04, 2009, 07:18:42 PM by jpeters »

Offline OldAdamUser2

  • Full Member
  • ***
  • Posts: 199
Re: Atheros WiFi Howto -- feedback wanted
« Reply #11 on: October 04, 2009, 09:39:41 PM »
Thanks, jpeters. It occurs to me now that I may have been using wireless-2.6.29.1-tinycore_mod.tczm when I got it to work and I may have shifted to   wireless-2.6.29.1-tinycore.tcem when I wanted it to load on boot. I don't have access to an eth0 connection right now, but I'll report back as soon as I can download it.

Offline OldAdamUser2

  • Full Member
  • ***
  • Posts: 199
Re: Atheros WiFi Howto -- feedback wanted
« Reply #12 on: October 05, 2009, 03:28:27 PM »
OK. I think I am now successful. THis is what has worked today:

1. I removed  wireless-2.6.29.1-tinycore.tcem
2. I loaded madwifi-hal.tczm
3. I entered
          sudo iwconfig ath0 essid any
          sudo udhcpc -i ath0

This has given me a connection--at least on the public wifi at the local mall. Oddly, Sudo iwconfig doesn't provide an essid name that will work, but that may be a quirk of the setup here.

Working once could mean working always.
« Last Edit: October 05, 2009, 03:32:00 PM by OldAdamUser2 »

Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
Re: Atheros WiFi Howto -- feedback wanted
« Reply #13 on: October 06, 2009, 08:40:26 PM »
I followed this procedure (or the one in the wiki) last night, got the ath wifi card going, but could not connect... stalled at step 3 of connecting to WPA where the report was that the file wpa_supplicant.conf could not be read or parsed. I made sure the file was actually there and went over the content several times to try and find the problem.

My wifi network works on WPA2 in puppy linux. So now I'm down to studying the wpa-supplicant manual as recommended in the wiki.

Also, in the wiki, there is mention of the easy way using wicd... this is not in the app depository?? Where does one get this file for tc?
Don't worry, I found the info that it has been pulled...
« Last Edit: October 06, 2009, 09:56:36 PM by jur »

Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
Re: Atheros WiFi Howto -- feedback wanted
« Reply #14 on: October 07, 2009, 08:45:39 PM »
I found the problem in your procedure:

the file wpa_supplicant config file is called by two names in the procedure, wpa_supplicant.conf and wpa_configuration.conf which caused my first try to fail.
Specifically,
Quote
save it as /opt/wpa_configure.conf (then to ensure it is persistent in the system, add the line opt/wpa_configure.conf to /opt/.filetool.lst)

3. to connect to the access point, run in the console:
Code:
wpa_supplicant -i<interface> -c/opt/wpa_supplicant.conf &

The wiki also needs to be fixed.

Thanks for your work! :)
« Last Edit: October 07, 2009, 08:47:31 PM by jur »