Developing lightweight computation at the DSG edge

Commit 11d0bffc authored by hakais's avatar hakais
Browse files

Added device configuration in qmp_wireless and some web interface freatures

parent a61c438b
......@@ -30,7 +30,7 @@ define Package/qmp-big-node
+iperf +mtr +netcat +netperf \
+tcpdump-mini \
+nmap +lsof \
+wget \
+wget +horst \
+ipv6calc \
+bmon +bwm +ebtables +pv \
......
......@@ -27,6 +27,7 @@ define Package/qmp-small-node
+iputils-arping +iputils-clockdiff +iputils-ping +iputils-tracepath \
+ahcpd \
+radvd \
+hostapd \
+wireless-tools +iw \
+wide-dhcpv6-client +wide-dhcpv6-control +wide-dhcpv6-server \
+bmx6-qmp +bmx6-qmp-uci-config +bmx6-qmp-json +bmx6-luci \
......
......@@ -23,6 +23,11 @@ config 'qmp' 'wireless'
option 'country' 'UZ'
option 'bssid' '02:CA:FF:EE:BA:BE'
config 'wireless'
option 'channel' '44'
option 'mode' 'adhoc'
option 'name' 'qmp'
config 'wireless'
option 'channel' '10'
option 'mode' 'adhoc'
......
......@@ -135,8 +135,9 @@ qmp_configure_wifi_initial() {
id_configured="$id_configured $j"
echo "Found configured device: $m"
[ -z "$(qmp_uci_get @wireless[$j].channel)" ] && qmp_uci_set @wireless[$j].channel $(qmp_wifi_get_default channel)
[ -z "$(qmp_uci_get @wireless[$j].mode)" ] && qmp_uci_set @wireless[$j].mode $(qmp_wifi_get_default mode)
[ -z "$(qmp_uci_get @wireless[$j].name)" ] && qmp_uci_set @wireless[$j].name $(qmp_wifi_get_default name)
[ -z "$(qmp_uci_get @wireless[$j].mode)" ] && qmp_uci_set @wireless[$j].mode $(qmp_wifi_get_default mode)
[ -z "$(qmp_uci_get @wireless[$j].name)" ] && qmp_uci_set @wireless[$j].name $(qmp_wifi_get_default name)
qmp_uci_set @wireless[$j].device $(qmp_get_dev_from_mac $m)
break
fi
j=$(( $j + 1 ))
......@@ -157,6 +158,7 @@ qmp_configure_wifi_initial() {
[ -z "$(qmp_uci_get @wireless[$j].mode)" ] && qmp_uci_set @wireless[$j].mode $(qmp_wifi_get_default mode)
[ -z "$(qmp_uci_get @wireless[$j].name)" ] && qmp_uci_set @wireless[$j].name $(qmp_wifi_get_default name)
qmp_uci_set @wireless[$j].mac $m
qmp_uci_set @wireless[$j].device $(qmp_get_dev_from_mac $m)
id_configured="$id_configured $j"
done
......@@ -165,5 +167,4 @@ qmp_configure_wifi_initial() {
[ -z "$(qmp_uci_get wireless.driver)" ] && qmp_uci_set wireless.driver $(qmp_wifi_get_default driver)
[ -z "$(qmp_uci_get wireless.country)" ] && qmp_uci_set wireless.country $(qmp_wifi_get_default country)
[ -z "$(qmp_uci_get wireless.bssid)" ] && qmp_uci_set wireless.bssid $(qmp_wifi_get_default bssid)
}
require("luci.sys")
m = Map("qmp", "Quick Mesh Project")
------------------
-- Section MAIN
------------------
s_wireless_main = m:section(NamedSection, "wireless", "qmp", "Wireless general options", "Wireless configuration")
s_wireless_main.addremove = False
-- Driver selection
driver = s_wireless_main:option(ListValue, "driver", "Driver")
driver:value("mac80211","mac80211")
driver:value("madwifi","madwifi")
-- Country selection
country = s_wireless_main:option(Value,"country", "Country")
-- BSSID
bssid = s_wireless_main:option(Value,"bssid","BSSID")
--------------------
-- Section Wireless
--------------------
s_wireless = m:section(TypedSection, "wireless", "", "")
s_wireless.addremove = False
-- MAC
mac = s_wireless:option(Value,"mac","MAC")
-- Mode
mode = s_wireless:option(ListValue,"mode","Mode")
mode:value("adhoc","Ad-Hoc")
mode:value("ap","Access Point")
-- Name
s_wireless:option(Value,"name","Wireless name")
-- Channel
--local iw = luci.sys.exec("sh /etc/qmp/qmp_common.sh qmp_get_dev_from_mac " .. "00:80:48:6b:28:83")
--luci.sys.wifi.channels(iw)
--local device = m:get(s_wireless, "channel")
--device = m:get(s_wireless,"channel")
channel = s_wireless:option(Value,"channel","Channel")
return m
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