#cd to the working directory
cp -R ./openwrt-meshdesk/MESHdesk ./openwrt/package
#cd to the working directory
cp -R ./openwrt-meshdesk/files ./openwrt
#cd to the working directory
cp -R ./openwrt-meshdesk/luci-app-meshdesk ./openwrt/feeds/luci/applications
#change directory to where the LEDs are
cd /sys/class/leds/
ls
#These are the LEDs available
blue:power mt76-phy0 mt76-phy1 yellow:power
#turn it off
echo "0" > yellow\:power/brightness
#turn it on
echo "1" > yellow\:power/brightness
#turn it off
echo "0" > blue\:power/brightness
#turn it on
echo "1" > blue\:power/brightness
In our case we can use the yellow LED to light up if the comms to the controller is broken.
We can use the blue LED to signal during startup and neighbor counts.
There is no extra LED so we will not define one for the mesh traffic.
With this info we can create a hardware section in /etc/config/meshdesk
config hardware 'xiaomi_4a_100'
option morse_led '/sys/class/leds/blue:power/brightness'
option internet_led '/sys/class/leds/yellow:power/brightness'
option wifi_led 'led0'
config settings 'settings'
option hardware 'xiaomi_4a_100'
option id_if 'eth0'
option lan_up_file '/tmp/lan_up'
Don't make the name of the hardware section more than 14characters. Longer names break things during deployment.
Later we will also use the value of xiaomi_4a_100 to define the hardware on the controller.
The final tweak for the hardware in the config file is the interface that must be used as the id_if.
Since we want the yellow LED to be off when the comms to the controller is fine we need to check what the current setup is
vi /etc/MESHdesk/reporting/report_to_server.lua
#Look for this section
if(ok_flag)then
internetLED('0'); -- NOTE Here we can swap thme around eg make it 0 to turn off a red LED when the internet is OK
checkForContollerReboot('1');
else
internetLED('1');
checkForContollerReboot('0');
end
Item | Typical value | Comment |
settings → hardware | xiaomi_4a_100 | Must match a hw definition in the file itself |
settings → id_if | eth0 | eg eth0, eth1 or wan - NOT eth0.1 (for those boards its just eth0) |
settings → skip_radio_0 | 0 | set to 1 when radio0 is a 5G radio and you don't want to use it for config SSID |
Edit the file /etc/MESHdesk/configs/captive_config.json.
This file is a JSON structure that the device uses as a reference to configure itself with a special captive portal when it is not yet managed by the controller.
There are only two items that might need to be tweaked
With the Xiaomi 4A 100M Edition radio0 is the 2.4G radio so no need to tweak that item. (If the hardware has radio1 as the 2.4G band simply look for all the references to radio0 and make them radio1)
See this snippet of a device which has radio1 using the 2.4G band
"wireless": [
{
"wifi-device": "radio1",
"options": {
"channel": 1,
"disabled": 0,
"hwmode": "11g",
"htmode": "HT20"
}
},
{
"wifi-iface": "two",
"options": {
"device": "radio1",
"ifname": "two0",
"mode": "ap",
"network": "ex_two",
"encryption": "none",
"ssid": "_Replace_",
"key": "",
"hidden": false,
"isolate": false,
"auth_server": "",
"auth_secret": ""
}
},
{
"wifi-iface": "web_by_w",
"options": {
"device": "radio1",
"mode": "sta",
"network": "web_by_w",
"encryption": "psk2",
"key": "radiusdesk",
"ssid": "meshdesk_config",
"disabled": "1"
}
}
],
{
"interface": "lan",
"options": {
"ifname": "eth0.1",
"type": "bridge",
"proto": "static",
"ipaddr": "10.50.50.50",
"netmask": "255.255.255.0"
}
},
{
"interface": "lan",
"options": {
"ifname": "wan",
"type": "bridge",
"proto": "static",
"ipaddr": "10.50.50.50",
"netmask": "255.255.255.0"
}
},
Once the tweaks are completed we can test everything out.
The following link shows how to point the device to the controller using the
GUI
-
Point the device to your controller and reboot it.
If all goes well it will show up in Unknown Nodes
If it is a new hardware type add it to the controller as described here:
Hardwares (Again Once Off)
-