...
Setup EM on BPI R4
Note: Currently in our bpi build private vaps configured.
BPI Controller
- Setup mysql in BPI controller (One time process)
Panel |
---|
borderColor | black |
---|
borderStyle | dashed |
---|
title | DB Setup |
---|
|
→ Input command mysql in prompt, enter into mariadb console → 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 |
- Once user is added in mysql, enter into prompt with root access.
Panel |
---|
borderColor | black |
---|
borderStyle | dashed |
---|
title | bpi root |
---|
|
→ Input command mysql -u bpi -p, password is root |
- Create OneWifiMesh table in mariadb
Panel |
---|
borderColor | black |
---|
borderStyle | dashed |
---|
title | Creating database |
---|
|
→ create database OneWifiMesh; → use OneWifiMesh; → show tables; ==> should show no tables
|
- Start onewifi easymesh controller in new tab
/usr/ccsp/EasyMesh# ./onewifi_em_ctrl bpi@root (Here bpi is the user and root is the password)

Reset database, resetting can be done from cli (see log: data base empty ... needs reset) - Start onewifi easymesh cli in a new tab
/usr/ccsp/EasyMesh# ./onewifi_em_cli bpi
Panel |
---|
borderColor | black |
---|
borderStyle | dashed |
---|
title | onewifi_em_cli bpi |
---|
|
→ In the cli use "Tab" to move between Update, Apply and Cancel button in the cli, use keys "j" to scroll down and "k" to scroll up the menu.and down → Select "Wifi Reset" and then select Update to update the window. → In the CollocatedAgentID update the Mac address of the interface 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 given below:




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


- 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:

Response in database: Respective rows will be updated in db

- Restart onewifi_em_ctrl
Observe private_ssid are broadcasting

- asaAfter restart run the agent
BPI Agent
- OneWifi should be up and running
Update onewifi_pre_script.sh under /usr/ccsp/wifi/
Code Block |
---|
title | onewifi_pre_start.sh |
---|
collapse | true |
---|
|
#!/bin/sh
sleep 10
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 wifi3 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 + 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/:$//')
mac_incr=$(($mac_incr + 1))
wifi3_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
mac_incr=$(($mac_incr + 1))
wifi4_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
mac_incr=$(($mac_incr + 1))
wifi5_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
mac_incr=$(($mac_incr + 1))
wifi6_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
mac_incr=$(($mac_incr + 1))
wifi7_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
#print the mac address
echo $wifi0_mac
echo $wifi1_mac
echo $wifi2_mac
echo $wifi3_mac
echo $wifi4_mac
#Update the mac address using ip link command
ifconfig wifi0 down
ifconfig wifi1 down
ifconfig wifi2 down
ifconfig wifi3 down
ifconfig wifi4 down
ifconfig wifi5 down
ifconfig wifi6 down
ifconfig wifi7 down
ip link set dev wifi0 address $wifi0_mac
ip link set dev wifi1 address $wifi3_mac
ip link set dev wifi2 address $wifi2_mac
ip link set dev wifi3 address $wifi3_mac
ip link set dev wifi4 address $wifi4_mac
ifconfig wifi0 up
ifconfig wifi1 up
ifconfig wifi2 up
ifconfig wifi3 up
ifconfig wifi4 up
exit 0 |
Update InterfaceMap.json under /nvram/
Code Block |
---|
title | InterfaceMap.json |
---|
collapse | true |
---|
|
{
"PhyList": [
{
"Index": 0,
"RadioList": [
{
"Index": 1,
"RadioName": "wifi1",
"InterfaceList": [
{
"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"
}
]
}
]
}
]
} |
- In /nvram/EasyMesh.json update CollocatedAgentID Mac address for the In /nvram/EasyMesh.json update CollocatedAgentID Mac address forthe interface which needs to be treated as AL MAC
Sample response:

- Start onewifi easymesh agent
Panel |
---|
borderColor | black |
---|
borderStyle | dashed |
---|
title | sample response |
---|
|
/usr/ccsp/EasyMesh#./onewifi_em_agent input_listener:646 he_bus open success input_listener:664 recv data: { "Version": "1.0", "SubDocName": "dml", "WifiConfig": { "GASConfig": { "AdvertisementId": 0, "PauseForServerResp": true, "RespTimeout": 5000, "ComebackDelay": 1000, "RespBufferTime": 1000, "QueryRespLengthLimit": 127 }, |
- Check whether agent window receives subdoc decode success
- Check whether AP acquired private_ssid through backhaul

...