Tiny Core Linux

General TC => Tiny Core Netbooks => Topic started by: rbacher on December 31, 2010, 09:42:12 AM

Title: wifi on the olpc xo
Post by: rbacher on December 31, 2010, 09:42:12 AM
I installed microcore (very basic) with jwm as the window manager, and it works great except for one thing -- I cannot connect to wifi that requires a password.  I am able to connect to an open access point with $ sudo iwconfig eth0 essid <name> so that much is working fine. But I need to connect to WPA-PSK wifi.  I tried to download wpa_supplicant following the instructions at http://wiki.tinycorelinux.com/Setting+up+Wifi.  But when I run $ tce-load -wi wpa_supplicant.tcz I get an error message that says "No such file or directory." The file it is looking for is
"wireless-2.6.31_xo1-20100728.1841.1.olpc.a0a0edb7d8cbadb.tcz." Can anyone help? Thanks
Title: Re: wifi on the olpc xo
Post by: curaga on December 31, 2010, 10:22:26 AM
I'm assuming you're running one of the XO remasters. How the wireless modules are arranged there we have no idea, but if they are not in a wireless-*.tcz extension, you can just remove that line from wpa-supplicant's .dep file.
Title: Re: wifi on the olpc xo
Post by: rbacher on December 31, 2010, 10:58:38 AM
I'm not sure if I am running an XO remaster or not. I set it up by using the [removed, see 6] plus some tinkering (hit and miss) on my own.  But, how can I remove the line you refer to from the wpa_supplicant .dep file? Where is the .dep file? Thanks
Title: Re: wifi on the olpc xo
Post by: curaga on December 31, 2010, 11:43:09 AM
The dep files are in your tce/optional directory. See /opt/.tce_dir for where the tce dir is.

The dep file is just text, use your favorite text editor to remove the line.
Title: Re: wifi on the olpc xo
Post by: rbacher on December 31, 2010, 01:48:44 PM
okay, I found the .dep files.  There was no .dep file for wpa_supplicant, so I wrote one with two lines:

openssl-0.9.8.tcz
wireless_tools.tcz

and saved it as /mnt/mmcblk0p1/tce/optional/wpa_supplicant.tcz.dep.  After that I was able to download and install wpa_supplicant.tcz (and it shows up in AppsAudit in On Boot Maintenance).  But... it's not running. If I run $ sudo find / -name wpa_supplicant, I get 3 files in the tce/optional directory (wpa_supplicant.tcz, wpa_supplicant.tcz.dep, and wpa_supplicant.tcz.md5.txt).  Any ideas?  Thanks for your help
Title: Re: wifi on the olpc xo
Post by: maro on December 31, 2010, 04:08:07 PM
Judging from your reported results of the 'find' command I'd say that the extension was downloaded but not installed. I can't offer an explanation how that has happened, but your observation about 'appsaudit' might not help here much further. With the 'appsaudit' "OnBoot" -> "Maintenance" one gets to see two lists: on the left hand (llabeled "Select") a list of all .tcz files in the '.../tce/optional' directory and on the right hand (labeled "On Boot Items") all entries from the '.../tce/onboot.lst' file. I would imagine that 'wpa_supplicant.tcz' would at least show up on the left hand side, but that does not mean that it is installed.

To check if a entension 'EXT.tcz' is really installed I'd recommend to do two things: (a) check that a file or a link named 'EXT' exists in '/usr/local/tce.installed' (e.g. via ls -l '/usr/local/tce.installed/wpa_supplicant) and (b) check that a non-empty directory named EXT exists under '/tmp/tcloop' (e.g. via ls -l /tmp/tcloop/wpa_supplicant). Under normal circumstances both conditions should be fulfilled for any installed application, but I've run by now often enough into situations where that was not the case, so I consider it important to check both conditions and not just one of them.

If it turns out that the extension is not installed, I'd try to do so with tce-load -i wpa_supplicant (provided that '/opt/.tce_dir' points to the parent directory where the extension file is located).
Title: Re: wifi on the olpc xo
Post by: rbacher on December 31, 2010, 04:58:29 PM
I agree that it's not installed (but why?). About appsaudit, it (wpa_supplicant) shows up on the right side (On Boot Items).  When I do steps (a) and (b) I get the exact same results (expected) but neither wireless_tools.tcz nor wpa_supplicant.tcz shows up in either directory. When I run tce-load -i wpa_supplicant, the result is "wireless-KERNEL.tcz not found!"  I get the same result when I run tce-load -i wireless_tools. I note that wireless.KERNEL.tcz is listed in the .dep file for wireless_tools.tcz in the Version 3.x Repository at http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/tcz_3x.html.  What is wireless.KERNEL.tcz? Thanks for trying to help me
Title: Re: wifi on the olpc xo
Post by: rbacher on December 31, 2010, 05:10:25 PM
I got it. Not exactly sure what I did. Your suggestion to run tce-load -i EXT helped to solve the problem. I edited the .dep files to remove wireless_KERNEL.tcz, then ran tce-load -i wireless_tools, and that worked, then ran tce-load -i wpa_supplicant, and that also worked. Thanks for your help. Now I will work with wpa_supplicant to see if I can connect to a wifi with a password (which was the original objective)
Title: Re: wifi on the olpc xo
Post by: maro on December 31, 2010, 05:11:06 PM
OK, at least we are getting somewhere. The problem you've run into is due to a "flaw" in the 'tce-load' script. And now quoting myself from an earierler thread:
Quote
... It [i.e. 'tce-load'] changes at download time the entries in the '.dep' files from 'KERNEL' to the actual value (e.g. '2.6.33.3-tinycore', which is the output of 'uname -r'). I personally believe that downloaded files should not be "fudged". I also believe that you should keep all downloaded file names intact. But you could then "mimic that flaw" of 'tce-load' by "fudging" the entries in the '.dep' files in the same way. You should then be able to use 'tce-load -i EXT' with the expected result.

So just change in all .dep files the 'KERNEL' to the output of 'uname -r' and run the 'tce-load -i ...' again.


EDIT: Well, I must have hit the 'Save' button a few seconds too late, but you seem to have made some progress anyway ...
Title: Re: wifi on the olpc xo
Post by: curaga on January 01, 2011, 01:21:28 AM
@maro: that is unrelated here, seeing as the xo remaster doesn't have a wireless* extension. It would have failed with runtime replacement too.
Title: Re: wifi on the olpc xo
Post by: rbacher on January 02, 2011, 12:13:07 PM
I think I figured this out. The root of the problem was the wireless_tools dep file. It had wireless_KERNEL.tcz in it. When I did tce-load -wi wireless_tools.tcz, the process jammed up when it couldn't find wireless_xo1-20100728.1841.1.olpc.a0a0edb7d8cbadb.tcz. The xo1-20100728.1841.1.olpca0a0edb7d8cbadb is the kernel name. I ran uname -r and that's the result I got. I think I have some kind of unusual set up that allows Tinycore (microcore in my case) to run on an OLPC XO computer. So now (I think) I understand the cause. The solution I discovered before understanding the cause -- simply delete the problem line from the wireless dep file (it's the only line so you end up with nothing in the file). Then I was able to tce-load -wi wireless_tools.tcz, and after that was able to get wpa_supplicant.

The next surprise, though, was that wpa_supplicant wouldn't work per the instructions. The wpa_passphrase worked fine, and I wrote the config.conf file with the long psk number I got from passphrase, but wpa_supplicant didn't run right. I got several error messages.

I gave up on trying to connect from the command line and installed wicd. Of course what I learned about getting wireless_tools and wpa_supplicant installed on an XO was necessary, as it turns out, since they are both needed for wicd. My boot time now, with microcore + chromium browser + wicd is still under 40 sec, so I think I got what I need at this point. Again, thanks for helping me.