Difference between revisions of "Wifi"
m (Made various fixes and comments, and marked as Buggy.) |
|||
Line 1: | Line 1: | ||
− | {{todo| | + | {{todo|Buggy (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-)|Jeffrey Jung| project=OE 5.0,Buggy,JJ,MD }} |
{{#seo: | {{#seo: | ||
|title=Wireless Networking | |title=Wireless Networking | ||
Line 6: | Line 6: | ||
|description=How to access a wireless network | |description=How to access a wireless network | ||
}} | }} | ||
+ | |||
+ | {{warning | Keywords need to be added to the SEO tag (above)}} | ||
+ | |||
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. | ||
__TOC__ | __TOC__ | ||
Line 12: | Line 15: | ||
<!--Background Information--> | <!--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 }} | ||
− | While | + | While many machines 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, like the one found here at [https://www.thinkpenguin.com/gnu-linux/penguin-wireless-n-usb-adapter-gnu-linux-tpe-n150usb ThinkPenguin], a system can equipped with wireless networking capability. |
+ | |||
+ | This page describes the actions needed to connect to a wireless network either 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. | ||
Line 24: | Line 29: | ||
<br clear=all> | <br clear=all> | ||
− | <cl>1. This process requires modifying some system files so start by enabling read and write permissions to the filesystem. | + | {{warning | This step isn't needed on EMAC boards with built in wifi capability. Boards like the SOM-200GS with the wifi option will have this software pre-installed. You can tell them to skip this section for those boards.}} |
+ | |||
+ | <cl>1. This process requires modifying some system files, so start by enabling read and write permissions to the filesystem. | ||
{{clo|indent=2}} | {{clo|indent=2}} | ||
{{clio | mount -o remount,rw / | hostname=ipac9x25 }} | {{clio | mount -o remount,rw / | hostname=ipac9x25 }} | ||
{{clos}} | {{clos}} | ||
− | * A check for any updates is typically a good practice before installing new software. | + | * A check for any updates is typically a good practice before installing new software. Use the <code>opkg</code> manager to install any updated software from the package list. |
{{clo|indent=2}} | {{clo|indent=2}} | ||
{{clio | opkg update | hostname=ipac9x25 }} | {{clio | opkg update | hostname=ipac9x25 }} | ||
Line 39: | Line 46: | ||
{{clos}} | {{clos}} | ||
− | * If using the USB adapter, the appropriate drivers may need to be installed. The ThinkPenguin USB adapter requires the installment of the linux-firmware-ath9k package. | + | * If using the USB adapter, the appropriate drivers may need to be installed. The ThinkPenguin USB adapter requires the installment of the <code>linux-firmware-ath9k</code> package. |
{{clo|indent=2}} | {{clo|indent=2}} | ||
{{clio | opkg install linux-firmware-ath9k | hostname=ipac9x25}} | {{clio | opkg install linux-firmware-ath9k | hostname=ipac9x25}} | ||
{{clos}} | {{clos}} | ||
− | * If using built-in Wi-Fi, the | + | {{warning | Don't forget to always use code tags around package names. I added them around <code>linux-firmware-ath9k</code> for you. |
+ | <br /> | ||
+ | Also, don't forget to capitalize and double check the spelling of company names; I fixed Marvell below; it was "marvel". The package name apparently misspells the company name. | ||
+ | <br /><br /> | ||
+ | Additionally, the Marvell package won't work for all EMAC products with built in Wifi. I'm currently designing a board which will have a Texas Instruments Wifi module on it rather than the wi2wi module which uses the Marvell driver. But as I mentioned above, the board should have this pre-installed. If it doesn't, please let me know. It's important that this software and the correct drivers are pre-installed on these boards. | ||
+ | <br /><br /> | ||
+ | Showing example output of the opkg commands, below, will make the procedure more clear. | ||
+ | }} | ||
+ | |||
+ | * If using built-in Wi-Fi, the Marvell license and <code>linux-firmware-sd8787</code> packages will need to be installed. | ||
{{clo | indent=2}} | {{clo | indent=2}} | ||
{{clio | opkg install linux-firmware-marvel-license| hostname=som9g45 }} | {{clio | opkg install linux-firmware-marvel-license| hostname=som9g45 }} | ||
Line 68: | Line 84: | ||
Using the packages that have just been installed, the system can be connected to the wireless network.<br/> | Using the packages that have just been installed, the system can be connected to the wireless network.<br/> | ||
− | <cl>1. Changes to some configuration files will be necessary, so | + | <cl>1. Changes to some configuration files will be necessary, so remount the root filesystem with read and write permissions. |
{{clo|indent=2}} | {{clo|indent=2}} | ||
{{clio | mount -o remount,rw / | hostname=ipac9x25}} | {{clio | mount -o remount,rw / | hostname=ipac9x25}} | ||
{{clos}} | {{clos}} | ||
− | * Wireless networks can be found using the | + | * Wireless networks can be found using the scan option of <code>iw</code>. |
{{clo|indent=2}} | {{clo|indent=2}} | ||
{{clio | iw dev wlan0 scan | hostname=ipac9x25}} | {{clio | iw dev wlan0 scan | hostname=ipac9x25}} | ||
{{clos}} | {{clos}} | ||
− | : 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) | + | : 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}} | {{clo|indent=2}} | ||
{{clio| iw dev wlan0 scan <nowiki>|</nowiki> grep SSID|hostname=ipac9x25}} | {{clio| iw dev wlan0 scan <nowiki>|</nowiki> grep SSID|hostname=ipac9x25}} | ||
Line 85: | Line 101: | ||
{{clio||hostname=ipac9x25}} | {{clio||hostname=ipac9x25}} | ||
{{clos}} | {{clos}} | ||
+ | |||
+ | {{warning | Did you forget to add the greps to the above commands? Oh wait, no, you stumbled across a gotcha in the wiki syntax. You can see several examples of how I worked around this by looking at the source, here: http://wikidev.emacinc.com/wiki/Opkg#Finding_Packages_to_Install }} | ||
+ | |||
<br/> | <br/> | ||
− | The <code>/etc/wpa_supplicant.conf</code> file will need to be modified | + | 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/> | <br/> | ||
− | * For an open network, | + | * 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> | <syntaxhighlight lang=bash> | ||
###open network | ###open network | ||
Line 99: | Line 118: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | * Networks protected by either WEP or WPA2 encryption will need a | + | * 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 and redirect the output to a new file, <code>/etc/wpa_supplicant.conf</code>. Note: if this file already exists, it will be overwritten by this command; you may want to back it up first. |
{{clo|indent=2}} | {{clo|indent=2}} | ||
− | {{clio|wpa_passphrase SSID Password|hostname=ipac9x25}} | + | {{clio|wpa_passphrase SSID Password > /etc/wpa_supplicant.conf|hostname=ipac9x25}} |
+ | {{clio||hostname=ipac9x25}} | ||
+ | {{clos}} | ||
+ | |||
+ | * The contents of the <code>/etc/wpa_supplicant.conf</code> should now look similar to the following: | ||
+ | {{clo|indent=2}} | ||
+ | {{clio | cat /etc/wpa_supplicant.conf | hostname=ipac9x25}} | ||
network={ | network={ | ||
:ssid="SSID" | :ssid="SSID" | ||
Line 110: | Line 135: | ||
{{clos}} | {{clos}} | ||
+ | <!-- THIS COMMENTED OUT IN FAVOR OF BETTER APPROACH | ||
<br clear=all> | <br clear=all> | ||
:<code>SSID</code> is the SSID of the preferred network found when scanning with <code>iw</code>. <code>Password</code> is the password to connect to the network. | :<code>SSID</code> is the SSID of the preferred network found when scanning with <code>iw</code>. <code>Password</code> is the password to connect to the network. | ||
Line 133: | Line 159: | ||
{{clos}} | {{clos}} | ||
<br clear=all> | <br clear=all> | ||
+ | --> | ||
+ | |||
+ | |||
+ | |||
+ | * The {{icli | /etc/init.d/wpa_supplicant start | hostname=ipac9x25}} 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: | : 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: | ||
{{clo | indent=2}}IPv6 ADDRCONF(NETDEV_CHANGE):wlan0: link becomes ready{{clos}} | {{clo | indent=2}}IPv6 ADDRCONF(NETDEV_CHANGE):wlan0: link becomes ready{{clos}} | ||
Line 217: | Line 244: | ||
</cl> | </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 }} --> | ||
+ | |||
+ | {{warning | Adding troubleshooting steps, such as checking /etc/resolv.conf to see what DNS server(s) were provided from the DHCP server, and inspecting the routing table, would be beneficial.}} | ||
{{: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 | + | This page walks through the procedure to connect a machine to a wireless network via a USB Wifi adapter or built-in wireless, as well as acquiring 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 the EMAC OE SDK. 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. We recommend using a USB adapter from [https://www.thinkpenguin.com/gnu-linux/penguin-wireless-n-usb-adapter-gnu-linux-tpe-n150usb ThinkPenguin]. |
+ | |||
+ | {{warning | Should we really recommend buying an adapter from a 3rd party? This is generally not a good business practice. Eric?}} | ||
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. | 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. | ||
<br clear=all> | <br clear=all> | ||
+ | |||
+ | {{warning | The moreinfo template section should be filled in with links to other articles we have on networking, since other articles do apply.}} | ||
<!-- {{: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 }} * --> |
Revision as of 15:38, 28 October 2015
WARNING! |
Keywords need to be added to the SEO tag (above) |
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.
Contents
Background
While many machines 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, like the one found here at ThinkPenguin, a system can equipped with wireless networking capability.
This page describes the actions needed to connect to a wireless network either 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 will need to be installed. In order to obtain the new packages, connect the system to a physical network. If your are going to be using the USB adapter for the connection, it may be plugged in at this time, although it may not have the proper drivers installed to the system yet.
WARNING! |
This step isn't needed on EMAC boards with built in wifi capability. Boards like the SOM-200GS with the wifi option will have this software pre-installed. You can tell them to skip this section for those boards. |
-
This process requires modifying some system files, so start by enabling read and write permissions to the filesystem.
root
@
ipac9x25
:
~
#
mount -o remount,rw /
-
A check for any updates is typically a good practice before installing new software. Use the
opkg
manager to install any updated software from the package list.root
@
ipac9x25
:
~
#
opkg update
-
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 theopkg manager
.root
@
ipac9x25
:
~
#
opkg install wpa-supplicant
-
If using the USB adapter, the appropriate drivers may need to be installed. The ThinkPenguin USB adapter requires the installment of the
linux-firmware-ath9k
package.root
@
ipac9x25
:
~
#
opkg install linux-firmware-ath9k
WARNING! Don't forget to always use code tags around package names. I added them around linux-firmware-ath9k
for you.
Also, don't forget to capitalize and double check the spelling of company names; I fixed Marvell below; it was "marvel". The package name apparently misspells the company name.
Additionally, the Marvell package won't work for all EMAC products with built in Wifi. I'm currently designing a board which will have a Texas Instruments Wifi module on it rather than the wi2wi module which uses the Marvell driver. But as I mentioned above, the board should have this pre-installed. If it doesn't, please let me know. It's important that this software and the correct drivers are pre-installed on these boards.
Showing example output of the opkg commands, below, will make the procedure more clear.
-
If using built-in Wi-Fi, the Marvell license and
linux-firmware-sd8787
packages will need to be installed.root
@
som9g45
:
~
#
opkg install linux-firmware-marvel-license
root
@
som9g45
:
~
#
opkg install linux-firmware-sd8787
-
Independent of using built-in Wi-Fi or an adapter, the
iw
andwireless-tools
packages will complete the needed software to get a connection started.root
@
ipac9x25
:
~
#
opgk install iw
root
@
ipac9x25
:
~
#
opkg install wireless-tools
-
Upon successful installation of all required packages, the system will need to be rebooted to take advantage of the new packages.
root
@
ipac9x25
:
~
#
reboot
Wireless Networking
Using the packages that have just been installed, the system can be connected to the wireless network.
-
Changes to some configuration files will be necessary, so remount the root filesystem with read and write permissions.
root
@
ipac9x25
:
~
#
mount -o remount,rw /
-
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 throughgrep
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
- SSID: EMAC-A
root
@
ipac9x25
:
~
#
iw dev wlan0 scan
- signal: -78.00dBm
root
@
ipac9x25
:
~
#
WARNING! Did you forget to add the greps to the above commands? Oh wait, no, you stumbled across a gotcha in the wiki syntax. You can see several examples of how I worked around this by looking at the source, here: http://wikidev.emacinc.com/wiki/Opkg#Finding_Packages_to_Install
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.
- 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
-
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 #}
-
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 and redirect the output to a new file,/etc/wpa_supplicant.conf
. Note: if this file already exists, it will be overwritten by this command; you may want to back it up first.root
@
ipac9x25
:
~
#
wpa_passphrase SSID Password > /etc/wpa_supplicant.conf
root
@
ipac9x25
:
~
#
-
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"
#psk
="Password"- psk=b99d2c0fb66194f93ad52b71051e1095dc76e12529321334b3feb18332608eb7
}
root
@
ipac9x25
:
~
#
-
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.
-
The
ifconfig
command will be used to determine that the device is wirelessly connected to the network. Look to see thatwlan0
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)
- inet addr:10.0.4.148 Bcast:10.0.255.255 Mask:255.255.0.0
-
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 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 msroot
@
ipac9x25
:
~
#
WARNING! |
Adding troubleshooting steps, such as checking /etc/resolv.conf to see what DNS server(s) were provided from the DHCP server, and inspecting the routing table, would be beneficial. |
Conclusion
This page walks through the procedure to connect a machine to a wireless network via a USB Wifi adapter or built-in wireless, as well as acquiring 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 the EMAC OE SDK. 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. We recommend using a USB adapter from ThinkPenguin.
WARNING! |
Should we really recommend buying an adapter from a 3rd party? This is generally not a good business practice. Eric? |
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.
WARNING! |
The moreinfo template section should be filled in with links to other articles we have on networking, since other articles do apply. |