DART-6UL/VAR-SOM-MX7 Wireless LAN: Difference between revisions

From Variscite Wiki
(Created page with "{{PageHeader|DART-6UL - Wireless LAN}} {{DocImage|category1=DART-6UL|category2=Yocto}} __toc__ = Test = '''Scan for wireless networks''': <pre> $ ifconfig wlan0 up $ iw dev w...")
 
No edit summary
Line 67: Line 67:
</pre>
</pre>
Reinstall the driver is AP mode.
Reinstall the driver is AP mode.
<pre>
Wireless configuration can be setup in file /etc/hostapd.conf before launching hostapd<br>
$ KVER=$(uname -a | awk '{ printf $3 }')
For configuring password access point name etc.
$ DHD=/lib/modules/$KVER/kernel/drivers/net/wireless/bcmdhd/bcmdhd.ko
for example:
$ FW=/lib/firmware/bcm/fw_bcmdhd_apsta.bin
ssid=DART6UL_AP
$ NVRAM=/lib/firmware/bcm/bcmdhd.cal
wpa_passphrase=12345678
$ ifconfig wlan0 down
$ rmmod bcmdhd
$ insmod $DHD firmware_path=$FW nvram_path=$NVRAM dhd_msg_level=0x0
$ ifconfig wlan0 192.168.5.1 up
</pre>


IP Forwarding:
IP Forwarding:
Line 85: Line 80:
$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
</pre>
</pre>
Use wl command to set the AP:
<pre>
$ wl -i wlan0 bss down
$ wl -i wlan0 bss -C 1 up
$ wl -i wlan0 wsec 4
$ wl -i wlan0 wpa_auth 128
$ wl -i wlan0 set_pmk 12345678
$ wl -i wlan0 ssid vs-imx
</pre>
{{note|Note:<br/>wl command is installed automaticly on eMMC device. On NAND device you need to copy it from the SDCARD.|info}}


As a next step one should take a look at /etc/hostapd.conf. You may want to configure password access point name etc.
 
As a next step one should take a look at iw utility which can be used for tuning some parameters https://wireless.wiki.kernel.org/en/users/documentation/iw

Revision as of 08:39, 16 August 2016

DART-6UL - 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:

wl_bss_connect_done succeeded with 88:5a:92:1d:7c:20

Check link:

$ iw dev wlan0 link

Disable eth0:

$ ifconfig eth0 down
$ ifconfig eth1 down

Run DHCP:

$ udhcpc -iwlan0
$ ifconfig

Check link speed On server:

$ iperf -s

On target:

$ iperf -c 192.168.0.103


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 DART-6UL 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
$ killall hostapd

Reinstall the driver is AP mode. Wireless configuration can be setup in file /etc/hostapd.conf before launching hostapd
For configuring password access point name etc. for example: ssid=DART6UL_AP wpa_passphrase=12345678

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 iw utility which can be used for tuning some parameters https://wireless.wiki.kernel.org/en/users/documentation/iw