Open main menu

DAVE Developer's Wiki β

Changes

XUELK-AN-001: Using WiFi-Bluetooth combo plugin with SBC Lynx

15,323 bytes added, 16:37, 12 February 2021
no edit summary
{{InfoBoxTop}}
{{AppliesToSBCLynx}}
{{AppliesToDWM AN}}
{{AppliesTo AXEL ULite AN}}
{{AppliesTo SBC Lynx AN}}
 
{{InfoBoxBottom}}
{{WarningMessage|text=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.}}
{{ImportantMessage|text=Regarding the Molex antenna used in this AN. It is valid only for '''No EU''' countries - see [https://www.lairdconnect.com/documentation/regulatory-information-tiwi-ble link]}}
== History ==
{| class="wikitable" border="1"
!Notes
|-
|{{oldid|6665|1.0.0}}
|August 2016
|1.0.0
|1.0.0
|August 2016
|First public release
|-
|{{oldid|6756|1.2.0}}
|May 2017
|1.2.0
|Update for new XUELK release
|-
|2.0.0
|September 2017
|2.0.0
|Validated on latest XUELK release
|}
 
==Introduction==
[[:Category:SBC_Lynx|SBC Lynx]] can be populated with [[Wireless_Module_(DWM)|DWM WiFi/Bluetooth combo plugin]] to easily add wireless connectivity.
This application note describes how to enable these interfaces when working with [[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#XUELK_software_components|XUELK 1.0.0]]
 
[[File:SBCLynx-DWM-antenna.png|thumb|center|600px|SBC Lynx equipped with WiFi-Bluetooth combo plugin (DWM) and antenna]]
===Limitations===
DWM wireless module shares some signals with mezzanine board connector J53. Thus, when DWM module is used, the following signals must be left floating:
*J53.4 (UART2_nCTS).
==WiFiUsage==Enable Starting from version [[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#XUELK_software_components|1.0.0]], the software delivered along with [[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)|XUELK]] provides all the required stuff—specifically device drivers and user space tools—to enable and use wireless interfaces. The following sections describe this in more detail. ===Calibration===As known, the radio chipset integrated in the plugin requires a [[Wireless_Module_(DWM)#Calibration_process|calibration file (NVS)]] to set radio parameters. The root file system delivered along with XUELK contains a calibration file (<code>wl1271-nvs.bin</code>) that was produced under the following conditions:*Antenna: [http://www.molex.com/molex/products/datasheet.jsp?part=active/0479500011_ANTENNAS.xml Molex 47950-0011]*Initialization data: The following file was used "''WLAN INI: ETSI all certified antennas''", provided by LS Research. For more details please refer to [https://www.lairdconnect.com/documentation/wlan-ini-etsi-all-certified-antennas this page].**File name: <code>930-0056.zip</code>**md5: <code>f16da1e1c1ea3cc3cca295931d454a43</code>*Firmware**File name: <code>wl127x-fw-5-plt.bin</code>**Version: <code>6.3.10.0.133</code> {{ImportantMessage|text=For [[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#XUELK_software_components|XUELK releases]] 1.1.3 and older, please replace the calibration file in the target's root file system (<code>/lib/firmware/ti-connectivity/wl1271-nvs.bin</code>) with this one:*https://mirror.dave.eu/lynx/DWM/20170331/wl1271-nvs.bin*md5: <code>5e331d2ca1590b711dc8676085bf8ad6</code>}} ===Detection upon bootstrap===During the Linux kernel bootstrap, the following messages are printed out during the detection of interfacethe wireless chipset:
<pre>
wilink-wl-en: 3300 mVwl1271_sdio mmc1:0001:2: legacy platform data not found, trying device treewl12xx_driver wl12xx.0.auto: Direct firmware load failed with error -2wl12xx_driver wl12xx.0.auto: Falling back to user helperwlcore: loaded</pre>===WiFi (client mode)===The following example shows how to:*enable WiFi interface, configured as <code>wlan0</code>*scan the environment for available networks<pre>root@sbc-lynx:~# ifconfig wlan0 downwlcorewlan0 Link encap:Ethernet HWaddr DE:AD:BE:EF:00:00 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes: down0 (0.0 B) root@sbc-lynx:~# ifconfig wlan0 up192.168.11.88
wlcore: firmware booted (Rev 6.3.10.0.133)
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
</pre>
 
Scan of AP
<pre>
root@sbc-lynx:~# iw wlan0 scan
BSS 22:aa:4b:22:55:5f(on wlan0) TSF: 16627322627 usec (0d, 04:37:07) freq: 2437 beacon interval: 100 TUs capability: ESS Privacy ShortPreamble ShortSlotTime (0x0431) signal: -57.00 dBm last seen: 0 ms ago SSID: daveguest Supported rates: 1.0* 2.0* 5.5* 11.0* 18.0 24.0* 36.0 54.0 DS Parameter set: channel 6 ERP: <no flags> ERP D4.0: <no flags> Extended supported rates: 6.0* 9.0 12.0* 48.0 WPA: * Version: 1 * Group cipher: TKIP * Pairwise ciphers: TKIP * Authentication suites: PSK * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c) WMM: * Parameter version 1 * u-APSD * BE: CW 15-1023, AIFSN 3 * BK: CW 15-1023, AIFSN 7 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec * VO: CW 3-7, AIFSN 2, TXOP 1504 usecBSS 00:1f:1f:b0:52:30(on wlan0) TSF: 838990685 usec (0d, 00:13:58) freq: 2462 beacon interval: 100 TUs capability: ESS ShortSlotTime (0x0401) signal: -53.00 dBm last seen: 0 ms ago SSID: INTELLINET_AP2 Supported rates: 1.0* 2.0* 5.5* 11.0* 9.0 18.0 36.0 54.0 DS Parameter set: channel 11 ERP: Barker_Preamble_Mode Extended supported rates: 6.0 12.0 24.0 48.0 HT capabilities: Capabilities: 0x11ee HT20/HT40 SM Power Save disabled RX HT20 SGI RX HT40 SGI TX STBC RX STBC 1-stream Max AMSDU length: 3839 bytes DSSS/CCK HT40 Maximum RX AMPDU length 65535 bytes (exponent: 0x003) Minimum RX AMPDU time spacing: 4 usec (0x05) HT RX MCS rate indexes supported: 0-7, 32 HT TX MCS rate indexes are undefined HT operation: * primary channel: 11 * secondary channel offset: below * STA channel width: any * RIFS: 0 * HT protection: 20 MHz * non-GF present: 1 * OBSS non-GF present: 0 * dual beacon: 0 * dual CTS protection: 0 * STBC beacon: 0 * L-SIG TXOP Prot: 0 * PCO active: 0 * PCO phase: 0 Secondary Channel Offset: no secondary (0) WMM: * Parameter version 1 * BE: CW 15-1023, AIFSN 3 * BK: CW 15-1023, AIFSN 7 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec * VO: CW 3-7, AIFSN 2, TXOP 1504 usec Overlapping BSS scan params: * passive dwell: 20 TUs * active dwell: 10 TUs * channel width trigger scan interval: 300 s * scan passive total per channel: 200 TUs * scan active total per channel: 20 TUs * BSS width channel transition delay factor: 5 * OBSS Scan Activity Threshold: 0.25 % Extended capabilities: HT Information Exchange SupportedBSS ca:d7:19:92:f9ee:17ba(on wlan0) TSF: 36464451691 16633637827 usec (0d, 1004:0737:4413) freq: 24122462
beacon interval: 100 TUs
capability: ESS Privacy ShortSlotTime (0x0411)
signal: -9792.00 dBm last seen: 2820 0 ms ago
Information elements from Probe Response frame:
SSID: davesrl2daveguest3
Supported rates: 1.0* 2.0* 5.5* 11.0* 18.0 24.0 36.0 54.0
DS Parameter set: channel 111
ERP: <no flags>
ERP D4.0: <no flags>
* VI: CW 7-15, AIFSN 2, TXOP 3008 usec
* VO: CW 3-7, AIFSN 2, TXOP 1504 usec
 
root@sbc-lynx:~# iw wlan0 connect INTELLINET_AP2
root@sbc-lynx:~# wlan0: authenticate with 00:1f:1f:b0:52:30
wlan0: send auth to 00:1f:1f:b0:52:30 (try 1/3)
wlan0: authenticated
wlan0: associate with 00:1f:1f:b0:52:30 (try 1/3)
wlan0: RX AssocResp from 00:1f:1f:b0:52:30 (capab=0x401 status=0 aid=1)
wlcore: Association completed.
wlan0: associated
IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
 
root@sbc-lynx:~# ping 192.168.11.85
PING 192.168.11.85 (192.168.11.85): 56 data bytes
64 bytes from 192.168.11.85: seq=0 ttl=64 time=14.506 ms
64 bytes from 192.168.11.85: seq=1 ttl=64 time=12.237 ms
^C
--- 192.168.11.85 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max
</pre>
====Performance test====The following example shows a throughput performance test, carried out with the well-known [https://iperf.fr/ <code>iperf</code> tool]:<pre>root@sbc-lynx:~# iperf -c 192.168.11.85 -t 100 -i 5------------------------------------------------------------Client connecting to 192.168.11.85, TCP port 5001TCP window size: 43.8 KByte (default)------------------------------------------------------------[ 3] local 192.168.11.88 port 49993 connected with 192.168.11.85 port 5001[ ID] Interval Transfer Bandwidth[ 3] 0.0- 5.0 sec 20.2 MBytes 34.0 Mbits/sec[ 3] 5.0-10.0 sec 20.2 MBytes 34.0 Mbits/sec[ 3] 10.0-15.0 sec 20.1 MBytes 33.8 Mbits/sec[ 3] 15.0-20.0 sec 20.0 MBytes 33.6 Mbits/sec[ 3] 20.0-25.0 sec 19.2 MBytes 32.3 Mbits/sec[ 3] 25.0-30.0 sec 19.9 MBytes 33.3 Mbits/sec[ 3] 30.0-35.0 sec 20.2 MBytes 34.0 Mbits/sec[ 3] 35.0-40.0 sec 20.4 MBytes 34.2 Mbits/sec[ 3] 40.0-45.0 sec 20.0 MBytes 33.6 Mbits/sec[ 3] 45.0-50.0 sec 19.9 MBytes 33.3 Mbits/sec[ 3] 50.0-55.0 sec 20.4 MBytes 34.2 Mbits/sec[ 3] 55.0-60.0 sec 20.5 MBytes 34.4 Mbits/sec[ 3] 60.0-65.0 sec 18.9 MBytes 31.7 Mbits/sec[ 3] 65.0-70.0 sec 20.4 MBytes 34.2 Mbits/sec[ 3] 70.0-75.0 sec 20.6 MBytes 34.6 Mbits/sec[ 3] 75.0-80.0 sec 20.0 MBytes 33.6 Mbits/sec[ 3] 80.0-85.0 sec 19.9 MBytes 33.3 Mbits/sec[ 3] 85.0-90.0 sec 19.1 MBytes 32.1 Mbits/sec[ 3] 90.0-95.0 sec 20.1 MBytes 33.8 Mbits/sec[ 3] 95.0-100.0 sec 20.6 MBytes 34.6 Mbits/sec[ 3] 0.0-100.0 sec 401 MBytes 33.6 Mbits/sec</pre> ===Bluetooth=== It is possible to attach the physical device to [http://www.bluez.org/ BlueZ stack] and start using it via HCI tools: <pre>root@sbc-lynx:~# hciattach -t 60 /dev/ttymxc1 texas 115200Found a Texas Instruments' chip!Firmware file : /lib/firmware/ti-connectivity/TIInit_7.6.15.btsLoaded BTS script version 1texas: changing baud rate to 3000000, flow control to 1Device setup completeroot@sbc-lynx:~# hciconfig hci0 uproot@sbc-lynx:~# hcitool scanScanning ... 00:02:72:C6:40:16 virt</pre>  {{ImportantMessage|text=For XUELK 1.1.3 and below, to enable Bluetooth interface, <code>gpio135</code> must be set to 1 first 
<pre>
root@sbc-lynx:~# echo 135 > /sys/class/gpio/export
root@sbc-lynx:~# echo out > /sys/class/gpio/gpio135/direction
root@sbc-lynx:~# echo 1 > /sys/class/gpio/gpio135/value
</pre>
 
}}
 
====Performance tests====
The following examples show two throughput performance tests, run at L2CAP layer. The connection has been established with a PC equipped with Bluetooth USB dongle Asus BT400.
 
In the first test data originates at the SBC Lynx and is sent to the host PC that is configured as follows:
<pre>
[ 4012.910755] Bluetooth: RFCOMM TTY layer initialized
[ 4012.910760] Bluetooth: RFCOMM socket layer initialized
[ 4012.910765] Bluetooth: RFCOMM ver 1.11
devel@devel-VirtualBox:~$ sudo modprobe -v btusb
devel@devel-VirtualBox:~$ sudo su
root@devel-VirtualBox:/home/devel# echo "0b05 17cb" >> /sys/bus/usb/drivers/btusb/new_id
root@devel-VirtualBox:/home/devel# hciconfig
hci0: Type: BR/EDR Bus: USB
BD Address: 00:02:72:C6:40:16 ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING PSCAN
RX bytes:1194 acl:0 sco:0 events:69 errors:0
TX bytes:1556 acl:0 sco:0 commands:69 errors:0
 
root@devel-VirtualBox:/home/devel# hciconfig hci0 up
root@devel-VirtualBox:/home/devel# hciconfig hci0 name virt
root@devel-VirtualBox:/home/devel# hciconfig hci0 class 0x6e0100
root@devel-VirtualBox:/home/devel# hcitool dev
Devices:
hci0 00:02:72:C6:40:16
root@devel-VirtualBox:/home/devel# hciconfig hci0 piscan
root@devel-VirtualBox:/home/devel# l2test -r -b 10000 -O 10000 -I 10000
l2test[1795]: Waiting for connection on psm 4113 ...
</pre>
Configuration of SBC Lynx:
<pre>
root@sbc-lynx:~# echo 135 > /sys/class/gpio/export
root@sbc-lynx:~# echo out > /sys/class/gpio/gpio135/direction
root@sbc-lynx:~# echo 1 > /sys/class/gpio/gpio135/value
root@sbc-lynx:~# echo 1 > /sys/class/gpio/gpio135/value
root@sbc-lynx:~# hciattach -t 60 /dev/ttymxc1 texas 115200
Scanning ...
00:02:72:C6:40:16 virt
root@sbc-lynx:~# hcitool dev
Devices:
hci0 1C:45:93:5C:DC:69
root@sbc-lynx:~# l2test -s 00:02:72:c6:40:16 -b 10000 -O 10000 -I 10000
l2test[717]: Connected to 00:02:72:C6:40:16 (bredr, psm 4113, scid 64)
l2test[717]: Local device 1C:45:93:5C:DC:69 (bredr, psm 4097, scid 64)
l2test[717]: Options [imtu 10000, omtu 10000, flush_to 65535, mode 0, handle 1, class 0x6e0100, priority 0, rcvbuf 163840]
l2test[717]: Sending ...
</pre>
These are the results, as reported on host side:
<pre>
l2test[1822]: Connect from 1C:45:93:5C:DC:69 [imtu 10000, omtu 10000, flush_to 65535, mode 0, handle 12, class 0x001f00, priority 0, rcvbuf 212992]
l2test[1822]: Receiving ...
l2test[1822]: 10000 bytes in 0.08 sec, 125.63 kB/s
l2test[1822]: 10000 bytes in 0.06 sec, 165.19 kB/s
l2test[1822]: 10000 bytes in 0.07 sec, 133.54 kB/s
l2test[1822]: 10000 bytes in 0.07 sec, 131.60 kB/s
l2test[1822]: 10000 bytes in 0.08 sec, 127.59 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 191.97 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 196.78 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 195.44 kB/s
l2test[1822]: 10000 bytes in 0.08 sec, 128.06 kB/s
l2test[1822]: 10000 bytes in 0.04 sec, 226.70 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 196.70 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 192.15 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 192.58 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 199.52 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 196.94 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 191.98 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 200.49 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 192.34 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 192.49 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 200.19 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 196.10 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 191.87 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 200.53 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 188.93 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 200.21 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 192.42 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 198.11 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 192.39 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 197.82 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 192.40 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 198.15 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 200.03 kB/s
l2test[1822]: 10000 bytes in 0.05 sec, 190.55 kB/s
</pre>
 
To test the other direction (host -> SBC Lynx), the PC has to configured as follows:
<pre>
root@devel-VirtualBox:/home/devel# l2test -s 1C:45:93:5C:DC:69 -b 10000 -O 10000 -I 10000
l2test[1829]: Connected [imtu 10000, omtu 10000, flush_to 65535, mode 0, handle 12, class 0x000000, priority 0, rcvbuf 212992]
l2test[1829]: Sending ...
</pre>
The target has to be configured in receiving mode:
<pre>
root@sbc-lynx:~# hciconfig hci0 piscan
root@sbc-lynx:~# l2test -r -b 10000 -O 10000 -I 10000
l2test[719]: Waiting for connection on psm 4113 ...
l2test[720]: Connect from 00:02:72:C6:40:16 (bredr, psm 4113, dcid 64)
l2test[720]: Local device 1C:45:93:5C:DC:69 (bredr, psm 0, scid 64)
l2test[720]: Options [imtu 10000, omtu 10000, flush_to 65535, mode 0, handle 1, class 0x6e0100, priority 0, rcvbuf 163840]
l2test[720]: Receiving ...
l2test[720]: 10000 bytes in 0.08 sec, 118.66 kB/s
l2test[720]: 10000 bytes in 0.06 sec, 157.15 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 256.54 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 249.19 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 257.00 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 256.44 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 259.77 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 257.03 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 265.94 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 257.42 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 265.25 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 256.81 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 257.66 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 240.65 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 258.23 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 257.03 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 257.44 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 257.21 kB/s
l2test[720]: 10000 bytes in 0.04 sec, 257.61 kB/s
</pre>
a000298_approval, dave_user
299
edits