Goal of this document helps RDK-B community to Port Unified-easy-mesh on to their Gateway/Extender platforms
Controller | Agent |
---|---|
Banana Pi R4(RDK-B) | Banana Pi R4(RDK-B) |
Banana Pi R4(RDK-B) | RPI4(Raspbian) |
RPI4(Raspbian) | Banana Pi R4(RDK-B) |
<<OneWifiMeshCli>>: reset erouter0 bananapi encode_config_reset:354: {
(gdb) bt #0 0x0000000000417fb8 in em_cmd_t::init (this=this@entry=0x7f8b4b7010, dm=dm@entry=0x7f8b7fe690) at ../../../git/src/ctrl/../../src/cmd/em_cmd.cpp:127 #1 0x0000000000418764 in em_cmd_t::em_cmd_t (this=0x7f8b4b7010, type=em_cmd_type_reset, param=<error reading variable: Cannot access memory at address 0x7ffc9a6470>, dm=...) at ../../../git/src/ctrl/../../src/cmd/em_cmd.cpp:703 Backtrace stopped: Cannot access memory at address 0x7ffc9a63f8
repo init -u https://code.rdkcentral.com/r/manifests -b kirkstone -m rdkb-bpi-extsrc.xml repo sync -j`nproc` --no-clone-bundle MACHINE=bananapi4-rdk-broadband FEATURE_TYPE=EasyMesh source meta-cmf-bananapi/setup-environment-refboard-rdkb bitbake rdk-generic-broadband-image |
Prerequisites : (one time process)
→ Input command mysql in prompt, enter into mariadb console and execute the below commands
|
→ Input command mysql -u bpi -p, password is root |
→ create database OneWifiMesh; |
{ "AL_MAC_ADDR": "a2:f0:d1:69:f5:ae", "Colocated_mode": 1, "Backhaul_SSID": "mesh_backhaul", "Backhaul_KeyPassphrase": "test-backhaul", "sta_4addr_mode_enabled": true } |
5. Please have below content in /nvram/InterfaceMap.json
{ "PhyList": [ { "Index": 0, "RadioList": [ { "Index": 2, "RadioName": "wifi2", "InterfaceList": [ { "InterfaceName": "wifi2", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 3, "vapName": "private_ssid_6g" } ] }, { "Index": 1, "RadioName": "wifi1", "InterfaceList": [ { "InterfaceName": "wifi1.1", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 2, "vapName": "mesh_backhaul_5g" }, { "InterfaceName": "wifi1", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 1, "vapName": "private_ssid_5g" } ] }, { "Index": 0, "RadioName": "wifi0", "InterfaceList": [ { "InterfaceName": "wifi0", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 0, "vapName": "private_ssid_2g" } ] } ] } ] } |
6. Please have below content in /usr/ccsp/wifi/onewifi_pre_script.sh
#!/bin/sh sleep 5 #To update al_mac_addr in EasyMeshCfg.json to avoid onewifi restarting during fresh boot-up #wan_mac="$(cat /sys/class/ieee80211/phy0/macaddress)" old_al_mac_addr=`cat /nvram/EasymeshCfg.json | grep AL_MAC_ADDR | cut -d '"' -f4` #if [ "$old_al_mac_addr" == "00:00:00:00:00:00" ]; then # sed -i "s/$old_al_mac_addr/$wan_mac/g" /nvram/EasymeshCfg.json #fi ip link set dev brlan0 down brlan_mac=`ifconfig brlan0 | grep HWaddr | cut -d " " -f9` mac_addr=$(echo $brlan_mac | tr -d ':') mac_increment=$((0x$mac_addr + 1)) brlan_inc_mac=$(printf "%012x" $mac_increment | sed 's/../&:/g;s/:$//') ip link set dev brlan0 address a2:f0:d1:69:f5:ae #ip link set dev brlan0 address $brlan_inc_mac sleep 1 ip link set dev brlan0 up #sed -i "s/$old_al_mac_addr/$brlan_inc_mac/g" /nvram/EasymeshCfg.json iw phy phy0 interface add wifi0 type __ap iw phy phy0 interface add wifi1 type __ap iw phy phy0 interface add wifi1.1 type __ap iw phy phy0 interface add wifi2 type __ap #iw phy phy0 interface add wifi2.1 type __ap #Obtain the wifi0 mac address wifi0_mac="$(cat /sys/class/ieee80211/phy0/macaddress)" #Strip the : and increment mac by 1 to get wifi1 macaddress mac=$(echo $wifi0_mac | tr -d ':') mac_incr=$((0x$mac + 2)) wifi1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') mac_incr=$(($mac_incr + 2)) wifi1_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') #Increment again by 1 to get wifi2 address mac_incr=$(($mac_incr + 2)) wifi2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') mac_incr=$(($mac_incr + 2)) wifi2_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') #print the mac address echo $wifi0_mac echo $wifi1_mac echo $wifi2_mac #Update the mac address using ip link command ifconfig wifi0 down ifconfig wifi1 down ifconfig wifi1.1 down ifconfig wifi2 down ifconfig wifi2.1 down ip link set dev wifi0 address $wifi0_mac ip link set dev wifi1 address $wifi1_mac ip link set dev wifi1.1 address $wifi1_1_mac ip link set dev wifi2 address $wifi2_mac ip link set dev wifi2.1 address $wifi2_1_mac ifconfig wifi0 up ifconfig wifi1 up ifconfig wifi1.1 up ifconfig wifi2 up ifconfig wifi2.1 up exit 0 |
7. Remove wifidb to be on safer side.
rm /opt/secure/wifi/* |
8. Restart OneWifi to take effect.
systemctl restart onewifi |
9. EM-Controller can be executed manually in new tab.
cd /usr/ccsp/EasyMesh/ onewifi_em_ctrl bpi@root |
NOTE: Controller log for the first time.
root@Filogic-GW:/usr/ccsp/EasyMesh# onewifi_em_ctrl bpi@root connect:169: user:bpi pass:root load_tables:1558: data base empty ... needs reset init:1958: Load operation failed, err: dm_orch_type_unknown data_model_init:541: data model init failed mgr_input_listen:290 Thread stack size = 8388608 bytes execute:56: Controller communication path: /tmp/onewifi_mesh_ctrl mgr_nodes_listen:422 Thread stack size = 8388608 bytes |
10. Start onewifi_em_cli in a new tab.
Reset database like below.
/usr/ccsp/EasyMesh# onewifi_em_cli bpi → In the cli use "Tab" to move between Update, Apply and Cancel button in the cli, use keys "j" and "k" to scroll up and down |
Change colocatedAgentID with brlan0 MAC address which needs to be treated as AL MAC
CLI screenshots given below.
11. Once AL MAC is set with brlan0 MAC address, check the ctrl prompt for database reset.
Sample log from EM-Controller
root@Filogic-GW:/usr/ccsp/EasyMesh# onewifi_em_ctrl bpi@root connect:169: user:bpi pass:root load_tables:1558: data base empty ... needs reset init:1958: Load operation failed, err: dm_orch_type_unknown data_model_init:541: data model init failed mgr_input_listen:290 Thread stack size = 8388608 bytes execute:56: Controller communication path: /tmp/onewifi_mesh_ctrl mgr_nodes_listen:422 Thread stack size = 8388608 bytes pre_process_orch_op:342: Deleting all data models dm_network_list_t:update_db:167: Operation: dm_orch_type_db_insert create_data_model:1502: Created data model for net_id: OneWifiMesh mac: a2:f0:d1:69:f5:ae, coloc:1 create_data_model:1522: Number of policies: 6 create_data_model:1539: Putting data model at key: OneWifiMesh@a2:f0:d1:69:f5:ae start_complete:847 Collocated agent ID: a2:f0:d1:69:f5:ae publish fail init_network_topology:1925: Root: a2:f0:d1:69:f5:ae added to network topology update_tables:1721: Op Class[0] ruid: a2:f0:d1:69:f5:ae Type: 7 Class: 81 update_tables:1721: Op Class[1] ruid: a2:f0:d1:69:f5:ae Type: 7 Class: 115 update_tables:1721: Op Class[2] ruid: a2:f0:d1:69:f5:ae Type: 7 Class: 135 update_tables:1721: Op Class[3] ruid: a2:f0:d1:69:f5:ae Type: 8 Class: 81 update_tables:1721: Op Class[4] ruid: a2:f0:d1:69:f5:ae Type: 8 Class: 115 update_tables:1721: Op Class[5] ruid: a2:f0:d1:69:f5:ae Type: 8 Class: 135 analyze_config_renew:98: Radio: 00:00:00:00:00:00 ../../../git/src/ctrl/../../src/dm/dm_network_ssid.cpp:205:85: runtime error: load of value 50462976, which is not a valid value for type 'em_haul_type_t' ../../../git/src/ctrl/../../src/dm/dm_network_ssid.cpp:200:71: runtime error: load of value 48, which is not a valid value for type 'bool' |
Screenshot from database: Respective rows are updated in db
12. Run local Agent manually with below command in new tab.
cd /usr/ccsp/EasyMesh/ onewifi_em_agent |
Workaround: Initially, EM-Agent and EM-Contrller processes will not be in sync . Need to do restart the both EM-Agent and EM-Controller processes for 1st time alone.
killall onewifi_em_agent killall onewifi_em_ctrl |
Re-run EM-Controller in controller tab.
Re-run EM-Agent in Agent tab.
Observation in EM-Contrller device side:
Prerequisites - One Time Process
rm /usr/bin/dnsmasq |
2. Remove default gw entry from routing table since WAN access will be through backhaul connection.
route del default gw |
3. Copy below content to /nvram/EasymeshCfg.json file.
{ "AL_MAC_ADDR": "00:0c:43:26:60:1b", "Colocated_mode": 0, "Backhaul_SSID": "mesh_backhaul", "Backhaul_KeyPassphrase": "test-backhaul", "sta_4addr_mode_enabled": true } |
4. Copy below content to /nvram/InterfaceMap.json file.
{ "PhyList": [ { "Index": 0, "RadioList": [ { "Index": 2, "RadioName": "wifi2", "InterfaceList": [ { "InterfaceName": "wifi2", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 4, "vapName": "private_ssid_6g" } ] }, { "Index": 1, "RadioName": "wifi1", "InterfaceList": [ { "InterfaceName": "wifi1.1", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 3, "vapName": "mesh_sta_5g" }, { "InterfaceName": "wifi1", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 2, "vapName": "private_ssid_5g" } ] }, { "Index": 0, "RadioName": "wifi0", "InterfaceList": [ { "InterfaceName": "wifi0.1", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 1, "vapName": "mesh_backhaul_2g" }, { "InterfaceName": "wifi0", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 0, "vapName": "private_ssid_2g" } ] } ] } ] } |
5. Copy below content to /usr/ccsp/wifi/onewifi_pre_script.sh.
#!/bin/sh sleep 5 #To update al_mac_addr in EasyMeshCfg.json to avoid onewifi restarting during fresh boot-up #wan_mac="$(cat /sys/class/ieee80211/phy0/macaddress)" #old_al_mac_addr=`cat /nvram/EasymeshCfg.json | grep AL_MAC_ADDR | cut -d '"' -f4` #if [ "$old_al_mac_addr" == "00:00:00:00:00:00" ]; then # sed -i "s/$old_al_mac_addr/$wan_mac/g" /nvram/EasymeshCfg.json #fi iw phy phy0 interface add wifi0 type __ap iw phy phy0 interface add wifi0.1 type __ap iw phy phy0 interface add wifi1 type __ap iw phy phy0 interface add wifi2 type __ap iw phy phy0 interface add wifi1.1 type __ap #iw phy phy0 interface add wifi2.1 type __ap #Obtain the wifi0 mac address wifi_mac="$(cat /sys/class/ieee80211/phy0/macaddress)" #Strip the : and increment mac by 1 to get wifi1 macaddress mac=$(echo $wifi_mac | tr -d ':') mac_incr=$((0x$mac + 8)) wifi0_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') #Increment again by 1 to get wifi2 address mac_incr=$(($mac_incr + 1)) wifi0_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') #Increment again by 1 to get wifi2 address mac_incr=$(($mac_incr + 1)) wifi1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') mac_incr=$(($mac_incr + 1)) wifi1_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') mac_incr=$(($mac_incr + 1)) wifi2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') #print the mac address echo $wifi0_mac echo $wifi1_mac echo $wifi2_mac #Update the mac address using ip link command ifconfig wifi0 down ifconfig wifi0.1 down ifconfig wifi1 down ifconfig wifi1.1 down ifconfig wifi2 down ip link set dev wifi0 address $wifi0_mac ip link set dev wifi0.1 address $wifi0_1_mac ip link set dev wifi1 address $wifi1_mac ip link set dev wifi1.1 address $wifi1_1_mac ip link set dev wifi2 address $wifi2_mac ifconfig wifi0 up ifconfig wifi1 up ifconfig wifi1.1 up ifconfig wifi2 up exit 0 |
6. Remove default onewifi db from /opt/secure/wifi to be on safer side.
rm /opt/secure/wifi/*.db |
7. Restart OneWifi
systemctl restart onewifi |
8. Ensure mesh backhaul connectivity is established over 5G through wifi1.1 interface.
iw dev wifi1.1 info |
9. Verify mesh backhaul connection in EM-Contrller side as well.
iw dev wifi1.1.sta info iw dev wifi1.1.sta station dump ## This command gives information on connected client ie Extender1. |
10. Upon successful backhaul connectivity, run EM-Agent in Extender1 in new tab.
cd /usr/ccsp/EasyMesh/ onewifi_em_agent |
11. Wait for few minutes( for Agent to propagate SSID information from Controller to OneWifi in Extender1) and then check
12. Set static IP for brlan0 interface in Extender1
ifconfig brlan0 10.0.0.215 netmask 255.255.255.0 up |
13. Test the connectivity to EM-Controller through backhaul
ping 10.0.0.1 -c 5 |
Prerequisites - One Time Process
rm /usr/bin/dnsmasq |
2. Remove default gw entry from routing table since WAN access will be through backhaul connection.
route del default gw |
3. Copy below content to /nvram/EasymeshCfg.json file.
{ "AL_MAC_ADDR": "00:0c:43:26:60:21", "Colocated_mode": 0, "Backhaul_SSID": "mesh_backhaul", "Backhaul_KeyPassphrase": "test-backhaul", "sta_4addr_mode_enabled": true } |
4. Copy below content to /nvram/InterfaceMap.json file.
{ "PhyList": [ { "Index": 0, "RadioList": [ { "Index": 2, "RadioName": "wifi2", "InterfaceList": [ { "InterfaceName": "wifi2", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 3, "vapName": "private_ssid_6g" } ] }, { "Index": 1, "RadioName": "wifi1", "InterfaceList": [ { "InterfaceName": "wifi1", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 2, "vapName": "private_ssid_5g" } ] }, { "Index": 0, "RadioName": "wifi0", "InterfaceList": [ { "InterfaceName": "wifi0.1", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 1, "vapName": "mesh_sta_2g" }, { "InterfaceName": "wifi0", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 0, "vapName": "private_ssid_2g" } ] } ] } ] } |
5. Copy below content to /usr/ccsp/wifi/onewifi_pre_script.sh.
#!/bin/sh sleep 5 #To update al_mac_addr in EasyMeshCfg.json to avoid onewifi restarting during fresh boot-up #wan_mac="$(cat /sys/class/ieee80211/phy0/macaddress)" #old_al_mac_addr=`cat /nvram/EasymeshCfg.json | grep AL_MAC_ADDR | cut -d '"' -f4` #if [ "$old_al_mac_addr" == "00:00:00:00:00:00" ]; then # sed -i "s/$old_al_mac_addr/$wan_mac/g" /nvram/EasymeshCfg.json #fi iw phy phy0 interface add wifi0 type __ap iw phy phy0 interface add wifi0.1 type __ap iw phy phy0 interface add wifi1 type __ap iw phy phy0 interface add wifi2 type __ap #Obtain the wifi0 mac address wifi_mac="$(cat /sys/class/ieee80211/phy0/macaddress)" #Strip the : and increment mac by 1 to get wifi1 macaddress mac=$(echo $wifi_mac | tr -d ':') mac_incr=$((0x$mac + 16)) wifi0_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') mac_incr=$(($mac_incr + 1)) wifi0_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') mac_incr=$(($mac_incr + 1)) wifi1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') #Increment again by 1 to get wifi2 address mac_incr=$(($mac_incr + 1)) wifi2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') #print the mac address echo $wifi0_mac echo $wifi0_1_mac echo $wifi1_mac echo $wifi2_mac #Update the mac address using ip link command ifconfig wifi0 down ifconfig wifi0.1 down ifconfig wifi1 down ifconfig wifi2 down ip link set dev wifi0 address $wifi0_mac ip link set dev wifi0.1 address $wifi0_1_mac ip link set dev wifi1 address $wifi1_mac ip link set dev wifi2 address $wifi2_mac ifconfig wifi0 up ifconfig wifi1 up ifconfig wifi2 up exit 0 |
6. Remove default onewifi db from /opt/secure/wifi to be on safer side.
rm /opt/secure/wifi/*.db |
7. Restart OneWifi
systemctl restart onewifi |
8. Ensure mesh backhaul connectivity is established over 2.4G through wifi0.1 interface.
iw dev wifi0.1 info |
9. Verify mesh backhaul connection in Extender1 side as well.
iw dev wifi0.1.sta info iw dev wifi0.1.sta station dump ## This command gives information on connected client ie Extender2. |
10. Upon successful backhaul connectivity, run EM-Agent in Extender2 in new tab.
cd /usr/ccsp/EasyMesh/ onewifi_em_agent |
11. Wait for few minutes( for Agent to propagate SSID information from Controller to OneWifi in Extender2) and then check
12. Set static IP for brlan0 interface in Extender2
ifconfig brlan0 10.0.0.210 netmask 255.255.255.0 up |
13. Test the connectivity to EM-Controller through backhaul
ping 10.0.0.1 -c 5 |
Test the wireless client connectivity
Prerequisites - One Time Process
rm /usr/bin/dnsmasq |
2. Remove default gw entry from routing table since WAN access will be through backhaul connection.
route del default gw |
3. Copy below content to /nvram/EasymeshCfg.json file.
{ "AL_MAC_ADDR": "00:0c:43:26:60:2a", "Colocated_mode": 0, "Backhaul_SSID": "mesh_backhaul", "Backhaul_KeyPassphrase": "test-backhaul", "sta_4addr_mode_enabled": true } |
4. Copy below content to /nvram/InterfaceMap.json file.
{ "PhyList": [ { "Index": 0, "RadioList": [ { "Index": 2, "RadioName": "wifi2", "InterfaceList": [ { "InterfaceName": "wifi2", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 3, "vapName": "private_ssid_6g" } ] }, { "Index": 1, "RadioName": "wifi1", "InterfaceList": [ { "InterfaceName": "wifi1.1", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 2, "vapName": "mesh_sta_5g" }, { "InterfaceName": "wifi1", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 1, "vapName": "private_ssid_5g" } ] }, { "Index": 0, "RadioName": "wifi0", "InterfaceList": [ { "InterfaceName": "wifi0", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 0, "vapName": "private_ssid_2g" } ] } ] } ] } |
5. Copy below content to /usr/ccsp/wifi/onewifi_pre_script.sh.
#!/bin/sh sleep 5 iw phy phy0 interface add wifi0 type __ap iw phy phy0 interface add wifi1 type __ap iw phy phy0 interface add wifi2 type __ap iw phy phy0 interface add wifi1.1 type __ap #Obtain the wifi0 mac address wifi_mac="$(cat /sys/class/ieee80211/phy0/macaddress)" #Strip the : and increment mac by 1 to get wifi1 macaddress mac=$(echo $wifi_mac | tr -d ':') mac_incr=$((0x$mac + 24)) wifi0_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') #Increment again by 1 to get wifi2 address mac_incr=$(($mac_incr + 1)) wifi1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') mac_incr=$(($mac_incr + 1)) wifi1_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') mac_incr=$(($mac_incr + 1)) wifi2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') #print the mac address echo $wifi0_mac echo $wifi1_mac echo $wifi2_mac #Update the mac address using ip link command ifconfig wifi0 down ifconfig wifi1 down ifconfig wifi1.1 down ifconfig wifi2 down ip link set dev wifi0 address $wifi0_mac ip link set dev wifi1 address $wifi1_mac ip link set dev wifi1.1 address $wifi1_1_mac ip link set dev wifi2 address $wifi2_mac ifconfig wifi0 up ifconfig wifi1 up ifconfig wifi1.1 up ifconfig wifi2 up exit 0 |
6. Remove default onewifi db from /opt/secure/wifi to be on safer side.
rm /opt/secure/wifi/*.db |
7. Restart OneWifi
systemctl restart onewifi |
8. Ensure mesh backhaul connectivity is established over 5G through wifi1.1 interface.
iw dev wifi1.1 info |
9. Verify mesh backhaul connection in EM-Controller side as well.
iw dev wifi1.1.sta2 info iw dev wifi1.1.sta2 station dump ## This command gives information on connected client ie Extender2. |
10. Upon successful backhaul connectivity, run EM-Agent in Extender2 in new tab.
cd /usr/ccsp/EasyMesh/ onewifi_em_agent |
11. Wait for few minutes( for Agent to propagate SSID information from Controller to OneWifi in Extender2) and then check
12. Set static IP for brlan0 interface in Extender2
ifconfig brlan0 10.0.0.205 netmask 255.255.255.0 up |
13. Test the connectivity to EM-Controller through backhaul
ping 10.0.0.1 -c 5 |
Test the connected clients
Create following file to get onewifi debug and info logs and check corresponding files in /tmp folder.
touch /nvram/wifiHalDbg touch /nvram/wifiCtrlDbg touch /nvram/wifiMgrDbg touch /nvram/wifiLibhostapDbg touch /nvram/wifiWebConfigDbg touch /nvram/wifiPasspointDbg touch /nvram/wifiDMCLI touch /nvram/wifiDbDbg touch /nvram/wifiPsm touch /nvram/wifiHalStatsDbg |