15
Onboarding with pWHM
Volodymyr Pavlenko edited this page 2025-08-28 19:06:23 +03:00
title
title
[DEPRECATED] Onboarding with pWHM

Note: For the boards with 3 radios, please use the image with pWHM that supports them.

[[TOC]]

Wired Onboarding

Controller(Gateway) configuration

  • Set the correct backhaul interface, and operating mode to Gateway:
uci set prplmesh.config.backhaul_wire_iface='wan'
uci set prplmesh.config.management_mode='Multi-AP-Controller-and-Agent'
uci set prplmesh.config.operating_mode='Gateway'
uci set prplmesh.config.master=1
uci set prplmesh.config.gateway=1
uci commit prplmesh
  • Reboot the board:
reboot

Agent(Repeater) configuration

  • Set the correct backhaul interface:
uci set prplmesh.config.backhaul_wire_iface='wan'
uci commit prplmesh
  • Move WAN interface to LAN bridge (br-lan):
ubus call "Bridging.Bridge" _del '{ "rel_path": ".[Alias == \"lan\"].Port.[Name == \"wan\"]." }'

ubus call "Bridging.Bridge" _get '{ "rel_path": ".[Alias == \"lan\"].Port.[Name == \"wan\"]." }' || {
    ubus call "Bridging.Bridge" _add '{ "rel_path": ".[Alias == \"lan\"].Port.",  "parameters": { "Name": "wan", "Alias": "WAN", "LowerLayers":"Device.Ethernet.Link.2." ,"Enable": true } }'
}
  • Reboot the board:
reboot

Wireless Onboarding

Controller(Gateway) configuration

  • Apply uci config to switch prplmesh to gateway mode :
uci set prplmesh.config.management_mode='Multi-AP-Controller-and-Agent'
uci set prplmesh.config.operating_mode='Gateway'
uci set prplmesh.config.master=1
uci set prplmesh.config.gateway=1
uci set prplmesh.config.wired_backhaul='0'
uci set prplmesh.config.backhaul_band='auto'
uci set prplmesh.config.backhaul_wire_iface='none'
uci commit prplmesh
  • Enable the radios:
ubus-cli "WiFi.Radio.*.Enable=1"
  • Enable the access points:
ubus-cli "WiFi.AccessPoint.*.Enable=1"
  • Pick an operating band that you want to use for the backhaul link {"2.4GHz", "5GHz", "6GHz"}. Based on your choice, identify the radio:
$ ubus-cli "WiFi.Radio.*.OperatingFrequencyBand?0"
> WiFi.Radio.*.OperatingFrequencyBand?0
WiFi.Radio.1.OperatingFrequencyBand="2.4GHz"
WiFi.Radio.2.OperatingFrequencyBand="6GHz"
WiFi.Radio.3.OperatingFrequencyBand="5GHz"

For 5GHz, I will now pick "WiFi.Radio.3."

  • Get "WiFi.Radio.3.Alias":
$ ubus-cli "WiFi.Radio.3.Alias?0"
> WiFi.Radio.3.Alias?0
WiFi.Radio.3.Alias="radio2"
  • Identify the subset of WiFi.AccessPoint. instances that can be used as backhaul BSS based on the chosen radio:
$ ubus-cli "WiFi.AccessPoint.*.RadioReference?0"
> WiFi.AccessPoint.*.RadioReference?0
WiFi.AccessPoint.1.RadioReference="WiFi.Radio.radio0"
WiFi.AccessPoint.2.RadioReference="WiFi.Radio.radio0"
WiFi.AccessPoint.3.RadioReference="WiFi.Radio.radio1"
WiFi.AccessPoint.4.RadioReference="WiFi.Radio.radio1"
WiFi.AccessPoint.5.RadioReference="WiFi.Radio.radio2"
WiFi.AccessPoint.6.RadioReference="WiFi.Radio.radio2"

Here we found AccessPoint.5. and AccessPoint.6

  • Make sure at least one AccessPoint has the MultiAPType of BackhaulBSS (copy "WiFi.Radio.radioX" from step above as rightValue for RadioReference== in the command below):
$ ubus-cli "WiFi.AccessPoint.[RadioReference=='WiFi.Radio.radio2'].MultiAPType?"
> WiFi.AccessPoint.[RadioReference=='WiFi.Radio.radio2'].MultiAPType?
WiFi.AccessPoint.5.MultiAPType="FronthaulBSS,BackhaulBSS"
WiFi.AccessPoint.6.MultiAPType=""

In this case, "WiFi.AccessPoint.5." has combined fronthaul and backhaul. If you want to use a dedicated instance for backhaul, you can configure as follows and use "WiFi.AccessPoint.6." Otherwise, do nothing and use "WiFi.AccessPoint.5."

ubus-cli "WiFi.AccessPoint.5.MultiAPType='FronthaulBSS'"
ubus-cli "WiFi.AccessPoint.6.MultiAPType='BackhaulBSS'"
  • Identify the "WiFi.SSID." that is used by the AccessPoint you will use as Backhaul (ex for "WiFi.AccessPoint.5.")
$ ubus-cli "WiFi.AccessPoint.5.SSIDReference?"
> WiFi.AccessPoint.5.SSIDReference?
WiFi.AccessPoint.5.SSIDReference="Device.WiFi.SSID.5"
  • Configure bridging:
ubus-cli "WiFi.AccessPoint.*.BridgeInterface='br-lan'"

this config goes in hapd.conf, and hostapd then automatically bridges wds interfaces to br-lan


Onboarding via credentials

Substitute "WiFi.SSID.5" and "WiFi.AccessPoint.5" with the numbers you picked above if needed

  • Configure the access point:
ubus call "WiFi.SSID.5" _set '{ "parameters": { "SSID": "prplmesh" } }'
ubus call "WiFi.AccessPoint.5.Security" _set '{ "parameters": { "KeyPassPhrase": "prplmesh_pass" } }'
ubus call "WiFi.AccessPoint.5.Security" _set '{ "parameters": { "ModeEnabled": "WPA2-Personal" } }'

  • Credentials are warm-apply parameters, some other configs as well. In order to account for cold-apply configs, reboot the board:
reboot

Agent(Repeater) configuration

  • Set prplMesh into the agent(Repeater) mode:
uci set prplmesh.config.management_mode='Multi-AP-Agent'
uci set prplmesh.config.operating_mode='WDS-Repeater'
uci set prplmesh.config.master=0
uci set prplmesh.config.gateway=0
  • Disable the wired backhaul:
uci set prplmesh.config.management_mode='Multi-AP-Agent'
uci set prplmesh.config.operating_mode='WDS-Repeater'
uci set prplmesh.config.master=0
uci set prplmesh.config.gateway=0
uci set prplmesh.config.wired_backhaul='0'
uci set prplmesh.config.backhaul_band='auto'
uci set prplmesh.config.backhaul_wire_iface='none'
uci commit prplmesh
  • Enable the radios: (STA_Mode and STASupported_Mode can be applied to the chosen radio only)
ubus-cli "WiFi.Radio.*.Enable=1"
ubus-cli "WiFi.Radio.*.STA_Mode=1"
ubus-cli "WiFi.Radio.3.STASupported_Mode=1"
  • Disable access points: (prplmesh agent does this before issuing a WPS command to the EndPoint. here we will issue the WPS command directly to pwhm, and we must manually disable APs):
ubus-cli "WiFi.AccessPoint.*.Enable=0"
  • Reboot the board:
reboot
  • Set the correct IP on the LAN bridge (it can be any IP from the 192.168.1.0/24 range if it is not already occupied by another device):
ubus call "IP.Interface.3.IPv4Address.1" _set '{ "parameters": { "IPAddress": "192.168.1.140" } }'

Onboarding via credentials

If the EndPoint already has an instance of Profile, use it; otherwise, create a new one:

$ ubus-cli "WiFi.EndPoint.1.Profile.+(Alias='testOnboarding')"
> WiFi.EndPoint.1.Profile.+(Alias='testOnboarding')
WiFi.EndPoint.1.Profile.1.
WiFi.EndPoint.1.Profile.1.Alias="testOnboarding"
  • Configure the endpoint:
ubus-cli "WiFi.EndPoint.1.ProfileReference=WiFi.EndPoint.1.Profile.1."
ubus-cli "WiFi.EndPoint.1.MultiAPEnable=1"
ubus-cli "WiFi.EndPoint.1.BridgeInterface='br-lan'"
ubus-cli "WiFi.EndPoint.1.Profile.1.Enable=1"
  • The values below should be the same as on controller:
ubus-cli "WiFi.EndPoint.1.Profile.1.SSID="prplmesh""
ubus-cli "WiFi.EndPoint.1.Profile.1.Security.KeyPassPhrase=prplmesh_pass"
ubus-cli "WiFi.EndPoint.1.Profile.1.Security.ModeEnabled=WPA2-Personal"

  • Reboot the board if you changed other parameters than credentials:
reboot

Check if the settings were preserved after reboot

After rebooting, please check brctl show on the agent side:

root@prplOS:/# brctl show

bridge name     bridge id               STP enabled     interfaces
br-lan          8000.521f00dbc416       no              wlan2.1
                                                        wlan0.2
                                                        wlan2
                                                        wlan0
                                                        lan2
                                                        wan
                                                        wlan1
                                                        lan3
                                                        lan1
br-guest                8000.521f00dcc419       no              wlan1.1
                                                        wlan0.1
br-lcm          8000.0a8e11229cce       no
  • If the wireless interface is not present in the bridge, then add it manually:
iw dev wlan0.2 set 4addr on
brctl addif br-lan wlan0.2
  • Check the operability of the controller:

Note: the script for checking the status can be broken. You can use ubus call X_PRPL-ORG_WiFiController.Network.Device _get to check the status. There should be a connected device (the controller itself).

service prplmesh status

enable: 1
management_mode: Multi-AP-Controller-and-Agent
operating_mode: Gateway
WLAN Ready
/opt/prplmesh/scripts/prplmesh_utils.sh: status
2691 beerocks_contro
2692 beerocks_agent
2992 beerocks_fronth
2997 beerocks_fronth
3002 beerocks_fronth
2691 beerocks_contro
executing operational test using bml
operational test success!
OK Main radio agent operational
OK wlan0 radio agent operational
OK wlan1 radio agent operational
OK wlan2 radio agent operational

If the controller is not operational, take a look at AP and Radio statuses. Fix them if needed.

  • Check the AP and Radio statuses on controller, on agent check Radio status only:
ubus-cli "WiFi.Radio.*.Status?"
ubus-cli "WiFi.AccessPoint.*.Status?"
ubus-cli "WiFi.Radio.*.Enable?"
ubus-cli "WiFi.Radio.*.STA_Mode?"  // repeater only
ubus-cli "WiFi.Radio.*.STASupported_Mode?" // repeater only
  • Check if the wired backhaul is disabled(Sometimes, this setting is enabled after reboot):
uci show prplmesh.config.wired_backhaul

prplmesh.config.wired_backhaul='0'

Trigger WPS session

  • Controller (substitute 5 with your index):
ubus-cli
WiFi.AccessPoint.5.WPS.InitiateWPSPBC()
  • Agent check WPS.Enable flag:
$ ubus-cli "WiFi.EndPoint.ep5g0.WPS.Enable?"
> WiFi.EndPoint.ep5g0.WPS.Enable?
WiFi.EndPoint.ep5g0.WPS.Enable=1

open ubus-cli and subscribe to WiFi.EndPoint.ep5g0. events:

$ ubus-cli
root - ubus: - [ubus-cli] (0)
 > WiFi.EndPoint.ep5g0.?&
Added subscription for WiFi.EndPoint.ep5g0.

finally, launch WPS in the same window:

> WiFi.EndPoint.ep5g0.WPS.pushButton()

After triggering the WPS, please, wait for 15-20 seconds, and the boards should connect. You will observe a pairingDone event in ubus-cli on agent console. Alternatively, grep WPS-CRED-RECEIVED /var/log/messages on agent.

We can check that in logs on agent side:

grep FSM: /tmp/beerocks/logs/beerocks_backhaul.log

TRACE 15:29:23:367 <547870972648> backhaul_manager.cpp[686] --> FSM: INIT --> WAIT_ENABLE
TRACE 15:29:28:068 <547870972648> backhaul_manager.cpp[1597] --> FSM: WAIT_ENABLE --> ENABLED
TRACE 15:29:28:265 <547870972648> backhaul_manager.cpp[788] --> FSM: ENABLED --> INIT_HAL
TRACE 15:29:28:266 <547870972648> backhaul_manager.cpp[957] --> FSM: INIT_HAL --> WPA_ATTACH
TRACE 15:29:28:329 <547870972648> backhaul_manager.cpp[1142] --> FSM: WPA_ATTACH --> WAIT_WPS
TRACE 15:29:31:365 <547870972648> backhaul_manager.cpp[1974] --> FSM: WAIT_WPS --> CONNECTED
TRACE 15:29:31:721 <547870972648> backhaul_manager.cpp[841] --> FSM: CONNECTED --> OPERATIONAL

Check the onboarding

  • Agent side:
grep -ri "Link to the" /tmp/beerocks/logs/

/tmp/beerocks/logs/beerocks_agent.log:DEBUG 15:29:44:967 <beerocks_agent> ap_autoconfiguration_task.cpp[187] --> Link to the controller is established
/tmp/beerocks/logs/beerocks_agent.20230901_152922.log:DEBUG 15:29:44:967 <beerocks_agent> ap_autoconfiguration_task.cpp[187] --> Link to the controller is established
  • Controller side:
ubus call X_PRPL-ORG_WiFiController.Network.Device _get

{
        "Device.WiFi.DataElements.Network.Device.2.": {
                "MultiAPProfile": 3,
                "MaxReportingRate": 30,
                "CollectionInterval": 60000,
                "SPRuleNumberOfEntries": 0,
                "DSCPMap": "",
                "RadioNumberOfEntries": 3,
                "MaxPrioritizationRules": 1,
                "SoftwareVersion": "4.1.0",
                "ManufacturerModel": "prpl Foundation Haze",
                "ExecutionEnv": "OpenWrt 22.03-SNAPSHOT",
                "ReportUnsuccessfulAssociations": true,
                "MaxVIDs": 48,
                "InterfaceNumberOfEntries": 7,
                "CountryCode": "US",
                "CACStatusNumberOfEntries": 1,
                "SerialNumber": "prplmesh12345",
                "ID": "2e:64:3e:c0:5d:2c",                        <<< agent`s br-lan MAC
                "PrioritizationSupport": true,
                "BTMSteeringDisallowedSTAListNumberOfEntries": 0,
                "Manufacturer": "prpl",
                "LocalSteeringDisallowedSTANumberOfEntries": 0,
                "SupportsVBSS": false,
                "APMetricsReportingInterval": 60
        },