Difference between revisions of "Wifi"

From wiki.emacinc.com
Jump to: navigation, search
m (Test..........)
m (Complete)
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{todo|Review (10.20.2015-14:23->JJ+);(10.20.2015-13:43->JJ+)|Jeffrey Jung| project=OE 5.0,JJ }}
+
{{todo| Complete (10.20.2015-14:23->JJ+);(10.20.2015-13:43->JJ+);(10.23.2015-11:50->MD-);(10.26.2015-16:50->JJ+);(10.27.2015-15:30->JJ+); (10.28.2015-15:05->JJ+);(10.28.2015-16:35->MD-); (11.2.2015-14:45->JJ+); (11.3.2015-19:35->MD-); (11.4.2015-14:40->JJ+);(11.05.2015-15:40->MD+); (11.10.2015-15:05->JJ-);(11.13.2015-14:00->MG+);(11.13.2015-14:44->KY+)|Jeffrey Jung| project=OE 5.0,Complete,JJ,MD,MG }}
{{#seo:
+
{{#seo:wireless, wifi, networking
 
|title=Wireless Networking
 
|title=Wireless Networking
 
|titlemode=append
 
|titlemode=append
|keywords=
+
|keywords=Linux wifi,embedded wifi
 
|description=How to access a wireless network
 
|description=How to access a wireless network
 
}}
 
}}
<span style="background:#00FF00;color:#FF0000;font-size:300%"></span>
+
 
This guide will illustrate how to set up and connect to a wireless network using the ThinkPenguin Wireless N USB Adapter for GNU/LINUX and the built-in WiFi on the SoM-200GS.
+
This guide will illustrate how to set up and connect to a wireless network using the ThinkPenguin Wireless N USB Adapter for GNU/Linux and the built-in WiFi on the SoM-200GS carrier.
 
__TOC__
 
__TOC__
  
 +
 +
<!--Background Information-->
 
{{:Templateimpl:bg | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }}  
 
{{:Templateimpl:bg | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }}  
Most modules from EMAC can be upgraded to use wireless networking via a USB adapter. The USB adapter can be purchased at the [https://www.thinkpenguin.com/gnu-linux/penguin-wireless-n-usb-adapter-gnu-linux-tpe-n150usb ThinkPenguin] website. EMAC's SoM-200GS carrier can optionally be ordered with built-in WiFi and bluetooth.  
+
While many boards from EMAC are not natively designed to connect to wireless networks, most of these systems do have USB ports. Using a USB wireless network adapter, a system can be equipped with wireless networking capability. Such a USB adapter can be ordered by contacting the [mailto:sales@emacinc.com sales team] here at EMAC. Request the product by its part number, PER-USB-00005-R.
  
 +
 +
This page describes the actions needed to connect to a wireless network using either a wireless network USB adapter, or the built-in Wi-Fi found on EMAC products like the SoM-200GS carrier. We chose to use the ThinkPenguin USB adapter for this page because it is well supported by the Linux kernel.
 +
 +
 +
<!-- General Information-->
 
{{:Templateimpl:geninfo | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }}  
 
{{:Templateimpl:geninfo | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }}  
  
===Setup===
 
# This process requires modifying some system files so start by allowing the system to read and write.
 
#:{{cli | username=root | hostname=ipac9x25 | mount -o remount,rw /}}
 
# Check for any updates.
 
#:{{cli | username=root | hostname=ipac9x25 | opkg update }}
 
# Install wpa-supplicant to allow connections to WPA and WPA2 protected networks.
 
#:{{cli | username=root | hostname=ipac9x25 | opkg install wpa-supplicant}}
 
# Install the firmware for the USB adapter.
 
#:{{cli | username=root | hostname=ipac9x25 | opkg install linux-firmware-ath9k}}
 
# Install the marvel firmware and the sd8787 firmware for built-in WiFi on the SoM-200GS.
 
#:{{cli | username=root | hostname=som9g45 | opkg install linux-firmware-marvel-license}}<br />{{cli | username=root | hostname=som9g45 | opkg install linux-firmware-sd8787}}
 
#Install the iw and wireless-tools packages.
 
#:{{cli | username=root | hostname=ipac9x25 | opgk install iw}} <br />  {{cli | username=root | hostname=ipac9x25 | opkg install wireless-tools}}
 
# Once everything has successfully installed, reboot the system. If you're using the USB adapter, plug in the adapter upon successful login. 
 
# More configuration to system files is required to establish a connection to the network. Mount the file system to read and write.
 
#:{{cli | username=root | hostname=ipac9x25 | mount -o remount,rw /}}
 
  
 +
<!-- Set Up Instructions -->
 +
===Set Up===
 +
Before the device can be connected to the network, some additional software may need to be installed. Boards with Wi-Fi built in should already have the proper software and drivers to support connecting to a wireless network. If so, skip to the [[#Wireless Networking|Wireless Networking]] section.
 +
 +
<cl>1. In order to obtain the new packages, connect the system to a physical network.
 +
<br clear=all>
 +
 +
* This process requires modifying some system files, so start by enabling read and write permissions to the filesystem.
 +
{{cli | indent=2 | mount -o remount,rw / | hostname=ipac9x25 }}
 +
 +
* A check for any updates to the package list is typically a good practice before installing new software. Use the <code>opkg</code> manager to update the package list. 
 +
{{cli | indent=2 | opkg update | hostname=ipac9x25 }}
 +
 +
* One of the best tools to establish the connection to wireless networks is the <code>wpa-supplicant</code> package. This supplicant will allow the system to make connections to WPA and WPA2 protected networks. Install this package with the <code>opkg</code> tool.
 +
{{cli | indent=2 | opkg install wpa-supplicant | hostname=ipac9x25 }}
 +
 +
* Install the wireless firmware
 +
* If using the USB adapter, the appropriate firmware may need to be installed. The ThinkPenguin USB adapter requires the installation of the <code>linux-firmware-ath9k</code> package. 
 +
{{cli | indent=2 | opkg install linux-firmware-ath9k | hostname=ipac9x25}}
 +
 +
* The firmware package for the built-in Wi-Fi on EMAC's 200GS carrier board is <code>linux-firmware-sd8787</code>.
 +
{{cli | indent=2 | opkg install linux-firmware-sd8787}}
 +
 +
* Independent of whether you're connecting with an adapter or using built-in capabilities, the <code>iw</code> and <code>wireless-tools</code> packages will complete the needed software to get a connection started.
 +
{{cli | indent=2 | opgk install iw | hostname=ipac9x25}}
 +
{{cli | indent=2 | opkg install wireless-tools | hostname=ipac9x25 }}
 +
</cl>
 +
 +
All the necessary software required to make the wireless connection has now been obtained. The USB adapter can now be plugged in and will be recognized by the operating system.
 +
<!-- Wireless Networking -->
 
{{:Templateimpl:using | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }}  
 
{{:Templateimpl:using | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }}  
  
After setup of the required software is complete, the connection may be established.<br />  
+
 
1. Use iw to scan for nearby wireless networks.  
+
Using the packages that have just been installed, the system can be connected to the wireless network.<br/>
:{{cli | username=root | hostname=ipac9x25 | iw dev wlan0 scan}}  
+
<cl>1. Changes to some configuration files will be necessary, so remount the root filesystem with read and write permissions.
: This will produce a list of nearby networks and detailed information about each network including SSID, the type of security, frequency, and signal strength. Use grep to help make identifying the SSID and signal strength easier. For the signal strength, the closer the value is to 0, the stronger the signal is.
+
{{cli | indent=2 |  mount -o remount,rw / | hostname=ipac9x25}}
:[[File:Scanning_with_iw.png|600px|left|thumb|Terminal output of scanning for wireless networks with iw command]]
+
 
<br clear=all>
+
* Wireless networks can be found using the scan option of <code>iw</code>.
2. For an open network, simply uncomment the lines in /etc/wpa_supplicant.conf:<br />  
+
{{cli | indent=2 | iw dev wlan0 scan | hostname=ipac9x25}}  
<pre>
+
: A detailed list of the nearby networks will be printed out to the terminal. To identify the SSIDs and respective signal strengths of the network(s) more easily, pipe the output of the <code>iw scan</code> command through <code>grep</code> to scan for the keywords "SSID" or "signal". The closer the value of the signal strength is to 0, the stronger the connection.
 +
{{clo | indent=2}}
 +
{{clio| iw dev wlan0 scan {{!}} grep SSID|hostname=ipac9x25}}
 +
:SSID: EMAC-A
 +
{{clio| iw dev wlan0 scan {{!}} grep signal|hostname=ipac9x25}}
 +
:signal: -78.00dBm
 +
{{clio||hostname=ipac9x25}}
 +
{{clos}}
 +
 
 +
<br/>
 +
The <code>/etc/wpa_supplicant.conf</code> file will need to be modified to provide the necessary connection information, the details of which depend upon the type of encryption used for the wireless network.
 +
<br/>
 +
 
 +
* For an open network, uncomment the following lines in <code>/etc/wpa_supplicant.conf</code> and fill in the correct SSID for the network to which the machine should connect.
 +
<syntaxhighlight lang=bash>
 
###open network
 
###open network
 
#network={
 
#network={
#      ssid="your-ssid" (optional)
+
#      ssid="SSID"
 
#      scan_ssid=1
 
#      scan_ssid=1
 
#      key_mgmt=NONE
 
#      key_mgmt=NONE
 
#}  
 
#}  
</pre>
+
</syntaxhighlight>
3. For a WEP password protected network, use wpa_passphrase to generate the private shared key(psk).
 
:[[File:Wpa_passphrase.png|600px|left|thumb|Terminal output when using the wpa_passphrase command]]
 
<br clear=all>
 
: SSID is the SSID of the preferred network found when scanning with iw. Password is the password to connect to the network. 
 
4. Highlight the psk and copy it.<br />
 
5. Edit /etc/wpa_supplicant.conf to have the appropriate SSID and psk <br />
 
:[[File:Wpasupplicantconf.png|600px|left|thumb|Editing /etc/wpa_supplicant.conf with vim]]
 
<br clear=all>
 
  
 +
* Networks protected by either WEP or WPA2 encryption will need a pre-shared key (PSK), which is generated for the specific network and its password. To get the PSK, use <code>wpa_passphrase</code> with the SSID and password for the desired network as arguments. Copy the last psk line and paste into the <code>/etc/wpa_supplicant.conf</code> file.
 +
{{clo|indent=2}}
 +
{{clio | indent=2 | wpa_passphrase SSID Password |hostname=ipac9x25}}
 +
network={
 +
:ssid="SSID"
 +
:&#35;psk="Password"
 +
:psk=b99d2c0fb66194f93ad52b71051e1095dc76e12529321334b3feb18332608eb7
 +
}
 +
{{clos}}
  
6. Make the connection to the network using the path /etc/init.d/wpa_supplicant with the argument "start".
+
* The contents of the <code>/etc/wpa_supplicant.conf</code> should now look similar to the following:
:{{cli | username=root | hostname=ipac9x25 | /etc/init.d/wpa_supplicant start}}  
+
{{clo|indent=2}}
: Give the command some time to establish the connection and watch the terminal output. A connections has been established when output stops and the last line read "IPv6 ADDRCONF(NETDEV_CHANGE):wlan0: link becomes ready". A connection has failed if "IPv6: ADDRCONF(NETDEV_UP):wlan0: link is not ready" is seen repeatedly and output to the terminal continues.
+
{{clio | cat /etc/wpa_supplicant.conf | hostname=ipac9x25}}
 +
network={
 +
:ssid="SSID"
 +
:proto=WPA
 +
:key_mgmt=WPA-PSK
 +
:psk=b99d2c0fb66194f93ad52b71051e1095dc76e12529321334b3feb18332608eb7
 +
}<br />
 +
{{clio||hostname=ipac9x25}}
 +
{{clos}}
 
<br />
 
<br />
:'''Successful connection''' (waiting a full minute to ensure output to the terminal stopped); <br /> [[File:Connectionsuccess.png|600px|left|thumb|Successful connection terminal output]] <br clear=all>
+
 
:'''Failed connection''' (waiting more than a minute as output continues to print to the terminal). The highlighted line and the repeated lines indicate an issue establishing the connection. <br />  
+
* The {{icli | /etc/init.d/wpa_supplicant start | hostname=ipac9x25}} command will attempt to establish a connection with the network.
:[[File:Wifi_connection_failed.png|600px|left|thumb|Failed connection terminal output]]
+
 
<br clear=all>
+
: As the command is running, watch the terminal output for the status of the connection. A connection has been established when output stops and the last line reads:
7. Confirm there is an IP address under wlan0 with the ifconfig command <br />  
+
{{clo | indent=2}}IPv6 ADDRCONF(NETDEV_CHANGE):wlan0: link becomes ready{{clos}}
:[[File:Wlan0_ip_address.png|600px|left|thumb|ifconfig showing that wlan0 does have an IP address]] <br clear=all>
+
 
8. Disconnect any Ethernet connections and ping to [http://www.emacinc.com www.emacinc.com] to verify that the system can wirelessly connect to the Internet. <br />
+
:A connection has failed if output to the terminal continues and the following line is seen repeatedly:
:[[File:Pingemac.png|600px|left|thumb|Sending and receiving packets from www.emacinc.com]]
+
{{clo | indent=2}}IPv6: ADDRCONF(NETDEV_UP):wlan0: link is not ready{{clos}}
 +
 
 +
:'''Successful connection''' (waiting a full minute to ensure output to the terminal stopped); <br />  
 +
{{clo|indent=2}}
 +
{{clio| /etc/init.d/wpa-supplicant start| hostname=ipac9x25}}
 +
Successfully initialized wpa_supplicant<br/>
 +
rfkill: Cannot open RFKILL control device<br/>
 +
{{clio| wlan0: authenticate with 1c:7e:e5:40:10:fd| hostname=ipac9x25}}
 +
wlan0: send auth to 1c:7e:e5:40:10:fd (try 1/3)<br/>
 +
wlan0: send auth to 1c:7e:e5:40:10:fd (try 2/3)<br/>
 +
wlan0: authenticated<br/>
 +
wlan0: associating with AP with corrupt beacon<br/>
 +
wlan0: associate with 1c:7e:e5:40:10:fd (try 1/3)<br/>
 +
wlan0: RX AssocResp from 1c:7e:e5:40:10:fd (capab=0x431 status=0 aid=6)<br/>
 +
wlan0: associated<br/>
 +
IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
 +
{{clos}}
 +
:'''Failed connection''' (waiting more than a minute as output continues to print to the terminal). The repeated lines indicate an issue establishing the connection. <br />  
 +
{{clo|indent=2}}
 +
{{clio|/etc/init.d/wpa-supplicant start| hostname=ipac9x25}}
 +
Successfully initialized wpa_supplicant                                       
 +
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready                           
 +
{{clio| IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready|hostname=ipac9x25}}       
 +
cfg80211: Calling CRDA to update world regulatory domain<br/>
 +
IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready<br/>                 
 +
cfg80211: Calling CRDA to update world regulatory domain<br/>                 
 +
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready<br/>                 
 +
IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready<br/>                       
 +
cfg80211: Calling CRDA to update world regulatory domain<br/>                 
 +
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready<br/>                 
 +
IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready<br/>                       
 +
cfg80211: Calling CRDA to update world regulatory domain<br/>                 
 +
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready<br/>                 
 +
IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready<br/>                     
 +
cfg80211: Calling CRDA to update world regulatory domain<br/>                 
 +
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready<br/>                 
 +
IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready<br/>                       
 +
cfg80211: Calling CRDA to update world regulatory domain<br/>                  
 +
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready<br/>                 
 +
IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready<br/>                       
 +
cfg80211: Calling CRDA to update world regulatory domain<br/>                  
 +
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready<br/>
 +
{{clos}}
 +
:A failed connection is likely the result of an improper password. Use <code>wpa_passphrase</code> to make sure you have the right psk for the password.
 +
 
 +
* The <code>ifconfig</code> command will be used to determine that the device is wirelessly connected to the network. Look to see that <code>wlan0</code> has an IP address.
 +
{{clop|indent=2}}wlan0  Link encap:Ethernet HWaddr A8:54:B2:42:89:8D
 +
:::inet addr:10.0.4.148 Bcast:10.0.255.255 Mask:255.255.0.0
 +
:::UP BROADCAST RUNNING MULTICAST MTU:1500 METRIC:1
 +
:::RX packets:3395 errors:0 dropped:6 overruns:0 frame:0
 +
:::TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
 +
:::collisions:0 txqueuelen:1000
 +
:::RX bytes:346619 (338.4 KiB) TX bytes:6318 (6.1 Kib){{closp}}   
 +
 
 +
* Disconnect any physical connections from the system and ping to [http://www.emacinc.com www.emacinc.com] to verify that the system can wirelessly connect to the Internet. <br />
 +
{{clop|indent=2}}
 +
{{cliop| ping -c 3 www.emacinc.com | hostname=ipac9x25}}
 +
PING www.emacinc.com (172.16.0.10): 56 data bytes
 +
64 bytes from 172.16.0.10: seq=0 ttl=63 time=1.910 ms
 +
64 bytes from 172.16.0.10: seq=1 ttl=63 time=1.748 ms
 +
64 bytes from 172.16.0.10: seq=2 ttl=63 time=2.061 ms
 +
 
 +
--- www.emacinc.com ping statistics ---
 +
3 packets transmitted, 3 packets received, 0% packet loss
 +
round-trip min/avg/max = 1.748/1.906/2.061 ms
 +
{{cliop||hostname=ipac9x25}}{{closp}}
 
<br clear=all>  
 
<br clear=all>  
 +
</cl>
 +
<!-- {{:Templateimpl:examples | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }} -->
  
<!-- {{:Templateimpl:examples | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }} -->
+
== Troubleshooting ==
 +
If your come across any issues communicating though the network, try these suggestions as starting points to resolve the problem(s).
 +
* View the <code>/etc/resolv.conf</code> file to view the DNS servers provided from the DHCP server.
 +
* Inspect the routing table using the <code>route</code> command, as shown here:
 +
{{clop | indent=2}}
 +
{{cliop|hostname=ipac9x25|user=root|route -n}}
 +
Kernel IP routing table
 +
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
 +
0.0.0.0        10.0.2.1        0.0.0.0        UG    0      0        0 eth0
 +
10.0.0.0        0.0.0.0        255.255.0.0     U    1      0        0 eth0
 +
{{cliop|hostname=ipac9x25|user=root|}} {{closp}}
  
 
{{:Templateimpl:conclusion | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }}  
 
{{:Templateimpl:conclusion | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }}  
This page walks through the procedure to connect a module to a wireless network via a WiFi adapter or built-in wireless, as well as acquiring the necessary software tools to make the connection for the first time.
+
After connecting to a network the first time, the system will be able to connect to the same network when rebooted or powered on. Connecting to a new network will require going through the procedures set out under the [[#Wireless Networking|Wireless Networking]] section to revise the network settings.
 +
 
 +
 
 +
This page walked the reader through the procedure to connect a machine to a wireless network via a USB Wifi adapter or built-in wireless, and the process to acquire the necessary software tools to make the connection for the first time. While there are plenty of USB wireless adapters available for sale, we used an adapter intended for use on Linux machines with a driver supported by EMAC OE Linux. Other USB wireless adapters may be used to connect EMAC devices to wireless networks, but they will often face issues with driver support or other compatibility issues.  Requests to purchase the adapter should be sent to [mailto:sales@emacinc.com sales@emacinc.com]; please include a reference to the EPN, PER-USB-00005-R, when sending a request to purchase this adapter.
 +
 
 
<br clear=all>
 
<br clear=all>
  
<!-- {{:Templateimpl:moreinfo | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }} * -->
+
{{:Templateimpl:moreinfo | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }}  
 +
* [[Network_Configuration | Network Configuration]]
 +
* [[Network_Connections | Network Connections]]
  
{{:Templateimpl:whatnext | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }}
+
{{:Templateimpl:whatnext | initials=JJ | title=Wireless Networking | desc=How to access a wireless network | project=OE 5.0 }}  
* [[Network_Configuration | Network Configuration]]
+
* [[OE50:Packages | EMAC OE 5.X Release Information]]
 +
* [[EMAC_OE_50_Add-on_Packages | EMAC OE 50 Add-on Packages]]

Latest revision as of 15:46, 13 November 2015

TODO: {{#todo: Complete (10.20.2015-14:23->JJ+);(10.20.2015-13:43->JJ+);(10.23.2015-11:50->MD-);(10.26.2015-16:50->JJ+);(10.27.2015-15:30->JJ+); (10.28.2015-15:05->JJ+);(10.28.2015-16:35->MD-); (11.2.2015-14:45->JJ+); (11.3.2015-19:35->MD-); (11.4.2015-14:40->JJ+);(11.05.2015-15:40->MD+); (11.10.2015-15:05->JJ-);(11.13.2015-14:00->MG+);(11.13.2015-14:44->KY+)|Jeffrey Jung|OE 5.0,Complete,JJ,MD,MG}}

This guide will illustrate how to set up and connect to a wireless network using the ThinkPenguin Wireless N USB Adapter for GNU/Linux and the built-in WiFi on the SoM-200GS carrier.


Background

While many boards from EMAC are not natively designed to connect to wireless networks, most of these systems do have USB ports. Using a USB wireless network adapter, a system can be equipped with wireless networking capability. Such a USB adapter can be ordered by contacting the sales team here at EMAC. Request the product by its part number, PER-USB-00005-R.


This page describes the actions needed to connect to a wireless network using either a wireless network USB adapter, or the built-in Wi-Fi found on EMAC products like the SoM-200GS carrier. We chose to use the ThinkPenguin USB adapter for this page because it is well supported by the Linux kernel.


General Information

Set Up

Before the device can be connected to the network, some additional software may need to be installed. Boards with Wi-Fi built in should already have the proper software and drivers to support connecting to a wireless network. If so, skip to the Wireless Networking section.

  1. In order to obtain the new packages, connect the system to a physical network.

  2. This process requires modifying some system files, so start by enabling read and write permissions to the filesystem.

    root@ipac9x25:~# mount -o remount,rw /
  3. A check for any updates to the package list is typically a good practice before installing new software. Use the opkg manager to update the package list.

    root@ipac9x25:~# opkg update
  4. One of the best tools to establish the connection to wireless networks is the wpa-supplicant package. This supplicant will allow the system to make connections to WPA and WPA2 protected networks. Install this package with the opkg tool.

    root@ipac9x25:~# opkg install wpa-supplicant
  5. Install the wireless firmware

    • If using the USB adapter, the appropriate firmware may need to be installed. The ThinkPenguin USB adapter requires the installation of the linux-firmware-ath9k package.

    root@ipac9x25:~# opkg install linux-firmware-ath9k
    • The firmware package for the built-in Wi-Fi on EMAC's 200GS carrier board is linux-firmware-sd8787.

    root@som9x25:~# opkg install linux-firmware-sd8787
  6. Independent of whether you're connecting with an adapter or using built-in capabilities, the iw and wireless-tools packages will complete the needed software to get a connection started.

    root@ipac9x25:~# opgk install iw
    root@ipac9x25:~# opkg install wireless-tools

All the necessary software required to make the wireless connection has now been obtained. The USB adapter can now be plugged in and will be recognized by the operating system.

Wireless Networking

Using the packages that have just been installed, the system can be connected to the wireless network.

  1. Changes to some configuration files will be necessary, so remount the root filesystem with read and write permissions.

    root@ipac9x25:~# mount -o remount,rw /
  2. Wireless networks can be found using the scan option of iw.

    root@ipac9x25:~# iw dev wlan0 scan
    A detailed list of the nearby networks will be printed out to the terminal. To identify the SSIDs and respective signal strengths of the network(s) more easily, pipe the output of the iw scan command through grep to scan for the keywords "SSID" or "signal". The closer the value of the signal strength is to 0, the stronger the connection.
    root@ipac9x25:~# iw dev wlan0 scan | grep SSID
    SSID: EMAC-A
    root@ipac9x25:~# iw dev wlan0 scan | grep signal
    signal: -78.00dBm
    root@ipac9x25:~#


    The /etc/wpa_supplicant.conf file will need to be modified to provide the necessary connection information, the details of which depend upon the type of encryption used for the wireless network.

  3. For an open network, uncomment the following lines in /etc/wpa_supplicant.conf and fill in the correct SSID for the network to which the machine should connect.

    ###open network
    #network={
    #      ssid="SSID"
    #      scan_ssid=1
    #       key_mgmt=NONE
    #}
    
  4. Networks protected by either WEP or WPA2 encryption will need a pre-shared key (PSK), which is generated for the specific network and its password. To get the PSK, use wpa_passphrase with the SSID and password for the desired network as arguments. Copy the last psk line and paste into the /etc/wpa_supplicant.conf file.

    root@ipac9x25:~# wpa_passphrase SSID Password

    network={

    ssid="SSID"
    #psk="Password"
    psk=b99d2c0fb66194f93ad52b71051e1095dc76e12529321334b3feb18332608eb7

    }

  5. The contents of the /etc/wpa_supplicant.conf should now look similar to the following:

    root@ipac9x25:~# cat /etc/wpa_supplicant.conf

    network={

    ssid="SSID"
    proto=WPA
    key_mgmt=WPA-PSK
    psk=b99d2c0fb66194f93ad52b71051e1095dc76e12529321334b3feb18332608eb7

    }

    root@ipac9x25:~#


  6. The root@som9x25:~# /etc/init.d/wpa_supplicant start command will attempt to establish a connection with the network.

    As the command is running, watch the terminal output for the status of the connection. A connection has been established when output stops and the last line reads:
    IPv6 ADDRCONF(NETDEV_CHANGE):wlan0: link becomes ready
    A connection has failed if output to the terminal continues and the following line is seen repeatedly:
    IPv6: ADDRCONF(NETDEV_UP):wlan0: link is not ready
    Successful connection (waiting a full minute to ensure output to the terminal stopped);
    root@ipac9x25:~# /etc/init.d/wpa-supplicant start

    Successfully initialized wpa_supplicant
    rfkill: Cannot open RFKILL control device

    root@ipac9x25:~# wlan0: authenticate with 1c:7e:e5:40:10:fd

    wlan0: send auth to 1c:7e:e5:40:10:fd (try 1/3)
    wlan0: send auth to 1c:7e:e5:40:10:fd (try 2/3)
    wlan0: authenticated
    wlan0: associating with AP with corrupt beacon
    wlan0: associate with 1c:7e:e5:40:10:fd (try 1/3)
    wlan0: RX AssocResp from 1c:7e:e5:40:10:fd (capab=0x431 status=0 aid=6)
    wlan0: associated
    IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

    Failed connection (waiting more than a minute as output continues to print to the terminal). The repeated lines indicate an issue establishing the connection.
    root@ipac9x25:~# /etc/init.d/wpa-supplicant start

    Successfully initialized wpa_supplicant IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

    root@ipac9x25:~# IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

    cfg80211: Calling CRDA to update world regulatory domain
    IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
    cfg80211: Calling CRDA to update world regulatory domain
    IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
    IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
    cfg80211: Calling CRDA to update world regulatory domain
    IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
    IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
    cfg80211: Calling CRDA to update world regulatory domain
    IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
    IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
    cfg80211: Calling CRDA to update world regulatory domain
    IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
    IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
    cfg80211: Calling CRDA to update world regulatory domain
    IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
    IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
    cfg80211: Calling CRDA to update world regulatory domain
    IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

    A failed connection is likely the result of an improper password. Use wpa_passphrase to make sure you have the right psk for the password.
  7. The ifconfig command will be used to determine that the device is wirelessly connected to the network. Look to see that wlan0 has an IP address.

    wlan0 Link encap:Ethernet HWaddr A8:54:B2:42:89:8D
    inet addr:10.0.4.148 Bcast:10.0.255.255 Mask:255.255.0.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 METRIC:1
    RX packets:3395 errors:0 dropped:6 overruns:0 frame:0
    TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:346619 (338.4 KiB) TX bytes:6318 (6.1 Kib)
  8. Disconnect any physical connections from the system and ping to www.emacinc.com to verify that the system can wirelessly connect to the Internet.

    root@ipac9x25:~# ping -c 3 www.emacinc.com

    PING www.emacinc.com (172.16.0.10): 56 data bytes 64 bytes from 172.16.0.10: seq=0 ttl=63 time=1.910 ms 64 bytes from 172.16.0.10: seq=1 ttl=63 time=1.748 ms 64 bytes from 172.16.0.10: seq=2 ttl=63 time=2.061 ms

    --- www.emacinc.com ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 1.748/1.906/2.061 ms

    root@ipac9x25:~#


Troubleshooting

If your come across any issues communicating though the network, try these suggestions as starting points to resolve the problem(s).

  • View the /etc/resolv.conf file to view the DNS servers provided from the DHCP server.
  • Inspect the routing table using the route command, as shown here:
root@ipac9x25:~# route -n

Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 10.0.2.1 0.0.0.0 UG 0 0 0 eth0 10.0.0.0 0.0.0.0 255.255.0.0 U 1 0 0 eth0

root@ipac9x25:~#

Conclusion

After connecting to a network the first time, the system will be able to connect to the same network when rebooted or powered on. Connecting to a new network will require going through the procedures set out under the Wireless Networking section to revise the network settings.


This page walked the reader through the procedure to connect a machine to a wireless network via a USB Wifi adapter or built-in wireless, and the process to acquire the necessary software tools to make the connection for the first time. While there are plenty of USB wireless adapters available for sale, we used an adapter intended for use on Linux machines with a driver supported by EMAC OE Linux. Other USB wireless adapters may be used to connect EMAC devices to wireless networks, but they will often face issues with driver support or other compatibility issues. Requests to purchase the adapter should be sent to sales@emacinc.com; please include a reference to the EPN, PER-USB-00005-R, when sending a request to purchase this adapter.


Further Information

Where to Go Next
Pages with Related Content