...
9. copy below contents to /usr/ccsp/EasyMesh/setup_ext_pre.sh and file permission should be 755
Code Block |
---|
language | bash |
---|
title | setup_ext_pre |
---|
collapse | true |
---|
|
#!/bin/sh
#Ensure onewifi is up and running
while [ ! -e /tmp/wifi_initialized ] && [ ! -e /tmp/wifi_dml_complete ] ;
do
sleep 1;
done
#Ensure backhaul connectivity is established
al_mac_addr=`cat /nvram/EasymeshCfg.json | grep AL_MAC_ADDR | cut -d '"' -f4`
channel_exists=`iw dev | grep $al_mac_addr -A 4 | grep channel | wc -l`
ssid_exists=`iw dev | grep $al_mac_addr -A 4 | grep ssid | wc -l`
while [ "$channel_exists" != 1 ] && [ "$ssid_exists" != 1 ] ;
do
sleep 1;
channel_exists=`iw dev | grep $al_mac_addr -A 4 | grep channel | wc -l`
ssid_exists=`iw dev | grep $al_mac_addr -A 4 | grep ssid | wc -l`
done
|
...
Code Block |
---|
language | bash |
---|
title | Extender2 onewifi_pre_script.sh |
---|
collapse | true |
---|
|
#!/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.the below files from
Code Block |
---|
|
rmcd /etc/optsystemd/securesystem/wifi/*.db |
7. Restart OneWifi
Code Block |
---|
|
systemctl restart onewifi |
multi-user.target.wants/
rm ieee1905_em_ctrl.service
rm em_ctrl |
7. copy below contents to /lib/systemd/system/ieee1905_em_agent.service8. Ensure mesh backhaul connectivity is established over 2.4G through wifi0.1 interface.
Code Block |
---|
|
iw dev wifi0.1 info |
9. Verify mesh backhaul connection in Extender1 side as well.
Code Block |
---|
|
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.
title | Ext2 ieee1905_em_agent |
---|
collapse | true |
---|
|
[Unit]
Description=ieee1905 EasyMesh Remote Agent service
After=onewifi.service
[Service]
Type=forking
WorkingDirectory=/usr/ccsp/EasyMesh
ExecStartPre=/bin/sh -c ' |
Code Block |
---|
language | bash |
---|
title | Extender2 Agent |
---|
|
cd /usr/ccsp/EasyMesh/
onewifisetup_em_agentext_pre.sh'
ExecStartPre=/bin/sh -c 'if [ ! -e "/sys/class/net/eth1_virt_peer/address" ]; then `/usr/ccsp/EasyMesh/setup_veth_for_em.sh brlan0 eth1 false`;fi'
ExecStartPre=/bin/sh -c 'sleep 5'
ExecStart=/bin/sh -c '/usr/bin/ieee1905 -f ieee1905::al_sap=trace,ieee1905::cmdu_handler=trace,ieee1905::cmdu_proxy=trace,ieee1905::cmdu_observer=trace -i eth1_virt_peer >> /tmp/ieee1905_agent_log.txt &'
Restart=always
[Install]
WantedBy=multi-user.target |
8.copy below contents to /lib/systemd/system/em_agent.service
Code Block |
---|
language | bash |
---|
title | Ext2 em_agent |
---|
collapse | true |
---|
|
[Unit]
Description=EasyMesh Agent service
After=onewifi.service ieee1905_em_agent.service
[Service]
Type=forking
WorkingDirectory=/usr/ccsp/EasyMesh
ExecStartPre=/bin/sh -c 'sleep 30'
ExecStartPre=/bin/sh -c '/usr/ccsp/EasyMesh/setup_ext_pre.sh'
ExecStart=/bin/sh -c '/usr/bin/onewifi_em_agent >> /tmp/em_agent.log &'
Restart=always
[Install]
WantedBy=multi-user.target |
9. copy below contents to /usr/ccsp/EasyMesh/setup_ext_pre.sh and file permission should be 755
Code Block |
---|
language | bash |
---|
title | Ext2 setup_ext_pre |
---|
collapse | true |
---|
|
#!/bin/sh
#Ensure onewifi is up and running
while [ ! -e /tmp/wifi_initialized ] && [ ! -e /tmp/wifi_dml_complete ] ;
do
sleep 1;
done
#Ensure backhaul connectivity is established
al_mac_addr=`cat /nvram/EasymeshCfg.json | grep AL_MAC_ADDR | cut -d '"' -f4`
channel_exists=`iw dev | grep $al_mac_addr -A 4 | grep channel | wc -l`
ssid_exists=`iw dev | grep $al_mac_addr -A 4 | grep ssid | wc -l`
while [ "$channel_exists" != 1 ] && [ "$ssid_exists" != 1 ] ;
do
sleep 1;
channel_exists=`iw dev | grep $al_mac_addr -A 4 | grep channel | wc -l`
ssid_exists=`iw dev | grep $al_mac_addr -A 4 | grep ssid | wc -l`
done |
10. Reboot the device
After reboot,
11. Ensure mesh backhaul connectivity is established over 2.4G through wifi0.1 interface.
Code Block |
---|
|
iw dev wifi0.1 info |
9. Verify mesh backhaul connection in Extender1 side as well.
Code Block |
---|
|
iw dev wifi0.1.sta info
iw dev wifi0.1.sta station dump ## This command gives information on connected client ie Extender2. |
11. Wait for few minutes( for Agent to propagate SSID information from Controller to OneWifi in Extender2) and then check
...