{{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"
!Version
!XUELK version
!Date
!Notes
|-
|1.0.0
|1.1.3
|February 2017
|First public release
|-
|2.0.0
|1.1.3
|April 2017
|
*Removed <code>busybox</code>
*Added notes about physical interfaces
|-
|2.1.0
|1.1.3
|April 2017
|
*Added section ''Using the raw image''
*Added notes about <code>ssh</code> server configuration
*Added notes about <code>MySQL</code> server installation and configuration
|-
|}
The procedure was tested on an SBC Lynx with ConfigID=0x0000000C (PCB revision CS214515A), starting from XUELK 1.1.3 binaries.
[2] The provided root file system is derived from this one: https://rcn-ee.com/rootfs/eewiki/barefs/debian-8.7-bare-armhf-2017-01-14.tar.xz.
===Using the raw image===
For convenience, the raw image of the microSD card is provided as well. This image is the result of the procedure described in the previous section, applied to a 16 GB card. The image can be downloaded [https://mirror.dave.eu/lynx/debian/20170403/20170403-sbclynx-debian-8-usd.zip here].
Once decompressed, it can be written directly to the card.
On a Linux host issue the following command (assuming the card is associated to the <code>/dec/sdc</code> device file):
In case your host is a Windows machine, you can use the well-known ''Win32 Disk Imager'' tool. It can be downloaded [https://sourceforge.net/projects/win32diskimager/ here].
[[File:Sbclynx-debian-disk-imager-win.png|thumb|center|600px|''Win32 Disk Imager'' tool]]
After installing it, open it and (see also the image above):
#select the raw image file
#select the drive letter of the microSD card
#press ''Write''.
==Adding packages==
====Bluetooth====
The following script can be run to enable the Bluetooth controller:
<preclass="board-terminal">
root@arm:~# ./test/dwm_bt_init.sh
Found a Texas Instruments' chip!
</pre>
Once the <code>hci</code> interface is enabled, <code>hcitool</code> or other tools can be used to access it:
<preclass="board-terminal">
root@arm:~# hcitool scan
Scanning ...
zz:zz:zz:zz:zz:zz device2
</pre>
====WiFi (client mode)====
The procedure here described can be used to connect to an Access Point, using the WPA2/PSK security protocolwith network address given by the AP via DHCP. User can also follow [https://wiki.debian.org/WiFi/HowToUse#Command_Line this guide from Debian Wiki] for a generic approach.
As the WiFi driver is not statically linked to the kernel image, it is necessary to load the module first. This operation is done automatically done upon boot, as the module is listed in <code>/etc/modules</code>:
<pre class="board-terminal">
root@arm:~# cat /etc/modules
</pre>
Once the WiFi module is loaded, it's time to configure the interface: first of all we need to fix interface renaming with the following command:
To bring Generate the interface upPSK from the ESSID and the clear text passphrase using <code>wpa_passphrase</code> tool:
<pre class="board-terminal">
root@arm:~# iw devwpa_passphrase SSID_ZyXEL_WPA2phy#0reading passphrase from stdin Interface wlan0ZyXEL-WPA2-PSK ifindex 4network={ wdev 0x1 ssid="SSID_ZyXEL_WPA2" addr 88:33:14:5e:30:61 type managedroot@arm:~ # ip link show wlan04: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 link/ether 88:33:14:5e:30:61 brd ff:ff:ff:ff:ff:ffroot@arm:~# ip link set wlan0 up[ 276.076847] wlcore: firmware booted (Rev 6.3.10.0.133)[ 276.097912] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not readyroot@arm:~# ip link show wlan04: wlan0: <NOpsk="ZyXEL-WPA2-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq qlen 1000PSK" link/ether 88:33:14:5e:30:61 brd ff:ff:ff:ff:ff:ffroot@arm:~# iw wlan0 link psk=ec41b79ebdf10022908aa10189b0341f095fd62eeb719a67c5c920e0cde28564Not connected.}
</pre>
The connection will be established with Edit <code>/etc/network/interfaces</code> and change the SSID named <code>SSID_ZyXEL_WPA2wlan0</code> configuration as follows, by entering the <code>ssid</code> and <code>psk</code>generated above:
Add the passphrase key to the User can now restart <code>wpa_supplicantsystemd</code> configuration file and make it readable by <code>root</code> onlynetworking service with:
Start Now you can check the system configuration using standard tools (<code>wpa_supplicantroute</code>:, <pre class="board-terminal"code>root@arm:~# wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.confSuccessfully initialized wpa_supplicantrfkill: Cannot open RFKILL control deviceioctl[SIOCSIWENCODEEXT]: Invalid argumentioctl[SIOCSIWENCODEEXT]: Invalid argument[ 3527.234018] wlan0: authenticate with fe:f0:28:cc:03:90[ 3527.269591] wlan0: send auth to fe:f0:28:cc:03:90 (try 1/3)[ 3527.277879] wlan0: authenticated[ 3527.282841] wl12xx_driver wl12xx.0.auto wlan0: disabling HT/VHT due to WEP/TKIP use[ 3527.298407] wlan0: associate with fe:f0:28:cc:03:90 (try 1/3)[ 3527.307655] wlan0: RX AssocResp from fe:f0:28:cc:03:90 (capab=0x431 status=0 aid=1)[ 3527.326148] wlcore: Association completed.[ 3527.349780] wlan0: associated[ 3527.352824] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes readyifconfig</precode> Once the connection process completed successfully, <code>iw</code> reports ). E.g. to check the WiFi link status as followsuse:
<pre class="board-terminal">
root@arm:~# iw wlan0 link
dtim period: 1
beacon int: 100
</pre>All of the above configuration are persistent at reboots and automatically started by <code>systemd</code> at boot time. ==Miscellaneous configurations=====<code>ssh</code> server===The configuration file <code>/etc/ssh/sshd_config</code> is set to permit <code>root</code> user to log in.===Installing MySQL server with remote access===This section shows how to install MySQL server and how to enable remote access for <code>root</code> user.{{ImportantMessage|text=From a security standpoint, giving <code>root</code> user logon permission from any host may be dangerous.}}
After assigning a (static) IP address to Firstly, install the <code>wlan0mysql-server</code> interfacepackage. During the installation process, it is possibile to ping you will set the Access Pointpassword for the <code>root</code> user:
<pre class="board-terminal">
root@arm:~# ifconfig wlan0 192sudo apt-get updateGet:1 http://security.debian.org jessie/updates InRelease [63.1 kB]...Reading package lists.168.11.81Doneroot@arm:~# ifconfigsudo apt-get install mysql-serverReading package lists... DoneBuilding dependency treeeth0 Link encap...After this operation, 85.1 MB of additional disk space will be used.Do you want to continue? [Y/n]Get:Ethernet HWaddr 001 http:50:C2:1E:AF:E9 inet addr:192//security.debian.org/ jessie/updates/main mysql-common all 5.1685.54-0.+deb8u1 [81 Bcast:192.1682 kB].0.255 Mask:255.255Configuring mysql-server-5.2555---------------------------- While not mandatory, it is highly recommended that you set a password for theMySQL administrative "root" user.0 inet6 addrIf this field is left blank, the password will not be changed. New password for the MySQL "root" user: fe80 Repeat password for the MySQL "root" user: Selecting previously unselected package libaio1:250armhf....Processing triggers for systemd (230-7~bpo8+2) ...root@arm:c2ff~#</pre> Verify the server is up and running:fe1e<pre class="board-terminal">root@arm:afe9/64 Scope~# mysql -u root -pEnter password:Link UP BROADCAST RUNNING MULTICAST Welcome to the MySQL monitor. MTU:1500 Metric:1Commands end with ; or \g.Your MySQL connection id is 43 RX packets:35226 errorsServer version:5.5.54-0 dropped+deb8u1 (Debian) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> exitByeroot@arm:0 overruns~#</pre> Edit the <code>/etc/mysql/my.cnf</code> file in order to comment out the following lines:<pre class="board-terminal">#bind-address = 127.0 frame:.0.1#skip-networking</pre> TX packets Restart the server to make the changes take effect:28 errors<pre class="board-terminal">root@arm:0 dropped~# service mysql restart</pre> Access MySQL server locally and issue the commands shown below:0 overruns<pre class="board-terminal">root@arm:0 carrier~# mysql -u root -pEnter password:0 collisionsWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 37Server version:5.5.54-0 txqueuelen:1000+deb8u1 (Debian) RX bytes:3555583 Copyright (3c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> GRANT ALL PRIVILEGES ON *.3 MiB) TX bytes:1906 * TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;Query OK, 0 rows affected (10.8 KiB01 sec)
root@arm:~# ping 192.168.11.243PING 192.168.11.243 (192.168.11.243): 56 data bytes64 bytes from 192.168.11.243: seq=0 ttl=64 time=20.155 ms64 bytes from 192.168.11.243: seq=1 ttl=64 time=11.253 ms64 bytes from 192.168.11.243: seq=2 ttl=64 time=11.259 ms64 bytes from 192.168.11.243: seq=3 ttl=64 time=3.726 ms64 bytes from 192.168.11.243: seq=4 ttl=64 time=11.582 ms64 bytes from 192.168.11.243: seq=5 ttl=64 time=3.138 ms64 bytes from 192.168.11.243: seq=6 ttl=64 time=11.221 ms64 bytes from 192.168.11.243: seq=7 ttl=64 time=11.652 ms64 bytes from 192.168.11.243: seq=8 ttl=64 time=11.294 ms64 bytes from 192.168.11.243: seq=9 ttl=64 time=11.268 ms64 bytes from 192.168.11.243: seq=10 ttl=64 time=11.598 ms64 bytes from 192.168.11.243: seq=11 ttl=64 time=11.690 ms^C--- 192.168.11.243 ping statistics ---12 packets transmitted, 12 packets received, 0% packet lossround-trip min/avg/max = 3.138/10.819/20.155 msmysql>
</pre>
In order You should be able to automatically load the <code>wl12xx</code> module on startup, issue the following commandaccess from remote host:
<pre class="board-terminal">
rootdvdk@armosboxes:~# echo wl12xx >> $ mysql -u root -ppassword -h 192.168.0.81 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 37 Server version: 5.5.54-0+deb8u1 (Debian) Copyright (c) 2000, 2016, Oracle and/etcor its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/modulesor its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>