Difference between revisions of "WiFi"

From ArmadeusWiki
Jump to: navigation, search
m
(Common operations)
 
(32 intermediate revisions by 4 users not shown)
Line 1: Line 1:
To see your wireless configuration you need wireless tools selected in buildroot:
+
==Pre-requites==
<pre class=config>
+
{{Note| To configure Wi-Fi you need to [[Wireless Tools| install wireless tools]] first (done by default for APF27 / PPS / APF51 / APF6 / OPOS6UL) and of course also need to have a running Wi-Fi interface like: the [[Libertas_driver|one on APW extension board, APF51Dev or PPS devt boards]], the [[Wl12xx_driver|one on APF6]], the one on [[OPOS6UL]] or a [[USB_to_WiFi_adapter|USB to Wi-Fi adapter]], with corresponding Linux drivers loaded.}}
Package Selection for the target  --->
+
    [*] Networking  --->
+
        [*]   wireless tools
+
</pre>
+
then you can use ''iwconfig'' command.
+
  
<pre class=apf>
+
==Common operations==
 +
====List network interfaces supporting Wi-Fi====
 +
{|
 +
! Old BSPs !! New BSPs
 +
|-
 +
|<pre class=apf>
 
  # iwconfig
 
  # iwconfig
 
  lo        no wireless extensions.
 
  lo        no wireless extensions.
Line 27: Line 27:
 
           Tx excessive retries:0  Invalid misc:0  Missed beacon:0
 
           Tx excessive retries:0  Invalid misc:0  Missed beacon:0
 
</pre>
 
</pre>
 +
| <pre class=apf># iw dev
 +
phy#0
 +
        Interface wlan0
 +
                ifindex 3
 +
                wdev 0x1
 +
                addr 74:7a:90:e7:e0:d5
 +
                type managed
 +
                channel 34 (5170 MHz), width: 20 MHz, center1: 5170 MHz</pre>
 +
|}
  
To configure WiFi cryptography, only WEP can be set as is. If you want to
+
{{Note|Here our Wi-Fi network interface is called ''wlan0''. Depending on the number of your network interfaces or their model, this name could change. For example if using the Libertas drivers, the interface may be called ''eth1'' (if ''eth0'' is already used). In that case replace ''wlan0'' with your interface name.}}
configure dongle for WPA, install [http://hostap.epitest.fi/wpa_supplicant/
+
wpa_supplicant].
+
  
===== WEP configuration =====
+
====Activate the WLAN interface====
 +
{|
 +
! Old BSPs !! New BSPs
 +
|-
 +
|<pre class=apf>
 +
# ifconfig wlan0 up
 +
</pre>
 +
|<pre class=apf>
 +
# ip link set wlan0 up
 +
</pre>
 +
|}
  
Note : to see all access point available for your apf, use ''iwlist'' command :
+
==== Show all Access Points (AP) available for your APF (here with wlan0 interface) ====
 +
{|
 +
! Old BSPs !! New BSPs
 +
|-
 +
|<pre class=apf>
 +
# iwlist wlan0 scan
 +
 
 +
wlan0    Scan completed :
 +
          Cell 01 - Address: XX:XX:XX:66:47:48
 +
                    ESSID:"TOTO"
 +
                    Mode:Master
 +
                    Channel:1
 +
                    Frequency:2.412 GHz (Channel 1)
 +
                    Quality=88/100  Signal level:25/100
 +
                    Encryption key:on
 +
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
 +
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
 +
                              48 Mb/s; 54 Mb/s
 +
                    Extra:tsf=00000009d398fec8
 +
                    Extra: Last beacon: 1390ms ago
 +
...
 +
</pre>
 +
|<pre class=apf>
 +
# iw wlan0 scan
 +
 
 +
BSS XX:XX:XX:ed:c5:b0(on wlan0)
 +
        last seen: 1805.540s [boottime]
 +
        TSF: 0 usec (0d, 00:00:00)
 +
        freq: 2462
 +
        beacon interval: 120 TUs
 +
        capability: ESS Privacy ShortSlotTime RadioMeasure (0x1411)
 +
        signal: -90.00 dBm
 +
        last seen: 0 ms ago
 +
        SSID: TOTO
 +
        Supported rates: 1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0
 +
        DS Parameter set: channel 11
 +
        ...</pre>
 +
|}
 +
 
 +
==== Connect to an unencrypted AP ====
 +
{|
 +
! Old BSPs !! New BSPs
 +
|-
 +
|<pre class=apf>
 +
# iwconfig wlan0 essid AP_NAME
 +
</pre>
 +
* Check it:
 
<pre class=apf>
 
<pre class=apf>
# iwlist scanning
+
# iwconfig wlan0
 
</pre>
 
</pre>
  
This example is given for a WiFi Access Point named armadeus, but the key is
+
|<pre class=apf>
false of course ;) :
+
# iw dev wlan0 connect AP_NAME
 +
</pre>
 +
* Check it:
 +
<pre class=apf>
 +
# iw dev wlan0 link
 +
</pre>
 +
|}
 +
 
 +
==== Get an IP address ====
 +
<pre class=apf>
 +
# udhcpc -i wlan0
 +
</pre>
 +
 
 +
==Encryption settings==
 +
When configuring Wi-Fi cryptography, only WEP can be setup easily from a terminal with single commands. For a Wi-Fi network with a WPA/WPA2 protection system, you should install and configure [[WPA supplicant|wpa_supplicant]].
 +
 
 +
{{Warning| The Wi-Fi Alliance defined WPA/WPA2 protection protocol in response to serious weaknesses researchers had found in the previous system, WEP (Wired Equivalent Privacy). Therefore, we strongly recommend you to use WPA/WPA2 to protect your network. Our [[WPA supplicant|wpa_supplicant]] wiki page provides the procedure to configure a WPA/WPA2 access to your network
 +
}}
 +
 
 +
==== WEP configuration ====
 +
 
 +
This example is given for a Wi-Fi Access Point named ''armadeus'', the encoding key used here is not recommended, of course ;) :
  
 
<pre class=apf>
 
<pre class=apf>
 
  # iwconfig wlan0 essid armadeus
 
  # iwconfig wlan0 essid armadeus
 
  # iwconfig wlan0 key 12345678901234567890
 
  # iwconfig wlan0 key 12345678901234567890
  # ifconfig wlan0 up
+
  # ifconfig wlan0 up             (if interface is not already up)
firmware: requesting rt73.bin
+
 
  ADDRCONF(NETDEV_UP): wlan0: link is not ready
 
  ADDRCONF(NETDEV_UP): wlan0: link is not ready
 
  # ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
 
  # ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
 
</pre>
 
</pre>
  
Now, the WiFi adapter is ready and attached :
+
Now, the Wi-Fi adapter is ready and attached :
 
<pre class=apf>
 
<pre class=apf>
 
  # iwconfig
 
  # iwconfig
Line 74: Line 157:
 
</pre>
 
</pre>
  
We can configure the network to access internet via the WiFi interface instead of the Ethernet one :
+
==Accessing outside world==
 +
We can manually configure the network to access Internet via the Wi-Fi interface instead of the Ethernet one:
  
 
<pre class=apf>
 
<pre class=apf>
Line 89: Line 173:
 
  ~
 
  ~
 
  ~
 
  ~
 +
</pre>
 +
 +
If you have a DHCP server on your network, you can also use it and previous steps (route+resolv.conf) will be done automatically:
 +
<pre class=apf>
 +
# udhcpc -i wlan0
 
</pre>
 
</pre>
  
Line 103: Line 192:
 
</pre>
 
</pre>
  
===== Surf on the net =====
+
== Surf on the net ==
  
To surf on the web, you can use ''links'' software :
+
To surf on the web, you can use (for example) ''links'' software :
 
<pre class=apf>
 
<pre class=apf>
 
  # links www.armadeus.org
 
  # links www.armadeus.org
Line 113: Line 202:
  
 
==Links==
 
==Links==
* [[USB_to_WiFi_adapter|USB to WiFi adapters tested with Armadeus boards]]
+
* [[Wireless_Tools|Wireless Tools installation]]
 +
* [[USB_to_WiFi_adapter|USB to Wi-Fi adapters tested with Armadeus boards]]
 +
* [[Network_interface_bandwidth_measurement| Measure the bandwidth of your network interface]]
 +
* [[WPA_supplicant|WPA_supplicant]]
 +
* [[APF as Wi-Fi Access Point]]
  
 
[[Category:WiFi]]
 
[[Category:WiFi]]
 +
[[Category:Wireless]]

Latest revision as of 14:24, 30 January 2024

Pre-requites

Note Note: To configure Wi-Fi you need to install wireless tools first (done by default for APF27 / PPS / APF51 / APF6 / OPOS6UL) and of course also need to have a running Wi-Fi interface like: the one on APW extension board, APF51Dev or PPS devt boards, the one on APF6, the one on OPOS6UL or a USB to Wi-Fi adapter, with corresponding Linux drivers loaded.


Common operations

List network interfaces supporting Wi-Fi

Old BSPs New BSPs
 # iwconfig
 lo        no wireless extensions.
 
 eth0      no wireless extensions.
 
 sit0      no wireless extensions.
 
 wmaster0  no wireless extensions.
 
 wlan0     IEEE 802.11bg  ESSID:""  
           Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated   
           Tx-Power=0 dBm   
           Retry min limit:7   RTS thr:off   Fragment thr=2352 B   
           Encryption key:off
           Power Management:off
           Link Quality:0/100  Signal level:112/146  Noise level:0/0
           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
           Tx excessive retries:0  Invalid misc:0   Missed beacon:0
# iw dev
phy#0
        Interface wlan0
                ifindex 3
                wdev 0x1
                addr 74:7a:90:e7:e0:d5
                type managed
                channel 34 (5170 MHz), width: 20 MHz, center1: 5170 MHz
Note Note: Here our Wi-Fi network interface is called wlan0. Depending on the number of your network interfaces or their model, this name could change. For example if using the Libertas drivers, the interface may be called eth1 (if eth0 is already used). In that case replace wlan0 with your interface name.


Activate the WLAN interface

Old BSPs New BSPs
 # ifconfig wlan0 up
 # ip link set wlan0 up

Show all Access Points (AP) available for your APF (here with wlan0 interface)

Old BSPs New BSPs
# iwlist wlan0 scan

wlan0     Scan completed :
          Cell 01 - Address: XX:XX:XX:66:47:48
                    ESSID:"TOTO"
                    Mode:Master
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=88/100  Signal level:25/100
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Extra:tsf=00000009d398fec8
                    Extra: Last beacon: 1390ms ago
...
# iw wlan0 scan

BSS XX:XX:XX:ed:c5:b0(on wlan0)
        last seen: 1805.540s [boottime]
        TSF: 0 usec (0d, 00:00:00)
        freq: 2462
        beacon interval: 120 TUs
        capability: ESS Privacy ShortSlotTime RadioMeasure (0x1411)
        signal: -90.00 dBm
        last seen: 0 ms ago
        SSID: TOTO
        Supported rates: 1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 
        DS Parameter set: channel 11
        ...

Connect to an unencrypted AP

Old BSPs New BSPs
# iwconfig wlan0 essid AP_NAME
  • Check it:
# iwconfig wlan0
# iw dev wlan0 connect AP_NAME
  • Check it:
# iw dev wlan0 link

Get an IP address

# udhcpc -i wlan0

Encryption settings

When configuring Wi-Fi cryptography, only WEP can be setup easily from a terminal with single commands. For a Wi-Fi network with a WPA/WPA2 protection system, you should install and configure wpa_supplicant.

Warning Warning: The Wi-Fi Alliance defined WPA/WPA2 protection protocol in response to serious weaknesses researchers had found in the previous system, WEP (Wired Equivalent Privacy). Therefore, we strongly recommend you to use WPA/WPA2 to protect your network. Our wpa_supplicant wiki page provides the procedure to configure a WPA/WPA2 access to your network


WEP configuration

This example is given for a Wi-Fi Access Point named armadeus, the encoding key used here is not recommended, of course ;) :

 # iwconfig wlan0 essid armadeus
 # iwconfig wlan0 key 12345678901234567890
 # ifconfig wlan0 up             (if interface is not already up)
 ADDRCONF(NETDEV_UP): wlan0: link is not ready
 # ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

Now, the Wi-Fi adapter is ready and attached :

 # iwconfig
 lo        no wireless extensions.
 
 eth0      no wireless extensions.
 
 sit0      no wireless extensions.
 
 wmaster0  no wireless extensions.
 
 wlan0     IEEE 802.11bg  ESSID:"armadeus"  
           Mode:Managed  Frequency:2.437 GHz  Access Point: 00:1B:2F:E7:E4:08   
           Bit Rate=2 Mb/s   Tx-Power=7 dBm   
           Retry min limit:7   RTS thr:off   Fragment thr=2352 B   
           Encryption key:XXXXXXXXXXXXXXXXXXXXXXXXXX   Security mode:restricted
           Power Management:off
           Link Quality:0/100  Signal level:73/146  Noise level:0/0
           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
           Tx excessive retries:0  Invalid misc:0   Missed beacon:0
 

Accessing outside world

We can manually configure the network to access Internet via the Wi-Fi interface instead of the Ethernet one:

 # ifconfig eth0 down
 # ifconfig wlan0 192.168.0.212
 # route add default gw 192.168.0.1 dev wlan0

And configure the nameserver in /etc/resolv.conf

 domain dev.null
 nameserver 192.168.0.207
 ~                   
 ~
 ~

If you have a DHCP server on your network, you can also use it and previous steps (route+resolv.conf) will be done automatically:

# udhcpc -i wlan0

We can now ping the best website in the world :

 # ping www.armadeus.org
 PING www.armadeus.org (213.186.33.5): 56 data bytes
 64 bytes from 213.186.33.5: seq=0 ttl=122 time=66.735 ms
 64 bytes from 213.186.33.5: seq=1 ttl=122 time=50.392 ms
 ^C
 --- www.armadeus.org ping statistics ---
 2 packets transmitted, 2 packets received, 0% packet loss
 round-trip min/avg/max = 50.392/58.563/66.735 ms

Surf on the net

To surf on the web, you can use (for example) links software :

 # links www.armadeus.org

It's an ASCII internet browser. For more informations about Links.

Links