morse_mesh11sd: add the Morse Micro modified mesh11sh package

mesh11sd is used by OpenWrt to provide dynamic configuration for 802.11s
mesh-like networks.

Because the Morse Micro design/implementation of mesh requires configuration
changes to be made to the supplicant configuration files, rather than through
iw/netlink, the modifications in this package allow for the mesh11sd package
to reload the newly applied configuration.
This commit is contained in:
Morse Micro 2024-09-17 22:13:11 +10:00 committed by Arien Judge
parent 467723e524
commit 9328f48913
4 changed files with 224 additions and 0 deletions

View File

@ -0,0 +1,73 @@
# SPDX-License-Identifier: GPL-2.0-only
#
#The mesh11sd dameon is designed in such a way that all configuration done to 11s mesh can be directly set to the
#mac80211 via iw utility and does not require any re-configuration of interfaces. Considering the MorseMicro design and
#implementation of 802.11s mesh, most of the configuration needs to be applied to the wpa_supplicant.conf which requires
#re-configuration of the interface.
#Thus we need a reload_service section to mesh11sd that will re-configure wifi via wifi down and up.
#
#Openwrt provided Mesh11sd package is found in: https://github.com/openwrt/routing/tree/master/mesh11sd
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
# Copyright (C) 2022 BlueWave Projects and Services <licence@blue-wave.net>
#
include $(TOPDIR)/rules.mk
PKG_NAME:=morse_mesh11sd
PKG_VERSION:=1.2.0
PKG_RELEASE:=$(AUTORELEASE)
PKG_MAINTAINER:=Rob White <rob@blue-wave.net>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/opennds/mesh11sd/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=b719eaacf63eb3684d0cd6a026f4357a4f400f2339f5d5a6cf74ba3744fe30d8
PKG_BUILD_DIR:=$(BUILD_DIR)/mesh11sd-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/morse_mesh11sd
SUBMENU:=Captive Portals
SECTION:=net
CATEGORY:=Network
TITLE:=Dynamic 802.11s Mesh Configuration Daemon
PKGARCH:=all
URL:=https://github.com/opennds/mesh11sd
PROVIDES:=mesh11sd
endef
define Package/morse_mesh11sd/description
Mesh11sd is a dynamic parameter configuration daemon for 802.11s mesh networks.
It was originally designed to leverage 802.11s mesh networking at Captive Portal venues.
This is the open source version and it enables easy and automated mesh network operation with multiple mesh nodes.
It allows all mesh parameters supported by the wireless driver to be set in the uci config file.
Settings take effect immediately without having to restart the wireless network.
Default settings give rapid and reliable layer 2 mesh convergence.
Without mesh11sd, many mesh parameters cannot be set in the uci wireless config file as the mesh interface must be up before the parameters can be set.
Some of those that are supported, would fail to be implemented when the network is (re)started resulting in errors or dropped nodes.
The mesh11sd daemon dynamically checks configured parameters and sets them as required.
This version does not require a Captive Portal to be running.
The modified morse_mesh11sd would allow reconfiguring the wpa supplicant everytime there is 11sMesh config modification.
endef
define Package/morse_mesh11sd/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mesh11sd $(1)/usr/sbin
$(INSTALL_CONF) ./files/etc/config/mesh11sd $(1)/etc/config/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/linux_openwrt/mesh11sd/files/etc/init.d/mesh11sd $(1)/etc/init.d/
endef
define Package/morse_mesh11sd/conffiles
/etc/config/mesh11sd
endef
define Build/Compile
endef
$(eval $(call BuildPackage,morse_mesh11sd))

View File

@ -0,0 +1,28 @@
config mesh11sd 'setup'
option debuglevel '1'
option checkinterval '10'
option interface_timeout '10'
option enabled '0'
config mesh11sd 'mesh_params'
option mesh_fwding '1'
option mesh_max_peer_links '10'
option mesh_rssi_threshold '-85'
option mesh_ttl '31'
option mesh_hwmp_rootmode '0'
option mesh_gate_announcements '0'
config mesh11sd 'mbca'
option mbca_config '1'
option mesh_beacon_timing_report_int '10'
option mbss_start_scan_duration_ms '2048'
option mbca_min_beacon_gap_ms '25'
option mbca_tbtt_adj_interval_sec '60'
config mesh11sd 'mesh_beaconless'
option mesh_beacon_less_mode '0'
config mesh11sd 'mesh_dynamic_peering'
option enabled '0'
option mesh_rssi_margin '5'
option mesh_blacklist_timeout '60'

View File

@ -0,0 +1,16 @@
Index: mesh11sd-1.2.0/linux_openwrt/mesh11sd/files/etc/init.d/mesh11sd
===================================================================
--- mesh11sd-1.2.0.orig/linux_openwrt/mesh11sd/files/etc/init.d/mesh11sd
+++ mesh11sd-1.2.0/linux_openwrt/mesh11sd/files/etc/init.d/mesh11sd
@@ -11,3 +11,11 @@ start_service() {
procd_close_instance
}
+reload_service() {
+ wifi down
+ sleep 5
+ wifi up
+}
+service_triggers() {
+ procd_add_reload_trigger "mesh11sd"
+}

View File

@ -0,0 +1,107 @@
# Description: The Mesh11sd daemon expects the mesh interface name to follow the format 'mesh<index>'.
# If it doesn't find this format, it attempts to set it in the UCI wireless configuration.
# However, when operating in other modes such as AP, STA, or Ad-Hoc, the script was patched to remove
# the mesh interface name from UCI. This process can lead to a race condition between the UI and Mesh11sd,
# resulting in stale interface name values.
# This patch resolves the issue by removing the setting of the interface name from the script, as it is
# now managed through the UI, ensuring consistency and eliminating the race condition.
--- a/src/mesh11sd
+++ b/src/mesh11sd
@@ -387,45 +387,45 @@ elif [ "$1" = "daemon" ]; then
if [ $mode -eq 5 ]; then
# startup=4, statusmode=0, enabled=1
+ syslogmessage="mesh11sd v$version has started: mesh management mode $mode"
startup=0
statusmode=0
mode=1
- syslogmessage="mesh11sd v$version has started: mesh management mode $mode"
elif [ $mode -eq 4 ]; then
# startup=4, statusmode=0, enabled=0
+ syslogmessage="mesh11sd v$version has started: mesh status mode $mode"
startup=0
statusmode=2
mode=0
- syslogmessage="mesh11sd v$version has started: mesh status mode $mode"
elif [ $mode -eq 3 ]; then
# startup=0, statusmode=2, enabled=1
+ syslogmessage="mesh11sd v$version has started: mesh management mode $mode"
startup=0
statusmode=0
mode=1
- syslogmessage="mesh11sd v$version has started: mesh management mode $mode"
elif [ $mode -eq 2 ]; then
# startup=0, statusmode=2, enabled=0
+ syslogmessage="mesh11sd v$version has started: mesh status mode $mode"
startup=0
statusmode=2
mode=0
- syslogmessage="mesh11sd v$version has started: mesh status mode $mode"
elif [ $mode -eq 1 ]; then
# startup=0, statusmode=0, enabled=1
+ syslogmessage="mesh11sd v$version has started, mesh management mode $mode"
startup=0
statusmode=0
mode=1
- syslogmessage="mesh11sd v$version has started, mesh management mode $mode"
elif [ $mode -eq 0 ]; then
# startup=0, statusmode=0, enabled=0
+ syslogmessage="mesh11sd v$version has started: mesh status mode $mode"
startup=0
statusmode=2
mode=0
- syslogmessage="mesh11sd v$version has started: mesh status mode $mode"
fi
if [ $mode -ne $lastmode ]; then
@@ -441,26 +441,6 @@ elif [ "$1" = "daemon" ]; then
meshconfigs=$(uci show wireless 2> /dev/null | grep "mode='mesh'" | awk -F ".mode='mesh'" '{printf "%s " $1}')
if [ ! -z "$meshconfigs" ]; then
- for meshconfig in $meshconfigs; do
- ifname=$(uci get $meshconfig.ifname 2> /dev/null)
-
- if [ -z "$ifname" ] || [ "$ifname" != "mesh$meshindex" ]; then
- # No interface name in config, so add one
- ucibatch="set $meshconfig.ifname='mesh$meshindex'"
- echo "$ucibatch" | uci batch
- changed=1
- syslogmessage="Setting mesh interface name to [ mesh$meshindex ]"
- write_to_syslog
- fi
- meshindex=$(($meshindex+1))
- done
-
- if [ "$changed" -eq 1 ]; then
- changed=0
- restart_mesh
- continue
- fi
-
# get a list of interfaces
get_mesh_iflist
@@ -482,13 +462,13 @@ elif [ "$1" = "daemon" ]; then
# this is not a mesh interface
continue
else
- # Check if this interface has a uci ifname
- uciname=$(uci show wireless | grep "ifname='$iface'" | awk -F "." '{printf "wireless.%s" $2}')
+ # Check if this interface mode is 'mesh'
+ uciname=$(uci show wireless | grep "mode='mesh'" | awk -F "." '{printf "wireless.%s" $2}')
if [ -z "$uciname" ]; then
- # Error - No interface name in config, we should have added one
+ # Error - No interface with mode as mesh
debugtype="err"
- syslogmessage="Error getting mesh interface name"
+ syslogmessage="Error getting mesh interface section"
write_to_syslog
continue
fi