WiFi on iMX6

USB to Wifi Dongle EDIMAX EW-7811Un

Download firmware from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtlwifi or check if firmware is available in folder /lib/firmware/rtlwifi.

load kernel module rtl8192cu:

# modprobe rtl8192cu

start WPA Supplicant:

# wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf

wpa_supplicant.conf config file for NTB network (copy or create in /etc/):

ctrl_interface=/run/wpa_supplicant
update_config=1

network={
	scan_ssid=1
	ssid="NTB_SSID_NETWORK"
	#psk="password for network"
	psk=PSK_GENERATED_HASH_FROM_PW
}

Generate psk for your network with

# wpa_passphrase MYSSID passphrase

Add wlan0 interface to /etc/network/interface:

allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp

Startup-Script for iMX6 (copy to /etc/init.d and give execute permissions):

#!/bin/sh
#
# usb wifi         loads the usb wifi driver
#


start(){
        modprobe rtl8192cu
	wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
}

stop(){
        rmmod rtl8192cu
}



restart(){
        stop
        start
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|reload)
        restart
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac

exit $?

#