VAR-SOM-MX6 Wireless LAN: Difference between revisions

From Variscite Wiki
(Created page with "== Test == '''Scan for wireless networks''': <pre> $ ifconfig wlan0 up $ iw dev wlan0 scan | grep SSID </pre> <br> '''Connecting to a WPA encrypted network:''' <br> Find you...")
 
Line 1: Line 1:
== Test ==
{{PageHeader|VAR-SOM-MX6 - Wireless LAN}} {{DocImage|category1=VAR-SOM-MX6|category2=Yocto}} __toc__
= Test =
'''Scan for wireless networks''':  
'''Scan for wireless networks''':  
<pre>
<pre>
Line 29: Line 30:
<br>
<br>
'''Useful link for common iw commands:''' https://wiki.archlinux.org/index.php/Wireless_network_configuration#Manual_setup
'''Useful link for common iw commands:''' https://wiki.archlinux.org/index.php/Wireless_network_configuration#Manual_setup
= Access Point =
This example will demonstrate you how to use the VAR-SOM-MX6 as an access point. It will forward packets from wlan0 to eth0.
DHCPD:
<pre>$ vi /etc/udhcpd.conf
# Sample udhcpd configuration file (/etc/udhcpd.conf)
# The start and end of the IP lease block
start          192.168.5.20    #default: 192.168.0.20
end            192.168.5.25    #default: 192.168.0.254
# The interface that udhcpd will use
interface  wlan0              #default: eth0
#Example
opt    dns    8.8.8.8  8.8.4.4 # public google dns servers
option  subnet  255.255.255.0
opt    router  192.168.5.1
option  lease  864000          # 10 days of seconds
</pre>
This is a network example. You need to set the IP address based on your network.
<br>First ensure that wpa_supplicant is not holding the device
<pre>$ killall wpa_supplicant
</pre>
IP Forwarding:
<pre>$ echo 1 > /proc/sys/net/ipv4/ip_forward
$ ifconfig wlan0 192.168.5.1
$ hostapd -B /etc/hostapd.conf -P /var/run/hostapd.pid
$ udhcpd /etc/udhcpd.conf
$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
</pre>
As a next step one should take a look at /etc/hostapd.conf. You may want to configure password access point name etc.
= Setup =
This phase is not required by default.
VAR-SOM-MX6 V2.X (WiLink8):
* Select your WL183x p/n:
<pre>
$ cd /usr/bin/wlconf/
$ ./configure-device.sh wl18xx
select one out of : WL1831, WL1833, WL1835, WL1837.
</pre>
As a result some additional information may be required like 1/2 antenna connected
<br>
<reboot system!> <br>
note: In Yocto Dizzy, ignore the following
<pre>
wl1271_sdio: probe of mmc2:0001:1 failed with error -110
wl1271_sdio: probe of mmc2:0001:2 failed with error -110
</pre>
First time need to set mac address to be used automatically (Not required in Yocto Dizzy)
<pre>
$ calibrator set nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin 00:00:00:00:00:00
</pre>

Revision as of 06:16, 14 December 2015

VAR-SOM-MX6 - Wireless LAN

Test

Scan for wireless networks:

$ ifconfig wlan0 up
$ iw dev wlan0 scan | grep SSID


Connecting to a WPA encrypted network:
Find your network from the above scan command.

$ mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.org
$ wpa_passphrase <YourAP> <YourPassword> >/etc/wpa_supplicant.conf
$ wpa_supplicant -B -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf

wait for:

wlcore: Association completed.

Disable eth0:

$ ifconfig eth0 down

Run DHCP:

$ udhcpc -iwlan0
$ ifconfig


Useful link for common iw commands: https://wiki.archlinux.org/index.php/Wireless_network_configuration#Manual_setup

Access Point

This example will demonstrate you how to use the VAR-SOM-MX6 as an access point. It will forward packets from wlan0 to eth0. DHCPD:

$ vi /etc/udhcpd.conf 
# Sample udhcpd configuration file (/etc/udhcpd.conf)
# The start and end of the IP lease block
start           192.168.5.20    #default: 192.168.0.20
end             192.168.5.25    #default: 192.168.0.254
# The interface that udhcpd will use
interface   wlan0               #default: eth0
#Example
opt     dns     8.8.8.8  8.8.4.4 # public google dns servers
option  subnet  255.255.255.0
opt     router  192.168.5.1
option  lease   864000          # 10 days of seconds

This is a network example. You need to set the IP address based on your network.
First ensure that wpa_supplicant is not holding the device

$ killall wpa_supplicant

IP Forwarding:

$ echo 1 > /proc/sys/net/ipv4/ip_forward
$ ifconfig wlan0 192.168.5.1
$ hostapd -B /etc/hostapd.conf -P /var/run/hostapd.pid
$ udhcpd /etc/udhcpd.conf
$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

As a next step one should take a look at /etc/hostapd.conf. You may want to configure password access point name etc.

Setup

This phase is not required by default. VAR-SOM-MX6 V2.X (WiLink8):

  • Select your WL183x p/n:
$ cd /usr/bin/wlconf/
$ ./configure-device.sh wl18xx
select one out of : WL1831, WL1833, WL1835, WL1837.

As a result some additional information may be required like 1/2 antenna connected
<reboot system!>

note: In Yocto Dizzy, ignore the following

wl1271_sdio: probe of mmc2:0001:1 failed with error -110
wl1271_sdio: probe of mmc2:0001:2 failed with error -110

First time need to set mac address to be used automatically (Not required in Yocto Dizzy)

$ calibrator set nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin 00:00:00:00:00:00