Difference between revisions of "Wifi"

From wiki.emacinc.com
Jump to: navigation, search
(Blanked the page)
Line 1: Line 1:
 
+
{{todo| Started (10.19.2015-18:00->JJ+)|Jeffrey Jung| project=OE 5.0,JJ }}{{#seo:|title=Wireless Networking|titlemode=append|keywords=|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.__TOC__{{: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. {{: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 /}} {{: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. :{{cli | username=root | hostname=ipac9x25 | iw dev wlan0 scan}} : 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.:[[File:Scanning_with_iw.png|600px|left|thumb|Terminal output of scanning for wireless networks with iw command]] <br clear=all>2. For an open network, simply uncomment the lines in /etc/wpa_supplicant.conf:<br /> <nowiki>###open network#network={#      ssid="your-ssid" (optional)#      scan_ssid=1#      key_mgmt=NONE#} </nowiki>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>6. Make the connection to the network using the path /etc/init.d/wpa_supplicant with the argument "start" :{{cli | username=root | hostname=ipac9x25 | /etc/init.d/wpa_supplicant start}} : 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. <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 /> :[[File:Wifi_connection_failed.png|600px|left|thumb|Failed connection terminal output]] <br clear=all>7. Confirm there is an IP address under wlan0 with the ifconfig command <br /> :[[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 />:[[File:Pingemac.png|600px|left|thumb|Sending and receiving packets from www.emacinc.com]] <br clear=all> <!-- {{:Templateimpl:examples | 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.<br clear=all><!-- {{:Templateimpl:moreinfo | 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]]

Revision as of 12:49, 20 October 2015

TODO: {{#todo: Started (10.19.2015-18:00->JJ+)|Jeffrey Jung|OE 5.0,JJ}}

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.== Background == Most modules from EMAC can be upgraded to use wireless networking via a USB adapter. The USB adapter can be purchased at the ThinkPenguin website. EMAC's SoM-200GS carrier can optionally be ordered with built-in WiFi and bluetooth. == General Information == ===Setup=== # This process requires modifying some system files so start by allowing the system to read and write. #:

root@ipac9x25:~# mount -o remount,rw /

# Check for any updates. #:

root@ipac9x25:~# opkg update

# Install wpa-supplicant to allow connections to WPA and WPA2 protected networks. #:

root@ipac9x25:~# opkg install wpa-supplicant

# Install the firmware for the USB adapter. #:

root@ipac9x25:~# opkg install linux-firmware-ath9k

# Install the marvel firmware and the sd8787 firmware for built-in WiFi on the SoM-200GS. #:

root@som9g45:~# opkg install linux-firmware-marvel-license


root@som9g45:~# opkg install linux-firmware-sd8787

#Install the iw and wireless-tools packages. #:

root@ipac9x25:~# opgk install iw


root@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. #:

root@ipac9x25:~# mount -o remount,rw /

== Wireless Networking == After setup of the required software is complete, the connection may be established.
1. Use iw to scan for nearby wireless networks. :

root@ipac9x25:~# iw dev wlan0 scan

 : 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.:

Terminal output of scanning for wireless networks with iw command


2. For an open network, simply uncomment the lines in /etc/wpa_supplicant.conf:
###open network#network={# ssid="your-ssid" (optional)# scan_ssid=1# key_mgmt=NONE#} 3. For a WEP password protected network, use wpa_passphrase to generate the private shared key(psk).:

Terminal output when using the wpa_passphrase command


: 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.
5. Edit /etc/wpa_supplicant.conf to have the appropriate SSID and psk
:

Editing /etc/wpa_supplicant.conf with vim


6. Make the connection to the network using the path /etc/init.d/wpa_supplicant with the argument "start" :

root@ipac9x25:~# /etc/init.d/wpa_supplicant start

 : 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.
:Successful connection (waiting a full minute to ensure output to the terminal stopped);

Successful connection terminal output


: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.
 :

Failed connection terminal output


7. Confirm there is an IP address under wlan0 with the ifconfig command
 :

ifconfig showing that wlan0 does have an IP address


8. Disconnect any Ethernet connections and ping to www.emacinc.com to verify that the system can wirelessly connect to the Internet.
:

Sending and receiving packets from www.emacinc.com


== Conclusion == 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.
===== Pages with Related Content ===== * Network Configuration