APPNOTE-18 Bringing Up prplMesh on Linux
v2
1 Overview
This application note details the procedures for integrating prplMesh on Linux. The original prplMesh open-source implementation lacks built-in support for the HaLow (802.11ah) standard. Consequently, Morse Micro has customized the open-source prplMesh to extend its support for HaLow wireless interfaces. Given that prplMesh operates as an application within the wireless platform, achieving 11ah compatibility on the platform necessitates the utilization of Morse Micro version of hostapd and wpa_supplicant.
2 Prerequisites
2.1 Hardware requirements
This guide assumes that you already have a suitable platform with the MM6108 HaLow chip integrated via SDIO or SPI and running successfully in Linux. If you do not have this please reach out to support to discuss the options, or consider using an evaluation kit as a starting point. All OpenWrt-based EVKs from Morse Micro support prplMesh (known by its standard name ‘EasyMesh’) out of the box.
2.2 Software Requirements
The following section outlines the software components that are required for integrating prplMesh with HaLow support into Linux.
2.2.1 hostapd_s1g and wpa_supplicant_s1g
Ensure that both these packages are compiled and installed on the intended Linux device. These are customized versions that support HaLow interfaces, and should already be present as part of the basic HaLow integration on the platform.
2.2.2 UCI, ubus, and libubox:
Not all Linux systems include UCI, ubus and libubox by default, as these are generally specific to OpenWrt-based systems. However they are integral components of the Morse Micro adaptation of prplMesh, and will need to be included. prplMesh relies on UCI as its configuration interface and requires ubus for DHCP events.
While the absence of ubus events may not cause significant functional issues, it is essential for successfully building the SDK.
2.2.3 Host Machine Compilation and Installation Requirements:
The following host packages should be installed before compiling UCI and ubus:
sudo apt install lua5.1
sudo apt install liblua5.1-0-dev
sudo apt install libjson-c-dev
Once the host dependencies above are installed, follow the steps below to retrieve and compile the source code for each of the packages for the host machine and install on the host:
libubox:
$ git clone git://git.openwrt.org/project/libubox.git
$ cd libubox
$ cmake .
$ sudo make install
ubus:
$ git clone git://git.openwrt.org/project/ubus.git
$ cd ubus
$ cmake .
$ sudo make install
UCI:
$ git clone git://git.openwrt.org/project/uci.git
$ cd uci
$ cmake .
$ sudo make install
2.2.4 Target Machine Compilation and Installation Requirements:
For the target machine, the following packages downloaded on the host must be again re-compiled for the target and installed on the target with the specified commands:
libubox:
$ cmake -DCMAKE_C_COMPILER= .
$ make
$ install ‘libubox.so’in ‘/usr/local/lib/libubox.so’ on the target
ubus:
$ cmake -DCMAKE_C_COMPILER= .
$ make
$ install ‘libubus.so’in ‘/usr/local/lib/libubus.so’ on the target
UCI:
$ cmake -DCMAKE_C_COMPILER= .
$ make
$ install ‘libuci.so’in ‘/usr/local/lib/libuci.so’ on the target
Note: Ensure to pass the appropriate cross compiler option for the target using the CMAKE_C_COMPILER flag. for e.g: cmake -DCMAKE_C_COMPILER=arm-elf-gcc .
2.2.5 Other Packages
Refer to the prplMesh README.md file for additional package requirements. At time of writing this includes:
binutils
cmake
gcc
git
libjson-c-dev
libncurses-dev
libnl-3-dev
libnl-genl-3-dev
libnl-route-3-dev
libssl-dev
ninja-build
pkg-config
python
python-yaml
python3
python3-yaml
bison
curl
flex
libevent-dev
libyajl-dev
lua5.1
liblua5.1-0-dev
build-essential
clang-format
gcovr
bridge-utils
ebtables
iproute2
net-tools
psmisc
uuid-runtime
3 Building the code
3.1 Download and extract the prplMesh source
Obtain the prplMesh source tar file from the Morse Micro DocSend release folder and extract it, using the following command:
tar xvzf prplmesh-rel_1_10_2_2023_Nov_22.tgz
3.2 Update CMakeLists.txt
Add the following extra CFLAGS [highlighted in blue] to the CMakeLists.txt file present in the top directory:
# Default Compiler flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -pthread -Wno-comment -Wno-unused-parameter -Wno-missing-field-initializers -Wno-error=deprecated-declarations -Wno-error=maybe-uninitialized")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s -O2 -Wformat -Wformat-security -Wl,-S -fPIC -fPIE")
# Compiler specific flags
3.3 Build the code
From the top level directory invoke cmake as follows,
cmake -DCMAKE_C_COMPILER= -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=build/install -DTARGET_PLATFORM="MorseMicro" -DBEEROCKS_BRIDGE_IFACE="br-prpl" -DBWL_TYPE="NL80211" -DBUILD_SHARED_LIBS=OFF -H. -B./build
Note: Use appropriate bridge name for -DBEEROCKS_BRIDGE_IFACE.
Once cmake is successful, run make to finish the compilation
make -C ./build install
3.4 Copy the files into the target
Transfer the contents of '<top_dir>/build/install/*' to the target device, maintaining the identical directory structure.
4 Running prplMesh
4.1 Start prplMesh Controller and Agent
Navigate to the scripts directory:
cd /scripts
Start prplMesh Controller (default mode is Mesh Controller):
sudo ./prplmesh_utils.sh start (or) sudo ./prplmesh_utils.sh --mode CA start
4.2 Run only as Mesh Agent
From the /scripts directory run the following command:
sudo ./prplmesh_utils.sh --mode A start
5 Revision History
01
02/02/2024
Initial release
02
28/11/2024
Revised formatting for release
Last updated
Was this helpful?