BELK-AN-012: Using an external USB to Wifi adapter

From DAVE Developer's Wiki
Jump to: navigation, search
Info Box


Warning-icon.png This application note was validated against specific versions of the kit only. It may not work with other versions. Supported versions are listed in the History section. Warning-icon.png

History[edit | edit source]

Date BELK version Notes

2023/09/11

BELK 4.1.4 First release
2023/12/13 BELK 4.1.4 Update build info

Introduction[edit | edit source]

BORA, BORA Xpress and BORA Lite Evaluation Kit maybe used with an external USB to wifi adpater for easily connect to a Wifi network.

As an example, we will show how to add the support for the LM007 wifi to USB network adapter which uses a well known Realtek RTL8188EUS chipset.

This one has been selected by many companies for building this kind of adapter for the large market. In particular, the LM Technologies version has a good temperature range (-20°C to +85°C) and is well supported by lwfinger wifi drivers.

This application note shows, for instance, how to configure the Linux driver for managing the USB to Wifi adapter.

Linux driver[edit | edit source]

It is possible to enable the driver for using the adapter in the following way:

  • firstly you have to download the lwfinger driver cloning the related git repo
 cd drivers/net/wireless/realtek
 git clone https://github.com/lwfinger/rtl8188eu.git
  • then, you have to add the drivers/net/wireless/realtek/rtl8188eu/Kconfig file for get a built-in driver
config RTL8188EU
        tristate "Realtek 8188EU USB support"
        depends on USB
        ---help---
          Help message of RTL8188EU
  • and enable the driver building in the drivers/net/wireless/realtek/Makefile
obj-$(CONFIG_RTL8188EU)      += rtl8188eu/
  • now, you have to enable the kernel driver selecting the various kernel options (some of them required for the driver kernel error-free compilation)
> Networking support > Wireless > cfg80211 - wireless configuration API
> Networking support > Wireless > cfg80211 wireless extensions compatibility
> Device Drivers > Network device support > Wireless LAN > Realtek 8188EU USB support
> Device Drivers > Network device support > Wireless LAN > USB ZD1201 based Wireless device support

i.e.

CONFIG_CFG80211=y
CONFIG_CFG80211_WEXT=y 
CONFIG_RTL8188EU=y
CONFIG_USB_ZD1201=y 

the last one has been just added for enabling CONFIG_WEXT_PRIV

Build the kernel[edit | edit source]

The kernel has to be built for enabling the built-in driver:

make UIMAGE_LOADADDR=0x8000 uImage

Once built, copy the kernel uImage in the target:

scp arch/arm/boot/uImage root@192.168.0.90:/home/root

and then move the uImage in the SD card first partition.

Configuring the root file system[edit | edit source]

It is useful to add the wireless-tools utilities for the wifi management: this can be done using the smart package manager (as depicted here)

smart install wireless-tools

The wifi adapter requires its own firmware already present in the cloned repository. Then, copy the rtl8188eufw.bin firmware in the proper path in the root file system (i.e. /lib/firmware/rtlwifi/rtl8188eufw.bin)

scp drivers/net/wireless/realtek/rtl8188eu/rtl8188eufw.bin root@192.168.0.90:/lib/firmware/rtlwifi

Using the wifi adapter[edit | edit source]

Once the system has been configured, boot the EVK with the wifi adpater inserted: the adapter is recognized by the kernel

…
INIT: version 2.88 booting
[    1.547217] Chip Version Info: CHIP_8188E_Normal_Chip_TSMC_D_CUT_1T1R_RomVer(0)
[    1.587575] EEPROM ID = 0x8129
Starting udev
…

Now, it is possible to start the wlan0 interface:

bora login: root
root@bora:~# ifconfig wlan0 up
[   83.061633] R8188EU: Firmware Version 11, SubVersion 1, Signature 0x88e1
[   83.465308] MAC Address = 34:c9:f0:88:ec:dd
[   83.474283] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
root@bora:~#

and - using the wireless tool - scan the wifi networks available:

root@bora:~# iwlist wlan0 scan
wlan0     Scan completed :
          Cell 01 - Address: D0:21:F9:34:8E:88
                    ESSID:"daveguest"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 02 - Address: D0:21:F9:34:87:E8
                    ESSID:"daveguest"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 03 - Address: D2:21:F9:34:8E:88
                    ESSID:"davesrl"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 04 - Address: D2:21:F9:34:87:E8
                    ESSID:"davesrl"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 05 - Address: E2:21:F9:34:87:E8
                    ESSID:""
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 06 - Address: E2:21:F9:34:8E:88
                    ESSID:""
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 07 - Address: D2:21:F9:34:8E:79
                    ESSID:"davesrl"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 08 - Address: D2:21:F9:34:87:82
                    ESSID:"davesrl"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 09 - Address: F2:21:F9:34:8E:88
                    ESSID:""
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality=0/100  Signal level=100/100
          Cell 10 - Address: D0:21:F9:34:8E:79
                    ESSID:"daveguest"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 11 - Address: D0:21:F9:34:87:82
                    ESSID:"daveguest"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 12 - Address: F2:21:F9:34:87:E8
                    ESSID:""
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality=0/100  Signal level=68/100
          Cell 13 - Address: FE:3F:DB:B9:B9:C9
                    ESSID:"DIRECT-C9-HP PageWide Pro 477dw"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:108 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020c00
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD9E0050F204104A0001101044000102103B00010310470010802575266702757DCA107EFC225144A81021000248501023001948502050616765576964652050726F203437376477204D4650102400064433513230421042000A434E37313646583036321054000800030050F204000110110001201008000240081049000600372A0001201049001700013710060010802575266702757DCA107EFC225144A8
                    Quality:0  Signal level:0  Noise level:0
          Cell 14 - Address: E2:80:C3:75:50:02
                    ESSID:"Mi 10T Lite"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:300 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020c00
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 15 - Address: D2:21:F9:34:8E:8D
                    ESSID:"davesrl"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.462 GHz (Channel 11)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 16 - Address: D0:21:F9:34:8E:8D
                    ESSID:"daveguest"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.462 GHz (Channel 11)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality:0  Signal level:0  Noise level:0
          Cell 17 - Address: F2:21:F9:34:8E:8D
                    ESSID:""
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.462 GHz (Channel 11)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality=0/100  Signal level=64/100

root@bora:~#