Developing lightweight computation at the DSG edge

Commit bc799454 authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

Merge branch 'master' into testing


Signed-off-by: default avatarRoger Pueyo Centelles <roger.pueyo@guifi.net>
parents 97ea7016 b2dea2ae
......@@ -33,7 +33,7 @@ qmp_prepare_wireless_iface() {
###################################
# First parameter: device
# Second parameter: channel
# Third parameter: mode (adhoc, ap, adhoc_ap, aplan, client, clientwan, 80211s, 80211s_aplan none)
# Third parameter: mode (adhoc, ap, adhoc_ap, aplan, client, clientwan, 80211s, 80211s_aplan, none)
# It returns the same channel if it is right, and the new one fixet if not
qmp_check_channel() {
......
#!/bin/sh
# Move the BMX6 entry to a menu in the qMp page
uci set luci-bmx6.luci=bmx6
uci set luci-bmx6.luci.place="qmp Mesh"
uci set luci-bmx6.luci.position=3
uci set luci-bmx6.luci.json="exec:/www/cgi-bin/bmx6-info -s"
uci set luci-bmx6.luci.ignore=0
uci commit luci-bmx6
# Update BMX6's JSON graph to match the new location of the BMX6 menu
FILENAME="/www/luci-static/resources/bmx6/js/bmx6-graph.js"
if [ -f $FILENAME ]; then
sed -i 's|/cgi-bin/luci/status/bmx6/topology|/cgi-bin/luci/qmp/Mesh/topology|g' $FILENAME
fi
exit 0
#!/bin/sh
# This script checks if the wireless devices configured in /etc/config/qmp are
# operating in the channel they are configured to. It is useful to go back to
# the configured channel if DFS switches the device to another one.
# Make sure there is at least one wireless device configured
lastdev=$(uci -q get qmp.@wireless[-1].device)
if [ $lastdev ]; then
# Iterate through all the configured devices
i=0
while [ $i -ge 0 ]; do
# Get qMp device configuration parameters
qmpdev=$(uci -q get qmp.@wireless[${i}].device)
qmpmode=$(uci -q get qmp.@wireless[${i}].mode)
qmpchannel=$(uci -q get qmp.@wireless[${i}].channel)
# Check the device is not disabled in qMp, skip it otherwise
if [ "$qmpmode" != "none" ]; then
wifiradio=$(uci -q get wireless.$qmpdev.device)
if [ $wifiradio ]; then
wifichannel=$(uci get wireless.${wifiradio}.channel)
if [ $wifichannel ]; then
iwchannel=$(iw dev $qmpdev info | grep channel | sed -e 's/^[ \t]*//' | cut -d ' ' -f 2)
# Trim the HT40 upper/lower channel extension info (i.e., the + or - symbols)
qmpchannelnum=$(echo ${qmpchannel} | sed -e 's/[-+]*//g')
wifichannelnum=$(echo ${wifichannel} | sed -e 's/[-+]*//g')
# Check that channel configurations in /etc/config/qmp and /etc/config/wireless match
if [ "$qmpchannelnum" == "$wifichannelnum" ]; then
# If the channel configured in /etc/config/wireless and the one reported by iw differ, reset the wifi
if [ $wifichannelnum -ne $iwchannel ]; then
wifi
exit 0
fi
fi
fi
fi
fi
if [ "$(uci -q get qmp.@wireless[${i}].device)" == "$(uci -q get qmp.@wireless[-1].device)" ]; then
i=-1
else
let i=$i+1
fi
done
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment