OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: daniel3000 on April 19, 2007, 12:28:18 pm

Title: Wpa Settings Integration Into Lan&wifi Config
Post by: daniel3000 on April 19, 2007, 12:28:18 pm
Hi guys,

I began to integrate WPA settings into the /usr/bin/network.py (LAN&WiFi settings) of pdaXrom 1.1.0beta3.

Since my Python knowledge is very limited, I have a working version, but it needs some tweaking.

What I have done so far is:
- Enhanced network.py by the necessary input fields for WPA settings,
- Write these WPA settings to the config file ~/Choices/network.cfg
- Read settings from ~/Choices/network.cfg when starting network.py and selecting a WPA-enabled scheme
- add "WPA=y" to the corresponding /etc/pcmcia/wireless.opts section when WPA is enabled
- Call wpa_passphrase "your SSID name" "your passphrase" > /etc/wpa_supplicant.conf
when hitting "OK" after configuring WPA, so that the wpa_supplicant config file is created.

So this version should be able to correctly create everything which is necessary for a WPA-enabled WiFi connection.

However, there are some problems:

1. When reading the settings from ~/Choices/network.cfg I get an error in line 553 of the script and the stored value of the wpakey_type is not read in correctly, resulting in an empty combobox field. Not a serious problem, but annoying. Don't know the reason due to limited Python knowledge.

2. Generation of the /etc/wpa-supplicant.conf file as it is now allows for only one WPA-enabled scheme (or more schemes sharing the same WPA settings).
How is it handled to have more PCMCIA / network schemes with different WPA settings? That's not primarily a problem of the python script, but rather a conceptual problem... except there is a syntax in wpa_supplicant.conf file which allows for this which I don't know yet.
Is it possible to simply append other network={} sections with different SSIDs to the file?

3. The input dialog size is a bit large when "wireless" is chosen (i.e. when the wireless tab is enabled). This is due to the additional input fields.
There is still some room for optimization (e.g. don't stack the checkboxes for "any ESSID" and "Power management", but put them side by side). but due to my limited Python knowledge I don't know how to do that.

I have NO experience with WPA so far and almost no experience with Python.
So don't consider this a professional approach please  

Also, I haven't tested the enhancement yet. Will do so on the weekend when I have time to set up WPA at my office. I think it should work because I designed the improvement to meet the instructions for WPA on the Tyrannozaurus Cacko website (http://www.tyrannozaurus.com/?q=cacko) (search for "WPA")

Please find the new python script attached. Remove .txt extension before executing.

Any hints for improvements are appreciated!
I hope we will soon have a fully working WPA-enabled LAN & WiFi config GUI.

Thanks
daniel
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: daniel3000 on April 23, 2007, 04:32:19 am
Hi,

anyone, by chance, got a German "T-Com Sinus 154 DSL Basic" router to work with wpa_supplicant?
I tried its settings "WPA2" and "WPA/WPA2", but for both, wpa_supplicant reports "skip - no WPA/RSN IE" for the router.
As I said, no experience with WPA so far, and googling rought up a LOT of hints in such a case. I tried a few of them, but no luck.

Code: [Select]
0: xx:xx:xx:xx:xx:xx ssid="WPATEST" wpa_ie_len=0 rsn_ie_len=0 caps=0x11
   skip - no WPA/RSN IE


Thanks
daniel
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: sdjf on April 25, 2007, 01:21:00 am
Daniel,

Are you making sure there is some kind of progress log available for debugging any problems?  It can save people a lot of grief if it's built in, the same as the qpe-pppd-log comes enabled on the Sharp ROMs.

I have figured out (but not tested) how to automatically enable dhcpcd logs, but not for pdaX-type roms, and wrote it up in the "Dhcpcd Logs" thread in Networking.

sdjf
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: daniel3000 on May 03, 2007, 03:03:41 am
Well, since this is just a modified lan&wifi pathon script, I don't have added or removed any logging functionality.

I may refine the work later on, and may add some logging as well.

A question:

Does it make sense to make WEP and WPA choosable both in one configuration? Or is this always alternative?

Currently, you can choose and setup both, but it seems all routers only offer it alternatively.
Is it technically possible to use WEP and WPA in one connection?

daniel
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: Meanie on May 03, 2007, 04:30:40 am
Quote
Well, since this is just a modified lan&wifi pathon script, I don't have added or removed any logging functionality.

I may refine the work later on, and may add some logging as well.

A question:

Does it make sense to make WEP and WPA choosable both in one configuration? Or is this always alternative?

Currently, you can choose and setup both, but it seems all routers only offer it alternatively.
Is it technically possible to use WEP and WPA in one connection?

daniel
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160344\"][{POST_SNAPBACK}][/a][/div]

is there any reason why you dont use wifi-radar? from what I can tell, it can store different wifi profiles and establish the connection as well. it also does wep and wpa.
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: daniel3000 on May 03, 2007, 08:27:38 am
Hi Meanie,

no specific reason.
I may even have tested it some time ago, but since I didn't choose to use it, I probably have found it not functional / stable / good enough.

But your description and what I found on the web about it sounds like a quite nice and complete solution.
Is it a replacement for the LAN&Wifi tool, so that it writes configuration files for the pcmcia subsystem, or is it a stand-alone solution which does not modify the system-wide configuration?

Can you recommend a good IPK of wifi-radar?
You haven't described it on your pdaXrom page.

Ah, just saw that you have it installed on pdaXii13, so I might have a look at it there.

Thanks for the tip!
daniel
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: Jon_J on May 23, 2007, 11:58:18 am
daniel3000, have you made any progress with this?
I tried it but cannot get my card, (Ambicom WL1100C-CF) to connect to my router using WPA
Using this same card in Cacko on my other zaurus, connects with no problems with WPA. I used the instructions at tyrannozaurus under "Cacko"

I know meanie suggested using wifi-radar, but for the life of me, I cannot find the "WPA driver" that is needed to use WPA in wifi-radar.
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: TJBK_TJB on May 24, 2007, 06:10:22 pm
Quote
daniel3000, have you made any progress with this?
I tried it but cannot get my card, (Ambicom WL1100C-CF) to connect to my router using WPA
Using this same card in Cacko on my other zaurus, connects with no problems with WPA. I used the instructions at tyrannozaurus under "Cacko"

I know meanie suggested using wifi-radar, but for the life of me, I cannot find the "WPA driver" that is needed to use WPA in wifi-radar.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=161887\"][{POST_SNAPBACK}][/a][/div]

I think the WPA driver is hostap, because that's what I type in as an argument to wpa_supplicant when I start it manually.

Edit:I just found that wifi-radar defaults to using eth1 instead of wlan0. To fix this, in /etc/wifi-radar.conf, replace "interface = eth1" with "interface = wlan0".
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: ckblackm on May 25, 2007, 11:49:32 am
Daniel's probably a bit busy at the moment... his wife gave birth recently to their 2nd child.  :-)

Christopher.
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: Jon_J on May 25, 2007, 01:26:18 pm
Quote
Quote
daniel3000, have you made any progress with this?
I tried it but cannot get my card, (Ambicom WL1100C-CF) to connect to my router using WPA
Using this same card in Cacko on my other zaurus, connects with no problems with WPA. I used the instructions at tyrannozaurus under "Cacko"

I know meanie suggested using wifi-radar, but for the life of me, I cannot find the "WPA driver" that is needed to use WPA in wifi-radar.
[div align=\"right\"][{POST_SNAPBACK}][/a][/div] (http://index.php?act=findpost&pid=161887\")

I think the WPA driver is hostap, because that's what I type in as an argument to wpa_supplicant when I start it manually.

Edit:I just found that wifi-radar defaults to using eth1 instead of wlan0. To fix this, in /etc/wifi-radar.conf, replace "interface = eth1" with "interface = wlan0".
[div align=\"right\"][a href=\"index.php?act=findpost&pid=161962\"][{POST_SNAPBACK}][/a][/div]
Thank you, I have been wondering what the name of the "driver" is called.
Googling for wifi-radar and wpa takes me to this wifi-radar man page, and it has "ipw" listed as the WPA driver being used in wifi-radar.
wifi-radar.conf page:
[a href=\"http://www.die.net/doc/linux/man/man5/wifi-radar.conf.5.html]http://www.die.net/doc/linux/man/man5/wifi-radar.conf.5.html[/url]
wifi-radar main page (man)
http://www.die.net/doc/linux/man/man1/wifi-radar.1.html (http://www.die.net/doc/linux/man/man1/wifi-radar.1.html)
I have read about wifi-radar defaulting to eth1. I have changed mine to wlan0
wifi-radar works fine in "non-security" mode.
I have picked up 2 open access points near my house, and one of them works really good, although I have only used "this" open AP to test wifi-radar's functionality.
I have since removed daniel3000's version of "network.py"
It was always ejecting my microdrive, and the "original network.py" that comes with pdaxii13 does not eject my microdrive.
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: daniel3000 on May 25, 2007, 03:15:15 pm
Quote
Daniel's probably a bit busy at the moment... his wife gave birth recently to their 2nd child.  :-)

Christopher.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=162029\"][{POST_SNAPBACK}][/a][/div]

Exactly :-)
Zaurus topics were suspended for some weeks. Now I'm slowly beginning to enter business again.

No, I didn't make any progress with this. However, I have ye to try some more WLAN routers with that setup.
Actually, it should work. However, the problem seems not to be that the setup doesn't do what it should, but that wpa_Supplicant or the WLAN driver or whatever does not recognize that the router uses WPA (so configuring WPA on the Zaurus cannot help in any way).

Will continue with that topic soon.

daniel
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: daniel3000 on May 26, 2007, 04:24:54 pm
Some more experiments today, but without success:

I compiled the latest stable wpa_supplicant (0.5.7) because I thought it would maybe work better.
No way. Same result.

I changed the driver used for my card from orinoco_cs to hostap_cs (by deleting /etc/pcmcia/hermes.conf  and adding the card-specific section from hermes.conf to hostap_cs.conf.
The driver is loaded. But the same results ("No WPA/RSN IE").
I hoped the hostap driver would be better compatible with wpa_supplicant because both are progammed by Jouni Malinen.

I also tried to call wpa_supplicant with different driver parameters (wext, hostap), but also to no avail.

My card is recognized on insertion as Intersil Firmware 1.5.6 which is said to be WPA compatible.

My MacBook is able to connect flawlessly to the WPA test network.

So far, I am stuck. Any further ideas?

Thanks a lot
daniel
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: Jon_J on May 27, 2007, 12:46:32 pm
There is a post that describes how someone is trying to get WPA working in pdaxrom.
https://www.oesf.org/forums/index.php?showtopic=22285&hl=wpa (https://www.oesf.org/forums/index.php?showtopic=22285&hl=wpa)
He mentions a bug in wpa_supplicant, which I also found in another post to be on line 26.
Quote
There is a bug in /etc/rc.d/init.d/wpa_supplicant, the "--" has to be removed
There are also some scripts posted, but I don't understand them, maybe there is a solution in there somewhere...
EDIT:
Is there any reason WPA in pdaxrom couldn't be done in a similar way as described for Cacko.?
This works fine on my Cacko Zaurus with the same Wifi CF card and Wifi router.
There is a guide to set up WPA in Cacko here, about 1/3 down this page.
http://www.tyrannozaurus.com/?q=cacko (http://www.tyrannozaurus.com/?q=cacko)
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: Jon_J on May 28, 2007, 10:52:20 am
If anyone is still following this thread, I just found a "Later" version of "wpa-supplicant"
wpa-supplicant_0.4.7-1_armv5tel.ipk 02-Mar-2006 03:44 119K
http://zaurus.spy.org/feeds/cacko/pdaXrom/...eta2/c760/feed/ (http://zaurus.spy.org/feeds/cacko/pdaXrom/1.1.0/beta2/c760/feed/)

I had been previously using wpa-supplicant_0.3.9-1_armv5tel.ipk (found in the beta3 feed).
Since all my other related files are of the "0.4.7-1" version, it make sense to install the above "wpa-supplicant_0.4.7-1" version.
I now have these related files installed:
hostapd_0.4.7-1_armv5tel.ipk
hostap-driver_0.4.7-1_armv5tel.ipk
hostap-utils_0.4.7-1_armv5tel.ipk
wpa-supplicant_0.4.7-1_armv5tel.ipk
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: daniel3000 on May 30, 2007, 05:51:59 am
Thanks, will test with that "--" fix. However, I am not sure yet if that rc file is used at all.
What exactly does the "WPA=y" entry in wireless.opts do?
I could not find any code which evaluates that flag and starts the wpa_supplicant rc script.
So far, in my attempts I started wpa_supplicant manually after inserting the WLAN card, and that raised the mentioned errors.

daniel
Title: Wpa Settings Integration Into Lan&wifi Config
Post by: Jon_J on May 30, 2007, 12:26:56 pm
Quote
Thanks, will test with that "--" fix. However, I am not sure yet if that rc file is used at all.
What exactly does the "WPA=y" entry in wireless.opts do?
I could not find any code which evaluates that flag and starts the wpa_supplicant rc script.
So far, in my attempts I started wpa_supplicant manually after inserting the WLAN card, and that raised the mentioned errors.

daniel
[div align=\"right\"][{POST_SNAPBACK}][/a][/div] (http://index.php?act=findpost&pid=162279\")
I don't understand a lot of technical details.
What is a "rc" file?
Here's a thread in Sharp ROMs with a very detailed description how to get WPA-PSK working.
"Wpa-psk With Cacko Rom"
[a href=\"https://www.oesf.org/forums/index.php?showtopic=10699]https://www.oesf.org/forums/index.php?showtopic=10699[/url]