Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Setup mysql in BPI controller (One time process)
    Panel
    borderColorblack
    borderStyledashed
    titleDB Setup

    → Input command mysql in prompt, enter into mariadb console and execute the below commands


    CREATE USER 'bpi'@'localhost' IDENTIFIED BY 'root';
    ALTER USER 'bpi'@'localhost' IDENTIFIED BY 'root';
    GRANT ALL PRIVILEGES ON *.* TO 'bpi'@'localhost' IDENTIFIED BY 'root';
    FLUSH PRIVILEGES;
    SELECT User, Host, plugin FROM mysql.user;


    → Exit from mysql

  2. Once user is added in mysql, enter into prompt with root access.
    Panel
    borderColorblack
    borderStyledashed
    titlebpi root

    → Input command mysql -u bpi -p, password is root

  3. Create OneWifiMesh table in mariadb
    Panel
    borderColorblack
    borderStyledashed
    titleCreating database

    create database OneWifiMesh;
    → use OneWifiMesh;
    → show tables;                   ==> should show no tables

      
  4. Please have below files content in /nvram folder,            /EasymeshCfg.json.
Code Block
languagebash
titleEasymeshCfg.json
collapsetrue
cat EasymeshCfg.json 
{
	"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

Code Block
languagebash
titleEasymeshCfg.json
collapsetrue


cat 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

path : /usr/ccsp/wifi

Code Block
languagebash
titleonewifi_pre_script_ctrl
collapsetrue
cat onewifi_pre_start.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.

Code Block
languagebash
 rm /opt/secure/wifi/*

...


8. Restart OneWifi to take effect.

Code Block
languagebash
titleRestart services
systemctl restart onewifi

9. EM-Controller can be executed manually in new tab.

Code Block
languagebash
titleRunning EM-Controller
cd /usr/ccsp/EasyMesh/
onewifi_em_ctrl bpi@root

NOTE: Controller log for the first time.

Code Block
languagebash
titleController log
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. To reset database, start onewifi_em_cli (CLI) in a new tab.

 

To restart onewifi - systemctl restart onewifi

To run ctrl - systemctl start em_ctrl   

Note -  ctrl logs will be stored in /tmp/em_ctrl.log

Initial step to do for ctrl -
Reset database, resetting can be done from cli (see log: data base empty ... needs reset)
     

Start onewifi easymesh cli in a new tab

brlan0 should have unique mac address before setting for AL MAC address.

/usr/ccsp/EasyMesh# onewifi_em_cli bpi

Panel
borderColorblack
borderStyledashed
titleonewifi_em_cli bpi

/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
→ Select "Wifi Reset" and then select Update to update the window.
→ In the CollocatedAgentID update the Mac address of the brlan0(a2:f0:d1:69:f5:ae) which needs to be treated as AL MAC. In case of using wireless backhaul, use the appropriate "wlan" interface as CollocatedAgentID.
→ Select Apply to reset the database.

Sample cli response CLI screenshots given below:.

Change colocatedAgentID mac addr to interface which needs to be treated as AL MAC


11. Once AL MAC is set check the ctrl prompt whether database reset happened

Observe outputs deleting all datamodels and database insert to verify successful reset
Sample response in ctrl: 
Image Modified
Response in database: Respective rows will be updated in db
Image Modified

  Run local Agent with below cmd, (this step is not mandatory)

...