Neo FreeRunner Wifi

From Openmoko

Revision as of 22:14, 4 August 2008 by Tingo (Talk | contribs)

Jump to: navigation, search


Contents

What APs are available

Wireless access points can be listed like this:

root@om-gta02:~# iwlist eth0 scan

Using WPA and /etc/network/interfaces

Once you have a /etc/wpa_supplicant/wpa_supplicant.conf file, add a line under the eth0 entry in /etc/network/interfaces:

iface eth0 inet dhcp
   wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Save your changes and run:

 # ifdown eth0 && ifup eth0

You'll get a lot of messages, like ioctl[SIOCSIWENCODEEXT]: Operation not supported and sed: unrecognized option `--quiet', they appear to be harmless. The "--quiet" error message can be avoided by replacing "sed --quiet" with "sed -n" in /etc/wpa_supplicant/*.sh

Using WEP and /etc/network/interfaces

 iface eth0 inet dhcp
   wireless-key my_wep_key
   wireless-essid my_essid
iface eth0 inet dhcp
   wpa-wep-key0 my_wep_key
   wpa-key-mgmt NONE
   wpa-ssid my_essid

Save your changes and run:

 # ifdown eth0 && ifup eth0

Manual attempt

Create and edit a suitable /etc/wpa_supplicant/wpa_supplicant.conf

root@om-gta02:~# ifup eth0
root@om-gta02:~# wpa_supplicant -ieth0 -c/etc/wpa_supplicant/wpa_supplicant.conf -B
root@om-gta02:~# udhcpc eth0

Sample wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1 
# WPA2:
network={
       ssid="your ssid"
       scan_ssid=1
       proto=RSN
       key_mgmt=WPA-PSK
       pairwise=CCMP TKIP
       group=TKIP CCMP
       psk="secret key"
       priority=50
}

# WPA:
network={
      ssid="your_ssid"
      proto=WPA
      key_mgmt=WPA-PSK
      pairwise=TKIP
      group=TKIP
      scan_ssid=1
      psk="secret key"
      priority=10
}

# WEP:
network={
     ssid="your_ssid"
     scan_ssid=1
     key_mgmt=NONE
     wep_tx_keyidx=0
     wep_key0=your_hex_key
     priority=8
}

# Open:
network={
     ssid="your ssid"
     key_mgmt=NONE
     priority=5
}
wpa_supplicant.conf explained

The highest priority is tried first then falls back to the next highest number.

priority=100 1st
then
priority=99

 

# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers
network={
	ssid="AP_ESSID"
	psk="presharedkey"
	priority=5
}


#try open AP regardless of its SSID.
# change root password before you go roaming around it could prove dangerous
network={
	key_mgmt=NONE
priority=1  #try any open AP last
}

A more in depth explanation can be found here:
http://hostap.epitest.fi/gitweb/gitweb.cgi?p=hostap.git;a=blob_plain;f=wpa_supplicant/wpa_supplicant.conf

A very ugly /etc/init.d/wlan startscript

#!/bin/sh
#
# wlan	This shell script starts and stops wlan.
#
# processname: wlan

# Source function library.
#. /etc/rc.d/init.d/functions
# "written" by HdR

RETVAL=0
prog="wlan"

# test -f /etc/default/$prog && . /etc/default/$prog

start() {
	echo -n "Starting $prog: "
	ifconfig eth0 up
	wpa_supplicant -ieth0 -c/etc/wpa_supplicant/wpa_supplicant.conf -B
	sleep 10
	udhcpc eth0
	RETVAL=$?
	return $RETVAL
}

stop() {
	# Stop daemons.
	echo -n "Shutting down $prog: "
        killall wpa_supplicant
	ifconfig eth0 down
#        killproc gpsd
	RETVAL=$?
	return $RETVAL
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart|reload)
	stop
	start
	RETVAL=$?
	;;
  *)
	echo "Usage: $0 {start|stop|restart}"
	exit 1
esac

exit $RETVAL

Stability issues

2nd of august 2008

Using the above methods i can only get a succesful connection about every 10th time i try. I get an IP, but after that it is extremely unstable. Trying to ping www.google.com only results in an answer every 30 secs or so, and using the wifi connection for anything useful such as installing software using opkg is almost impossible. I've had these issues with two different FreeRunners and two different AP's. - El Senator

Available Software

Here are some applications available to aid in WiFi administration:

lint-wifi

lint-wifi work in progress
http://wiki.openmoko.org/wiki/Lint-wifi

Mofi

Mofi is software for the OpenMoko platform allowing phone users to search for and connect to wireless access points within range.

Personal tools
Key pages on:
Neo FreeRunner


What APs are available

Wireless access points can be listed like this:

root@om-gta02:~# iwlist eth0 scan

Using WPA and /etc/network/interfaces

Once you have a /etc/wpa_supplicant/wpa_supplicant.conf file, add a line under the eth0 entry in /etc/network/interfaces:

iface eth0 inet dhcp
   wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Save your changes and run:

 # ifdown eth0 && ifup eth0

You'll get a lot of messages, like ioctl[SIOCSIWENCODEEXT]: Operation not supported and sed: unrecognized option `--quiet', they appear to be harmless. The "--quiet" error message can be avoided by replacing "sed --quiet" with "sed -n" in /etc/wpa_supplicant/*.sh

Using WEP and /etc/network/interfaces

 iface eth0 inet dhcp
   wireless-key my_wep_key
   wireless-essid my_essid
iface eth0 inet dhcp
   wpa-wep-key0 my_wep_key
   wpa-key-mgmt NONE
   wpa-ssid my_essid

Save your changes and run:

 # ifdown eth0 && ifup eth0

Manual attempt

Create and edit a suitable /etc/wpa_supplicant/wpa_supplicant.conf

root@om-gta02:~# ifup eth0
root@om-gta02:~# wpa_supplicant -ieth0 -c/etc/wpa_supplicant/wpa_supplicant.conf -B
root@om-gta02:~# udhcpc eth0

Sample wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1 
# WPA2:
network={
       ssid="your ssid"
       scan_ssid=1
       proto=RSN
       key_mgmt=WPA-PSK
       pairwise=CCMP TKIP
       group=TKIP CCMP
       psk="secret key"
       priority=50
}

# WPA:
network={
      ssid="your_ssid"
      proto=WPA
      key_mgmt=WPA-PSK
      pairwise=TKIP
      group=TKIP
      scan_ssid=1
      psk="secret key"
      priority=10
}

# WEP:
network={
     ssid="your_ssid"
     scan_ssid=1
     key_mgmt=NONE
     wep_tx_keyidx=0
     wep_key0=your_hex_key
     priority=8
}

# Open:
network={
     ssid="your ssid"
     key_mgmt=NONE
     priority=5
}
wpa_supplicant.conf explained

The highest priority is tried first then falls back to the next highest number.

priority=100 1st
then
priority=99

 

# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers
network={
	ssid="AP_ESSID"
	psk="presharedkey"
	priority=5
}


#try open AP regardless of its SSID.
# change root password before you go roaming around it could prove dangerous
network={
	key_mgmt=NONE
priority=1  #try any open AP last
}

A more in depth explanation can be found here:
http://hostap.epitest.fi/gitweb/gitweb.cgi?p=hostap.git;a=blob_plain;f=wpa_supplicant/wpa_supplicant.conf

A very ugly /etc/init.d/wlan startscript

#!/bin/sh
#
# wlan	This shell script starts and stops wlan.
#
# processname: wlan

# Source function library.
#. /etc/rc.d/init.d/functions
# "written" by HdR

RETVAL=0
prog="wlan"

# test -f /etc/default/$prog && . /etc/default/$prog

start() {
	echo -n "Starting $prog: "
	ifconfig eth0 up
	wpa_supplicant -ieth0 -c/etc/wpa_supplicant/wpa_supplicant.conf -B
	sleep 10
	udhcpc eth0
	RETVAL=$?
	return $RETVAL
}

stop() {
	# Stop daemons.
	echo -n "Shutting down $prog: "
        killall wpa_supplicant
	ifconfig eth0 down
#        killproc gpsd
	RETVAL=$?
	return $RETVAL
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart|reload)
	stop
	start
	RETVAL=$?
	;;
  *)
	echo "Usage: $0 {start|stop|restart}"
	exit 1
esac

exit $RETVAL

Stability issues

2nd of august 2008

Using the above methods i can only get a succesful connection about every 10th time i try. I get an IP, but after that it is extremely unstable. Trying to ping www.google.com only results in an answer every 30 secs or so, and using the wifi connection for anything useful such as installing software using opkg is almost impossible. I've had these issues with two different FreeRunners and two different AP's. - El Senator

Available Software

Here are some applications available to aid in WiFi administration:

lint-wifi

lint-wifi work in progress
http://wiki.openmoko.org/wiki/Lint-wifi

Mofi

Mofi is software for the OpenMoko platform allowing phone users to search for and connect to wireless access points within range.