if [ "$(nvram get sw_mode)" != "1" ]; then
case "$(nvram get sw_mode)" in
2) rtrMode="Repeater";;
3|4)rtrMode="Access Point (AP) or Media Bridge";;
esac
lastError=" Router is in $rtrMode mode,\\n $NAME cannot work in this mode."
reload_d_menu
else
echo "${OK} Wireless router mode"
fi
I'll try it. Sorry if I put the original post in the wrong spot, I forgot scripts only work on mesh nodes with your firmware.Possibly with sw_mode.
Nope, I get 3 on my 68U mesh node. My 86U main router returns 1. But that's good enough for what I want to do, which is detect if scribe is running on the main router or a node.I have this code in Diversion, my guess is that mesh node is either 4 or a new value of 5, I have not checked. Let me know if you do:
Code:if [ "$(nvram get sw_mode)" != "1" ]; then case "$(nvram get sw_mode)" in 2) rtrMode="Repeater";; 3|4)rtrMode="Access Point (AP) or Media Bridge";; esac lastError=" Router is in $rtrMode mode,\\n $NAME cannot work in this mode." reload_d_menu else echo "${OK} Wireless router mode" fi
enum {
SW_MODE_NONE=0,
SW_MODE_ROUTER,
SW_MODE_REPEATER, /* Ralink/MTK/QCA: if wlc_psta = 1, Media bridge mode. */
SW_MODE_AP, /* Broadcom: if wlc_psta = 1, Media bridge mode. */
SW_MODE_HOTSPOT
};
wlc_psta returns 0 for the main router, 2 for the node.here are the various modes as defined in libshared:
Code:enum { SW_MODE_NONE=0, SW_MODE_ROUTER, SW_MODE_REPEATER, /* Ralink/MTK/QCA: if wlc_psta = 1, Media bridge mode. */ SW_MODE_AP, /* Broadcom: if wlc_psta = 1, Media bridge mode. */ SW_MODE_HOTSPOT };
No explicit mention of AiMesh nodes. But it points out that wlc_psta might be another potential variable to review.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!