Developing lightweight computation at the DSG edge

Commit 333e352d 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 508530e1 6eb46ec4
......@@ -28,13 +28,17 @@ qmp_prepare_wireless_iface() {
qmp_uci_set_raw wireless.$device=wifi-iface
}
###################################
# Check channel for wifi interface
###################################
# First parameter: device
# Second parameter: channel
# 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
################################
# function qmp_check_channel() #
################################
#
# Check if a specific channel and mode combination is valid for a wifi device.
# It returns the same channel if valid, or a valid channel otherwise.
#
# Parameters:
# 1: wireless device (e.g.: wlan0)
# 2: channel number
# 3: operation mode (e.g.: adhoc, 80211s_aplan, none)
qmp_check_channel() {
local dev="$1"
......@@ -103,20 +107,23 @@ qmp_configure_wifi_driver() {
esac
}
########################
# Configure wifi device
########################
# Configure a wifi device according qmp config file
# Parameters are: 1-> qmp config id, 2-> device name
########################################
# function qmp_configure_wifi_device() #
########################################
#
# Configure a wifi device according to qMp's config file
#
# Parameters:
# 1: wireless device number in qMp's config file
qmp_configure_wifi_device() {
echo ""
echo "Configuring device $2"
local id=$1
local device="$(qmp_uci_get @wireless[$id].device)"
local channel="$(qmp_uci_get @wireless[$id].channel)"
echo ""
echo "Configuring device #${1} (${device})"
# Remove the wireless device in $device from the previous lan/wan/mesh groups
# and put it in the appropriate ones according to the selected mode
......@@ -427,9 +434,8 @@ qmp_wifi_get_default() {
# else depending on index
if [ "$what" == "mode" ]; then
# Count the total number of devices, single-band 802.11a/an devices,
# single-band 802.11b/bg/bgn and dual-band 802.11ab/abg/abgn devices.
# Count the total number of devices, single-band 802.11a/an/ac devices,
# single-band 802.11b/bg/bgn and dual-band 802.11ab/abg/abgn/ac devices.
local devices=0
local a_devices=0
local bg_devices=0
......
......@@ -25,10 +25,11 @@ end
function print_modes()
local data = qmpinfo.get_modes(op1)
local output = ""
if data.b then output = output .. "b " end
if data.g then output = output .. "g " end
if data.a then output = output .. "a " end
if data.n then output = output .. "n " end
if data.ac then output = output .. "a ac "
elseif data.a then output = output .. "a " end
if data.b then output = output .. "b " end
if data.g then output = output .. "g " end
if data.n then output = output .. "n " end
print(output)
end
......
......@@ -3,7 +3,7 @@ wireless.#QMP_RADIO.type=mac80211
wireless.#QMP_RADIO.macaddr=#QMP_MAC
wireless.#QMP_RADIO.channel=#QMP_CHANNEL
wireless.#QMP_RADIO.country=#QMP_COUNTRY
wireless.#QMP_RADIO.hwmode=11na
wireless.#QMP_RADIO.hwmode=11a
wireless.#QMP_RADIO.htmode=#QMP_HTMODE
wireless.#QMP_RADIO.txpower=#QMP_TXPOWER
wireless.#QMP_RADIO.noscan=1
......@@ -13,4 +13,3 @@ wireless.#QMP_RADIO.mcast_rate=#QMP_MRATE
list wireless.#QMP_RADIO.ht_capab=SHORT-GI-40
list wireless.#QMP_RADIO.ht_capab=RX-STBC1
list wireless.#QMP_RADIO.ht_capab=DSSS_CCK-40
......@@ -3,13 +3,13 @@ wireless.#QMP_RADIO.type=mac80211
wireless.#QMP_RADIO.macaddr=#QMP_MAC
wireless.#QMP_RADIO.channel=#QMP_CHANNEL
wireless.#QMP_RADIO.country=#QMP_COUNTRY
wireless.#QMP_RADIO.hwmode=11ng
wireless.#QMP_RADIO.hwmode=11g
wireless.#QMP_RADIO.htmode=#QMP_HTMODE
wireless.#QMP_RADIO.txpower=#QMP_TXPOWER
wireless.#QMP_RADIO.noscan=1
wireless.#QMP_RADIO.distance=5000
wireless.#QMP_RADIO.mcast_rate=#QMP_MRATE
#list wireless.#QMP_RADIO.ht_capab=SHORT-GI-20
list wireless.#QMP_RADIO.ht_capab=SHORT-GI-40
list wireless.#QMP_RADIO.ht_capab=RX-STBC1
list wireless.#QMP_RADIO.ht_capab=DSSS_CCK-40
#!/bin/sh
[ -f /etc/config/mini_snmpd ] && {
# Enable mini_snmpd
uci set mini_snmpd.@mini_snmpd[0].enabled=1
# Enable mini_snmpd
uci set mini_snmpd.@mini_snmpd[0].enabled=1
# Make mini_snmpd listen on any interfaces
uci set mini_snmpd.@mini_snmpd[0].listen_interface=""
# Make mini_snmpd listen on any interfaces
uci set mini_snmpd.@mini_snmpd[0].listen_interface=""
# Remove br-lan from the interfaces list
local elem
local list="$(uci get mini_snmpd.@mini_snmpd[0].interfaces)"
# Remove br-lan from the interfaces list
local elem
local list="$(uci get mini_snmpd.@mini_snmpd[0].interfaces)"
uci delete mini_snmpd.@mini_snmpd[0].interfaces
uci delete mini_snmpd.@mini_snmpd[0].interfaces
for elem in $list; do
if [ "$elem" != "br-lan" ]; then
echo $elem
uci add_list mini_snmpd.@mini_snmpd[0].interfaces=$elem
fi
done
uci commit
for elem in $list; do
if [ "$elem" != "br-lan" ]; then
echo $elem
uci add_list mini_snmpd.@mini_snmpd[0].interfaces=$elem
fi
done
uci commit
# Ensure wlan0 is added
if ! uci get mini_snmpd.@mini_snmpd[0].interfaces | egrep -q 'wlan0'; then
uci add_list mini_snmpd.@mini_snmpd[0].interfaces="wlan0"
fi
# Ensure wlan0 is added
if ! uci get mini_snmpd.@mini_snmpd[0].interfaces | egrep -q 'wlan0'; then
uci add_list mini_snmpd.@mini_snmpd[0].interfaces="wlan0"
fi
# Ensure lan is added
if ! uci get mini_snmpd.@mini_snmpd[0].interfaces | egrep -q 'lan'; then
uci add_list mini_snmpd.@mini_snmpd[0].interfaces="lan"
fi
# Ensure lan is added
if ! uci get mini_snmpd.@mini_snmpd[0].interfaces | egrep -q 'lan'; then
uci add_list mini_snmpd.@mini_snmpd[0].interfaces="lan"
fi
uci commit
uci commit
# Remove old items
uci_remove_list_element "olsrd.@Interface[0].interface" "wan"
uci commit
/etc/init.d/mini_snmpd restart
/etc/init.d/mini_snmpd restart
}
\ No newline at end of file
#!/bin/sh
if ! cat /etc/crontabs/root | grep wifihealth; then
echo "*/5 * * * * /usr/bin/wifihealth.sh >> /tmp/log/wifihealth.log" >> /etc/crontabs/root
/etc/init.d/cron enable
/etc/init.d/cron start
fi
......@@ -357,8 +357,6 @@ function nodemode.write(self, section, value)
uciout:set("qmp","networks","lan_address","172.30.22.1")
uciout:set("qmp","networks","lan_netmask","255.255.0.0")
uciout:set("qmp","networks","bmx6_ipv4_prefix24","10.202.0")
uciout:set("qmp","networks","olsr6_ipv4_address","")
uciout:set("qmp","networks","olsr6_ipv4_prefix24","10.201")
uciout:set("qmp","node","device_name",device_name)
if nodeip_roaming == nil then
uciout:set("qmp","networks","bmx6_ipv4_address","")
......
......@@ -52,7 +52,7 @@ define Package/qmp-tiny-node
CATEGORY:=qMp
URL:=https://qmp.cat
DEPENDS:= +qmp-system \
+luci-app-bmx6 +luci-theme-bootstrap +uhttpd \
+luci-app-bmx6 +luci-mod-status +uhttpd \
+uhttpd-mod-ubus
endef
......
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