H&D-Wireless Wi-Fi Module
The Trizeps VIII Mini is available with H&D Wireless SPB228 Wi-Fi Module.
It includes a powerful Marvell 88W997 chipset capable of 802.11 a/b/g/n/ac, 2×2 Wave2 MU-MIMO, BT 5 Classic, and LE.
Please also view the documentation from H&D Wireless regarding implementing the driver into the OS.
i.e. for Yocto
H&D Wireless supplies a Yocto-recipe.
Unpack meta-spb228-pcie-uart-32.tar.gz to your
<project-dir>/<build-dir>/sources/
-directory.Add
BBLAYERS += " ${BSPDIR}/meta-spb228-pcie-uart-32 "
to your
<project-dir>/<build-dir>/conf/bblayers.conf
Run bitbake
Create wpa_supplicant.conf
$ sudo -i # wpa_passphrase "<your ssid>" "<your passphrase>" > /etc/wpa_supplicant/wpa_supplicant.conf
Power-Up Interface
$ ifconfig mlan0 up
Scan and Connect to Wi-Fi Network
Simple Scan
$ iw mlan0 scan
Connect manually using wpa_cli
Start wpa_supplicant:
$ wpa_supplicant -Dnl80211 -imlan0 -c/etc/wpa_supplicant.conf &
Run wpa_cli:
$ wpa_cli wpa_cli v2.6 Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi> and contributors This software may be distributed under the terms of the BSD license. See README for more details. Selected interface 'mlan0' Interactive mode
Use the scan command to list available networks:
> scan_results > bssid / frequency / signal level / flags / ssid a8:9d:21:9d:fe:ec 5300 -78 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP][ESS] WLAN-EXAMPLE-5G a8:9d:21:9d:fe:e4 2412 -90 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP][ESS] WLAN-EXAMPLE-2.4G
To connect to one of them, you will first need to create a network:
> add_network 1
The output ('1') is the network ID used in the next commands:
> set_network 1 ssid "WLAN_EXAMPLE-5G" > set_network 1 psk "YourWLANPassword"
The 'list_networks' commands show which networks have been set up ( i.e. WLAN_EXAMPLE-5G).
With 'select_network <network ID>' you select the network to which wpa_cli should connect:
> select_network 1
Will trigger connection to the previously set up network WLAN_EXAMPLE-5G.
The mlan0 interface needs to be assigned an IP address, to have it functional. Either through DHCP or manually.
Get BT running
Prerequisites
The onboard WiFi/BT module on Trizeps VIII Mini/Trizeps VIII Plus is connected via UART, so all communication is handled by the HCI UART driver, which must be compiled with support for the Marvell protocol. Add the following to your kernel-config:
CONFIG_BT_HCIUART=m CONFIG_BT_HCIUART_SERDEV=y CONFIG_BT_HCIUART_MRVL=y
The user-space programs for BT are in a package called bluez. In Debian and it's derivates you can install it by
$ sudo apt install bluez
For Yocto add something like
IMAGE_INSTALL += "bluez"
to your image recipe.
Startup
First of all the kernel module must be loaded and the BT device must be attached to the appropriate UART:
$ sudo modprobe hci_uart $ sudo hciattach /dev/ttymxc2 any 115200 flow
This attaches UART3 to any Bluetooth interface found with a baudrate of 115200 and hardware flow control.
Important: In difference to the Trizeps VIII Mini, the Trizeps VIII Plus uses UART4 for BT, so the hciattach must be changed to:
$ sudo hciattach /dev/ttymxc3 any 115200 flow
Configuration
After this, you can start the BT interface
$ sudo hciconfig hci0 up
assign a name to it
$ sudo hciconfig hci0 name Trizeps8
enable page and inquiry scan
$ sudo hciconfig hci0 piscan
or stop it
$ sudo hciconfig hci0 down
There is also an interactive tool called bluetoothctl
$ bluetoothctl Agent registered [bluetooth]#
You can scan for available devices
[bluetooth]# scan on Discovery started [CHG] Controller 78:C4:0E:A0:0F:80 Discovering: yes [NEW] Device C0:8C:71:4D:4B:23 Telefon [bluetooth]# scan off Discovery stopped [CHG] Controller 78:C4:0E:A0:0F:80 Discovering: no
and list the devices found
[bluetooth]# devices Device C0:8C:71:4D:4B:23 Telefon [DEL] Device C0:8C:71:4D:4B:23 Telefon
The most important command:
[bluetooth]# help Menu main: Available commands: ------------------- advertise Advertise Options Submenu scan Scan Options Submenu gatt Generic Attribute Submenu list List available controllers show [ctrl] Controller information select <ctrl> Select default controller devices List available devices paired-devices List paired devices system-alias <name> Set controller alias reset-alias Reset controller alias power <on/off> Set controller power pairable <on/off> Set controller pairable mode discoverable <on/off> Set controller discoverable mode agent <on/off/capability> Enable/disable agent with given capability default-agent Set agent as the default one advertise <on/off/type> Enable/disable advertising with given type set-alias <alias> Set device alias scan <on/off> Scan for devices info [dev] Device information pair [dev] Pair with device trust [dev] Trust device untrust [dev] Untrust device block [dev] Block device unblock [dev] Unblock device remove <dev> Remove device connect <dev> Connect device disconnect [dev] Disconnect device menu <name> Select submenu version Display version quit Quit program exit Quit program help Display help about this program export Print evironment variables
Leave it with:
[bluetooth]# exit $
BT devices can also be managed by bluetoothd witch is configured by files in /etc/bluetooth
. Nevertheless the kernel module must be loaded and the UART must be attached in some init-script that is executed before bluetoothd is started. Otherwise it will refuse to start.
Notes
Enable & Disable WLAN function of the Device
GPIO3_17 ( GPIO81; see Using a GPIO in Linux) can be used to enable and disable the WLAN function.
Set GPIO high to enable; set GPIO low to disable WLAN function.