NWA

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (Sounds)
m (Sounds)
Line 50: Line 50:
 
The last has to be defined better, should you signal a new network only one? only one per session? etc. etc.
 
The last has to be defined better, should you signal a new network only one? only one per session? etc. etc.
 
==Sounds==
 
==Sounds==
Popup has to be associated with sounds to warn the user if he is not looking at the device.
+
Popup has to be associated with sounds to warn the user when not looking at the device.
  
 
''please suggest some free sounds in every format supported by FSO/gstreamer''
 
''please suggest some free sounds in every format supported by FSO/gstreamer''
  
 
As alternative some software synthetizer may be used.
 
As alternative some software synthetizer may be used.
 
This may be achieved with the up/down scripts, but an embedded mech working out of box may be preferred.
 
  
 
==Configuration==
 
==Configuration==

Revision as of 09:43, 1 July 2009

Contents

Introduction

Nwa1.png

WiFi on the freerunner has some problems, see WiFi Managers.

So I decided to start a project to concentrate all the ideas about an ideal (but simple) GUI applet to manage WiFi connection.

The project is actually only a prealpha prototype to discover issues and implementation solutions. When ideas and needs will be clear it may be reimplemented in a more elegant way and with your preferred toolkit, now I'm using what I know better, C++ and QT with fast and dirty coding style!

It actually manages wpa_supplicant trough dbus and spawns udhcpc directly, replicating some Network Manager features. When a solid rock network manager will be available for the freerunner, and will handle the specific device capabilities/issues, NWA may be migrated to use it's api.

Please partecipate with contributions, ideas, hints as this may become your preferred WiFi manager for a while!!! edit the discussion page or this if you prefer, or contact me by email at nicola.mfb at gmail.com

Requirements

A supplicant

The main target is to use wpa_supplicant in a decent way, e.g. as a supplicant! You'll add your preferred networks at home, at works, at your friend house and so on, and it will scan silently for them, will connect when available and show a notification window/sound to alert you.

User has to be able to:

  • enable/disable configured networks
  • change the networks priority
  • add new network manually or scanning the area
  • configure advanced network properties, WPA enteprise, EAP, etc.

Static IP vs DHCP

The user should choose between static ip address or dhcp.

DNS handling

It has to be able to restore some default DNS when exiting dhcp, suggestion on possible solutions are appreciated.

System tray applet

A sys tray icon should be showed changing it's aspect to reflect connection status. It should indicate:

  • inactive state (wifi disabled)
  • scanning
  • associated
  • complete (associated + authenticated)
  • key renewal
  • complete + ip address received from dhcp or set manually
  • signal strenght when associated
  • historical signal strenght (like a graph scrolling every x seconds)
  • if some networks are present in the area

Some special handling is required for Window Managers that does not support sys tray specification (like E17).

Popup messages

Popup transient messages should be showed when:

  • connection fully complete, showing the received ip address
  • connection closed
  • wifi card enabled/disable
  • network found (if not connected)

The last has to be defined better, should you signal a new network only one? only one per session? etc. etc.

Sounds

Popup has to be associated with sounds to warn the user when not looking at the device.

please suggest some free sounds in every format supported by FSO/gstreamer

As alternative some software synthetizer may be used.

Configuration

The configuration file should be in xml format, a default one will be provided that scan and connect to any open network, so the user may use NWA out of the box. When the user changes settings, the default file is copied in $HOME/.nwa.conf, that one will override the default.

The GUI must be complete but simple and should not allow the user to break the configuration with random clicks, all advanced tasks may be achieved editing the configuration file manually:

  • dhcp client to use
  • custom scripts to launch at iface up/down, ip received
  • ...

Device Integration

NWA prefers FSO frameworkd based distro but should be capable to run on everywhere.

2.6.29 kernel workaround

On OM 2.6.29 kernels wifi is broken, software putting down the interface (e.g. wpa supplicant when tell it to unmanage eth0) will break ar6000 module. A workaround has to be implemented and activable in the configuration file.

Power Managment

With some AP the atheros power managment creates problems, NWA should support disabling it.

Development status/issues

Wpa_supplicant dbus interface is not complete, if you quit the program in some hard way (signaling, closing X, etc) network definitions will not be deleted and at the next run NWA will be crazy.

  • kill wpa_supplicant at startup :)
  • implementimplemented a remove/readadd interface to wpa when NWA is starting (it should delete all network definition, to be tested)
  • bore wpa_supplicant authors to implement the full dbus interface
  • implements signal handling hooks (howewer a kill -9 will bypass it)

qnetutils.cpp has to be improved to determine the ssid of the network you are connected to as wpa_supplicant does not signal it.

The first prealpha prototype is quite ready, it was developed on debian with Matchbox and matchbox-panel as sys trayer, under E balloon sys tray messages are showed in a random position on the screen, so some special work around is needed a primitive but animated "tooltip" was implemented. Multiple not overlapping message showing has to be implemented. I preferred to avoid qt sys tray baloon message completely, as if the tray icon is in a middle/left position (becouse other tray icon are present), in some cases they are not readable.

The qt stylesheet has to be improved.

Some small coding fixes need to be done, and some stupid comments removed :)

Some of the above should be achieved in the next few days when code and binaries will be available for first prealpha testing.

A 2.6.29 rude workaround was implemented, when you quit the NWA it does not kill udhcpc and deconfigure eth0 from wpa_supplicant (always remove networks) but simply release the FSO WiFi resources, removing the interface without deconfiguring it fixes the problem but for timing reasons on a very busy system it may not work. We may think to rmmod/insmod ar6000 but it's a very crude hack and sometimes kernel opses.

A startup script, launched when supplicant association is complete, is already implemented, it's a crude way to disable power management.

Actually only dhcp is supported, I have to study a bit more rtnetlink to implement it :) in the mean time I'm planning to support per-network command file execution and dhcp disabling, so you may use some script to configure the interface with a dhcp address. It should be sufficient for a prototype.

Wpa-supplicant does not signal the network name when associates, so I need to implement the ssid retrevial via AF_INET ioctl or rtnetlink (if possible).

Actually destroying a running thread when application quits leads a "application crashed" on E, I'm not caring of it now.

Configuring

Example configuration file

<xml version="1.0">                                                                             
<!-- This is the default configuration file for nwa, and contains a                             
     basic configuration for the openmoko freerunner.                                           
     The user configuration file is $HOME/.nwa.conf and overrides this -->                      

<!-- in the following section we define all possible dhcp clients -->
 <dhcpclients>
  <dhcpclient name="udhcpc -f" default="yes"/>
  <dhcpclient name="dhcpcd" />
  <dhcpclient name="dhclient" />
  <dhcpclient name="none" />
 </dhcpclients>
<!-- autoenable wlan interface activation at startup -->
 <autoenable value="no" />
<!-- interface card, usually eth0, on some distro is eth1 (hackable1) -->
 <iface name="eth0" />
<!-- here are stored the network definitions, the default allows to connect
     to every open ap -->
 <networks>
  <network name="Any Open" key_mgmt="NONE" enabled="yes"/>
 </networks>
<!-- scripts that are runned when wpa_supplicant complete authentication and when it disconnects
     if you run nwa as non privileged user you may define a sudo call to launch/kill the dhcpcd c
lient
     (disabiling the main dhcp section setting it to none -->
 <ifupscript path=""/>
 <ifdownscript path=""/>
 <brokenkernelhack value="yes"/>
 <apscan mode="1"/>
 <!-- disable/enable fso use to:
     * enable/disable wifi
     * use idlenotifyer to bring up display on popup message and at startup
     * play notification sound with gstreamer -->
 <usefso value="true"/>
</xml>
Personal tools

Introduction

Nwa1.png

WiFi on the freerunner has some problems, see WiFi Managers.

So I decided to start a project to concentrate all the ideas about an ideal (but simple) GUI applet to manage WiFi connection.

The project is actually only a prealpha prototype to discover issues and implementation solutions. When ideas and needs will be clear it may be reimplemented in a more elegant way and with your preferred toolkit, now I'm using what I know better, C++ and QT with fast and dirty coding style!

It actually manages wpa_supplicant trough dbus and spawns udhcpc directly, replicating some Network Manager features. When a solid rock network manager will be available for the freerunner, and will handle the specific device capabilities/issues, NWA may be migrated to use it's api.

Please partecipate with contributions, ideas, hints as this may become your preferred WiFi manager for a while!!! edit the discussion page or this if you prefer, or contact me by email at nicola.mfb at gmail.com

Requirements

A supplicant

The main target is to use wpa_supplicant in a decent way, e.g. as a supplicant! You'll add your preferred networks at home, at works, at your friend house and so on, and it will scan silently for them, will connect when available and show a notification window/sound to alert you.

User has to be able to:

  • enable/disable configured networks
  • change the networks priority
  • add new network manually or scanning the area
  • configure advanced network properties, WPA enteprise, EAP, etc.

Static IP vs DHCP

The user should choose between static ip address or dhcp.

DNS handling

It has to be able to restore some default DNS when exiting dhcp, suggestion on possible solutions are appreciated.

System tray applet

A sys tray icon should be showed changing it's aspect to reflect connection status. It should indicate:

  • inactive state (wifi disabled)
  • scanning
  • associated
  • complete (associated + authenticated)
  • key renewal
  • complete + ip address received from dhcp or set manually
  • signal strenght when associated
  • historical signal strenght (like a graph scrolling every x seconds)
  • if some networks are present in the area

Some special handling is required for Window Managers that does not support sys tray specification (like E17).

Popup messages

Popup transient messages should be showed when:

  • connection fully complete, showing the received ip address
  • connection closed
  • wifi card enabled/disable
  • network found (if not connected)

The last has to be defined better, should you signal a new network only one? only one per session? etc. etc.

Sounds

Popup has to be associated with sounds to warn the user if he is not looking at the device.

please suggest some free sounds in every format supported by FSO/gstreamer

As alternative some software synthetizer may be used.

This may be achieved with the up/down scripts, but an embedded mech working out of box may be preferred.

Configuration

The configuration file should be in xml format, a default one will be provided that scan and connect to any open network, so the user may use NWA out of the box. When the user changes settings, the default file is copied in $HOME/.nwa.conf, that one will override the default.

The GUI must be complete but simple and should not allow the user to break the configuration with random clicks, all advanced tasks may be achieved editing the configuration file manually:

  • dhcp client to use
  • custom scripts to launch at iface up/down, ip received
  • ...

Device Integration

NWA prefers FSO frameworkd based distro but should be capable to run on everywhere.

2.6.29 kernel workaround

On OM 2.6.29 kernels wifi is broken, software putting down the interface (e.g. wpa supplicant when tell it to unmanage eth0) will break ar6000 module. A workaround has to be implemented and activable in the configuration file.

Power Managment

With some AP the atheros power managment creates problems, NWA should support disabling it.

Development status/issues

Wpa_supplicant dbus interface is not complete, if you quit the program in some hard way (signaling, closing X, etc) network definitions will not be deleted and at the next run NWA will be crazy.

  • kill wpa_supplicant at startup :)
  • implementimplemented a remove/readadd interface to wpa when NWA is starting (it should delete all network definition, to be tested)
  • bore wpa_supplicant authors to implement the full dbus interface
  • implements signal handling hooks (howewer a kill -9 will bypass it)

qnetutils.cpp has to be improved to determine the ssid of the network you are connected to as wpa_supplicant does not signal it.

The first prealpha prototype is quite ready, it was developed on debian with Matchbox and matchbox-panel as sys trayer, under E balloon sys tray messages are showed in a random position on the screen, so some special work around is needed a primitive but animated "tooltip" was implemented. Multiple not overlapping message showing has to be implemented. I preferred to avoid qt sys tray baloon message completely, as if the tray icon is in a middle/left position (becouse other tray icon are present), in some cases they are not readable.

The qt stylesheet has to be improved.

Some small coding fixes need to be done, and some stupid comments removed :)

Some of the above should be achieved in the next few days when code and binaries will be available for first prealpha testing.

A 2.6.29 rude workaround was implemented, when you quit the NWA it does not kill udhcpc and deconfigure eth0 from wpa_supplicant (always remove networks) but simply release the FSO WiFi resources, removing the interface without deconfiguring it fixes the problem but for timing reasons on a very busy system it may not work. We may think to rmmod/insmod ar6000 but it's a very crude hack and sometimes kernel opses.

A startup script, launched when supplicant association is complete, is already implemented, it's a crude way to disable power management.

Actually only dhcp is supported, I have to study a bit more rtnetlink to implement it :) in the mean time I'm planning to support per-network command file execution and dhcp disabling, so you may use some script to configure the interface with a dhcp address. It should be sufficient for a prototype.

Wpa-supplicant does not signal the network name when associates, so I need to implement the ssid retrevial via AF_INET ioctl or rtnetlink (if possible).

Actually destroying a running thread when application quits leads a "application crashed" on E, I'm not caring of it now.

Configuring

Example configuration file

<xml version="1.0">                                                                             
<!-- This is the default configuration file for nwa, and contains a                             
     basic configuration for the openmoko freerunner.                                           
     The user configuration file is $HOME/.nwa.conf and overrides this -->                      

<!-- in the following section we define all possible dhcp clients -->
 <dhcpclients>
  <dhcpclient name="udhcpc -f" default="yes"/>
  <dhcpclient name="dhcpcd" />
  <dhcpclient name="dhclient" />
  <dhcpclient name="none" />
 </dhcpclients>
<!-- autoenable wlan interface activation at startup -->
 <autoenable value="no" />
<!-- interface card, usually eth0, on some distro is eth1 (hackable1) -->
 <iface name="eth0" />
<!-- here are stored the network definitions, the default allows to connect
     to every open ap -->
 <networks>
  <network name="Any Open" key_mgmt="NONE" enabled="yes"/>
 </networks>
<!-- scripts that are runned when wpa_supplicant complete authentication and when it disconnects
     if you run nwa as non privileged user you may define a sudo call to launch/kill the dhcpcd c
lient
     (disabiling the main dhcp section setting it to none -->
 <ifupscript path=""/>
 <ifdownscript path=""/>
 <brokenkernelhack value="yes"/>
 <apscan mode="1"/>
 <!-- disable/enable fso use to:
     * enable/disable wifi
     * use idlenotifyer to bring up display on popup message and at startup
     * play notification sound with gstreamer -->
 <usefso value="true"/>
</xml>