Message ID | 1508059749-1481-1-git-send-email-freifunk@adrianschmutzler.de |
---|---|
State | Superseded |
Headers | show |
diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood index 8ce9133..d64345f 100755 --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood @@ -74,12 +74,17 @@ else fi #now we look for phy and add this for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do - radio="$(wifiAddPhyCond "$phy" "2" "$chan2ghz")" - radio5="$(wifiAddPhyCond "$phy" "5" "$chan5ghz")" - [ -n "$radio5" ] && radio="$radio5" + radio="$(wifiAddPhyCond "$phy" "2" "auto")" + radio5="$(wifiAddPhyCond "$phy" "5" "auto5")" + if [ -n "$radio5" ] ; then + radio="$radio5" + staiface="w5sta" + else + staiface="w2sta" + fi #and here we add the station - if ! wifiAddSta "$radio" "config.franken.freifunk.net" "configSta"; then + if ! wifiAddSta "$radio" "config.franken.freifunk.net" "configSta" "$staiface" ; then echo "Can't add Sta interface on $radio." exit 1 else @@ -124,11 +129,11 @@ if [ -s /tmp/keyxchangev2data ]; then json_get_var mesh_essid mesh_essid json_get_var essid essid json_get_var ntpip ntp_ip - # i think the next things we don't active this in the first version! we can do it later - #json_get_var channel2 channel2 + # Additional parameters may be activated in future versions + json_get_var chan2ghz channel2 #json_get_var mode2 mode2 json_get_var mesh_type2 mesh_type2 - #json_get_var channel5 channel5 + json_get_var chan5ghz channel5 #json_get_var mode5 mode5 json_get_var mesh_type5 mesh_type5 #json_get_var protocol protocol diff --git a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless index 7e418c2..b1ff5a9 100644 --- a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless @@ -25,7 +25,10 @@ wifiAddPhy() { local channel=$2 local radio="radio$(echo "$phy" | tr -d -C "0-9")" local hwmode="11g" - if [ "$channel" -gt "14" ]; then + if [ "$channel" = "auto5" ] ; then + hwmode="11a" + channel="auto" + elif ( ! [ "$channel" = "auto" ] ) && [ "$channel" -gt "14" ]; then hwmode="11a" fi @@ -60,7 +63,7 @@ wifiAddPhyCond() { local freq=$2 local channel=$3 local radio="" - + if iw phy "$phy" info | grep -q -m1 "${freq}... MHz"; then radio="$(wifiAddPhy "$phy" "$channel")" if [ -z "$radio" ]; then @@ -148,21 +151,17 @@ wifiAddAP() { } wifiAddSta() { - if [ $# -ne "3" ] + if [ $# -ne "4" ] then - echo "Usage: wifiAddSta <radio> <essid> <network>" + echo "Usage: wifiAddSta <radio> <essid> <network> <iface>" return 1 fi local radio=$1 local essid=$2 local network=$3 + local iface=$4 - local channel=$(uci get "wireless.${radio}.channel") - local iface="w2sta" - if [ "$channel" -gt "14" ]; then - iface="w5sta" - fi uci batch <<-__EOF__ set wireless.${iface}='wifi-iface' set wireless.${iface}.device='${radio}'
Tested-by: Fabian Bläse <fabian@blaese.de> > On 15. Oct 2017, at 11:29, Adrian Schmutzler <freifunk@adrianschmutzler.de> wrote: > > Changes in v2: > - rebase due to conflict with 802.11s > > Changes in v3: > - Fix wrong variable name introduced in v2 > > Changes in v4: > - Fixed comment > - Fixed channel comparison for wXsta > > Changes in v5: > - Make radio in wifiAddPhyCond local > > Changes in v6: > - Rebase > > Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > Signed-off-by: Fabian Bläse <fabian@blaese.de> > --- > .../fff/fff-hoods/files/usr/sbin/configurehood | 19 ++++++++++++------- > .../fff/fff-wireless/files/lib/functions/fff/wireless | 17 ++++++++--------- > 2 files changed, 20 insertions(+), 16 deletions(-) > > diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > index 8ce9133..d64345f 100755 > --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > @@ -74,12 +74,17 @@ else > fi > #now we look for phy and add this > for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do > - radio="$(wifiAddPhyCond "$phy" "2" "$chan2ghz")" > - radio5="$(wifiAddPhyCond "$phy" "5" "$chan5ghz")" > - [ -n "$radio5" ] && radio="$radio5" > + radio="$(wifiAddPhyCond "$phy" "2" "auto")" > + radio5="$(wifiAddPhyCond "$phy" "5" "auto5")" > + if [ -n "$radio5" ] ; then > + radio="$radio5" > + staiface="w5sta" > + else > + staiface="w2sta" > + fi > > #and here we add the station > - if ! wifiAddSta "$radio" "config.franken.freifunk.net" "configSta"; then > + if ! wifiAddSta "$radio" "config.franken.freifunk.net" "configSta" "$staiface" ; then > echo "Can't add Sta interface on $radio." > exit 1 > else > @@ -124,11 +129,11 @@ if [ -s /tmp/keyxchangev2data ]; then > json_get_var mesh_essid mesh_essid > json_get_var essid essid > json_get_var ntpip ntp_ip > - # i think the next things we don't active this in the first version! we can do it later > - #json_get_var channel2 channel2 > + # Additional parameters may be activated in future versions > + json_get_var chan2ghz channel2 > #json_get_var mode2 mode2 > json_get_var mesh_type2 mesh_type2 > - #json_get_var channel5 channel5 > + json_get_var chan5ghz channel5 > #json_get_var mode5 mode5 > json_get_var mesh_type5 mesh_type5 > #json_get_var protocol protocol > diff --git a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > index 7e418c2..b1ff5a9 100644 > --- a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > @@ -25,7 +25,10 @@ wifiAddPhy() { > local channel=$2 > local radio="radio$(echo "$phy" | tr -d -C "0-9")" > local hwmode="11g" > - if [ "$channel" -gt "14" ]; then > + if [ "$channel" = "auto5" ] ; then > + hwmode="11a" > + channel="auto" > + elif ( ! [ "$channel" = "auto" ] ) && [ "$channel" -gt "14" ]; then > hwmode="11a" > fi > > @@ -60,7 +63,7 @@ wifiAddPhyCond() { > local freq=$2 > local channel=$3 > local radio="" > - > + > if iw phy "$phy" info | grep -q -m1 "${freq}... MHz"; then > radio="$(wifiAddPhy "$phy" "$channel")" > if [ -z "$radio" ]; then > @@ -148,21 +151,17 @@ wifiAddAP() { > } > > wifiAddSta() { > - if [ $# -ne "3" ] > + if [ $# -ne "4" ] > then > - echo "Usage: wifiAddSta <radio> <essid> <network>" > + echo "Usage: wifiAddSta <radio> <essid> <network> <iface>" > return 1 > fi > > local radio=$1 > local essid=$2 > local network=$3 > + local iface=$4 > > - local channel=$(uci get "wireless.${radio}.channel") > - local iface="w2sta" > - if [ "$channel" -gt "14" ]; then > - iface="w5sta" > - fi > uci batch <<-__EOF__ > set wireless.${iface}='wifi-iface' > set wireless.${iface}.device='${radio}' > -- > 2.7.4 >
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > -----Original Message----- > From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf > Of Fabian Bläse > Sent: Donnerstag, 19. Oktober 2017 22:39 > To: Adrian Schmutzler <freifunk@adrianschmutzler.de> > Cc: franken-dev@freifunk.net > Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway > > Tested-by: Fabian Bläse <fabian@blaese.de> > > > On 15. Oct 2017, at 11:29, Adrian Schmutzler > <freifunk@adrianschmutzler.de> wrote: > > > > Changes in v2: > > - rebase due to conflict with 802.11s > > > > Changes in v3: > > - Fix wrong variable name introduced in v2 > > > > Changes in v4: > > - Fixed comment > > - Fixed channel comparison for wXsta > > > > Changes in v5: > > - Make radio in wifiAddPhyCond local > > > > Changes in v6: > > - Rebase > > > > Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > > Signed-off-by: Fabian Bläse <fabian@blaese.de> > > --- > > .../fff/fff-hoods/files/usr/sbin/configurehood | 19 ++++++++++++------ > - > > .../fff/fff-wireless/files/lib/functions/fff/wireless | 17 ++++++++--------- > > 2 files changed, 20 insertions(+), 16 deletions(-) > > > > diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > > index 8ce9133..d64345f 100755 > > --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > > +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > > @@ -74,12 +74,17 @@ else > > fi > > #now we look for phy and add this > > for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do > > - radio="$(wifiAddPhyCond "$phy" "2" "$chan2ghz")" > > - radio5="$(wifiAddPhyCond "$phy" "5" "$chan5ghz")" > > - [ -n "$radio5" ] && radio="$radio5" > > + radio="$(wifiAddPhyCond "$phy" "2" "auto")" > > + radio5="$(wifiAddPhyCond "$phy" "5" "auto5")" > > + if [ -n "$radio5" ] ; then > > + radio="$radio5" > > + staiface="w5sta" > > + else > > + staiface="w2sta" > > + fi > > > > #and here we add the station > > - if ! wifiAddSta "$radio" "config.franken.freifunk.net" > "configSta"; then > > + if ! wifiAddSta "$radio" "config.franken.freifunk.net" > "configSta" "$staiface" ; then > > echo "Can't add Sta interface on $radio." > > exit 1 > > else > > @@ -124,11 +129,11 @@ if [ -s /tmp/keyxchangev2data ]; then > > json_get_var mesh_essid mesh_essid > > json_get_var essid essid > > json_get_var ntpip ntp_ip > > - # i think the next things we don't active this in the first > version! we can do it later > > - #json_get_var channel2 channel2 > > + # Additional parameters may be activated in future versions > > + json_get_var chan2ghz channel2 > > #json_get_var mode2 mode2 > > json_get_var mesh_type2 mesh_type2 > > - #json_get_var channel5 channel5 > > + json_get_var chan5ghz channel5 > > #json_get_var mode5 mode5 > > json_get_var mesh_type5 mesh_type5 > > #json_get_var protocol protocol > > diff --git a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > > index 7e418c2..b1ff5a9 100644 > > --- a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > > +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > > @@ -25,7 +25,10 @@ wifiAddPhy() { > > local channel=$2 > > local radio="radio$(echo "$phy" | tr -d -C "0-9")" > > local hwmode="11g" > > - if [ "$channel" -gt "14" ]; then > > + if [ "$channel" = "auto5" ] ; then > > + hwmode="11a" > > + channel="auto" > > + elif ( ! [ "$channel" = "auto" ] ) && [ "$channel" -gt "14" ]; then > > hwmode="11a" > > fi > > > > @@ -60,7 +63,7 @@ wifiAddPhyCond() { > > local freq=$2 > > local channel=$3 > > local radio="" > > - > > + > > if iw phy "$phy" info | grep -q -m1 "${freq}... MHz"; then > > radio="$(wifiAddPhy "$phy" "$channel")" > > if [ -z "$radio" ]; then > > @@ -148,21 +151,17 @@ wifiAddAP() { > > } > > > > wifiAddSta() { > > - if [ $# -ne "3" ] > > + if [ $# -ne "4" ] > > then > > - echo "Usage: wifiAddSta <radio> <essid> <network>" > > + echo "Usage: wifiAddSta <radio> <essid> <network> <iface>" > > return 1 > > fi > > > > local radio=$1 > > local essid=$2 > > local network=$3 > > + local iface=$4 > > > > - local channel=$(uci get "wireless.${radio}.channel") > > - local iface="w2sta" > > - if [ "$channel" -gt "14" ]; then > > - iface="w5sta" > > - fi > > uci batch <<-__EOF__ > > set wireless.${iface}='wifi-iface' > > set wireless.${iface}.device='${radio}' > > -- > > 2.7.4 > >
Was wollen wir tun, wenn im json kein Channel drin steht? Aktuell dürfte das recht unschöne Fehlermeldungen geben. Fabian > On 19. Oct 2017, at 22:47, <mail@adrianschmutzler.de> <mail@adrianschmutzler.de> wrote: > > Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > >> -----Original Message----- >> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf >> Of Fabian Bläse >> Sent: Donnerstag, 19. Oktober 2017 22:39 >> To: Adrian Schmutzler <freifunk@adrianschmutzler.de> >> Cc: franken-dev@freifunk.net >> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >> >> Tested-by: Fabian Bläse <fabian@blaese.de> >> >>> On 15. Oct 2017, at 11:29, Adrian Schmutzler >> <freifunk@adrianschmutzler.de> wrote: >>> >>> Changes in v2: >>> - rebase due to conflict with 802.11s >>> >>> Changes in v3: >>> - Fix wrong variable name introduced in v2 >>> >>> Changes in v4: >>> - Fixed comment >>> - Fixed channel comparison for wXsta >>> >>> Changes in v5: >>> - Make radio in wifiAddPhyCond local >>> >>> Changes in v6: >>> - Rebase >>> >>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>> Signed-off-by: Fabian Bläse <fabian@blaese.de> >>> --- >>> .../fff/fff-hoods/files/usr/sbin/configurehood | 19 ++++++++++++------ >> - >>> .../fff/fff-wireless/files/lib/functions/fff/wireless | 17 ++++++++--------- >>> 2 files changed, 20 insertions(+), 16 deletions(-) >>> >>> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>> index 8ce9133..d64345f 100755 >>> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>> @@ -74,12 +74,17 @@ else >>> fi >>> #now we look for phy and add this >>> for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do >>> - radio="$(wifiAddPhyCond "$phy" "2" "$chan2ghz")" >>> - radio5="$(wifiAddPhyCond "$phy" "5" "$chan5ghz")" >>> - [ -n "$radio5" ] && radio="$radio5" >>> + radio="$(wifiAddPhyCond "$phy" "2" "auto")" >>> + radio5="$(wifiAddPhyCond "$phy" "5" "auto5")" >>> + if [ -n "$radio5" ] ; then >>> + radio="$radio5" >>> + staiface="w5sta" >>> + else >>> + staiface="w2sta" >>> + fi >>> >>> #and here we add the station >>> - if ! wifiAddSta "$radio" "config.franken.freifunk.net" >> "configSta"; then >>> + if ! wifiAddSta "$radio" "config.franken.freifunk.net" >> "configSta" "$staiface" ; then >>> echo "Can't add Sta interface on $radio." >>> exit 1 >>> else >>> @@ -124,11 +129,11 @@ if [ -s /tmp/keyxchangev2data ]; then >>> json_get_var mesh_essid mesh_essid >>> json_get_var essid essid >>> json_get_var ntpip ntp_ip >>> - # i think the next things we don't active this in the first >> version! we can do it later >>> - #json_get_var channel2 channel2 >>> + # Additional parameters may be activated in future versions >>> + json_get_var chan2ghz channel2 >>> #json_get_var mode2 mode2 >>> json_get_var mesh_type2 mesh_type2 >>> - #json_get_var channel5 channel5 >>> + json_get_var chan5ghz channel5 >>> #json_get_var mode5 mode5 >>> json_get_var mesh_type5 mesh_type5 >>> #json_get_var protocol protocol >>> diff --git a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >> b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>> index 7e418c2..b1ff5a9 100644 >>> --- a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>> +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>> @@ -25,7 +25,10 @@ wifiAddPhy() { >>> local channel=$2 >>> local radio="radio$(echo "$phy" | tr -d -C "0-9")" >>> local hwmode="11g" >>> - if [ "$channel" -gt "14" ]; then >>> + if [ "$channel" = "auto5" ] ; then >>> + hwmode="11a" >>> + channel="auto" >>> + elif ( ! [ "$channel" = "auto" ] ) && [ "$channel" -gt "14" ]; then >>> hwmode="11a" >>> fi >>> >>> @@ -60,7 +63,7 @@ wifiAddPhyCond() { >>> local freq=$2 >>> local channel=$3 >>> local radio="" >>> - >>> + >>> if iw phy "$phy" info | grep -q -m1 "${freq}... MHz"; then >>> radio="$(wifiAddPhy "$phy" "$channel")" >>> if [ -z "$radio" ]; then >>> @@ -148,21 +151,17 @@ wifiAddAP() { >>> } >>> >>> wifiAddSta() { >>> - if [ $# -ne "3" ] >>> + if [ $# -ne "4" ] >>> then >>> - echo "Usage: wifiAddSta <radio> <essid> <network>" >>> + echo "Usage: wifiAddSta <radio> <essid> <network> <iface>" >>> return 1 >>> fi >>> >>> local radio=$1 >>> local essid=$2 >>> local network=$3 >>> + local iface=$4 >>> >>> - local channel=$(uci get "wireless.${radio}.channel") >>> - local iface="w2sta" >>> - if [ "$channel" -gt "14" ]; then >>> - iface="w5sta" >>> - fi >>> uci batch <<-__EOF__ >>> set wireless.${iface}='wifi-iface' >>> set wireless.${iface}.device='${radio}' >>> -- >>> 2.7.4 >>> > > > -- > franken-dev mailing list > franken-dev@freifunk.net > http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net
Wie wärs mit [ -z "$chan2ghz" ] && chan2ghz="1" ? > -----Original Message----- > From: Fabian Bläse [mailto:fabian@blaese.de] > Sent: Freitag, 20. Oktober 2017 00:20 > To: mail@adrianschmutzler.de; franken-dev@freifunk.net > Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway > > Was wollen wir tun, wenn im json kein Channel drin steht? Aktuell dürfte das > recht unschöne Fehlermeldungen geben. > > Fabian > > > On 19. Oct 2017, at 22:47, <mail@adrianschmutzler.de> > <mail@adrianschmutzler.de> wrote: > > > > Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > > > >> -----Original Message----- > >> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On > Behalf > >> Of Fabian Bläse > >> Sent: Donnerstag, 19. Oktober 2017 22:39 > >> To: Adrian Schmutzler <freifunk@adrianschmutzler.de> > >> Cc: franken-dev@freifunk.net > >> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway > >> > >> Tested-by: Fabian Bläse <fabian@blaese.de> > >> > >>> On 15. Oct 2017, at 11:29, Adrian Schmutzler > >> <freifunk@adrianschmutzler.de> wrote: > >>> > >>> Changes in v2: > >>> - rebase due to conflict with 802.11s > >>> > >>> Changes in v3: > >>> - Fix wrong variable name introduced in v2 > >>> > >>> Changes in v4: > >>> - Fixed comment > >>> - Fixed channel comparison for wXsta > >>> > >>> Changes in v5: > >>> - Make radio in wifiAddPhyCond local > >>> > >>> Changes in v6: > >>> - Rebase > >>> > >>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > >>> Signed-off-by: Fabian Bläse <fabian@blaese.de> > >>> --- > >>> .../fff/fff-hoods/files/usr/sbin/configurehood | 19 ++++++++++++--- > --- > >> - > >>> .../fff/fff-wireless/files/lib/functions/fff/wireless | 17 > >>> ++++++++--------- > >>> 2 files changed, 20 insertions(+), 16 deletions(-) > >>> > >>> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > >> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > >>> index 8ce9133..d64345f 100755 > >>> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > >>> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > >>> @@ -74,12 +74,17 @@ else > >>> fi > >>> #now we look for phy and add this > >>> for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do > >>> - radio="$(wifiAddPhyCond "$phy" "2" "$chan2ghz")" > >>> - radio5="$(wifiAddPhyCond "$phy" "5" "$chan5ghz")" > >>> - [ -n "$radio5" ] && radio="$radio5" > >>> + radio="$(wifiAddPhyCond "$phy" "2" "auto")" > >>> + radio5="$(wifiAddPhyCond "$phy" "5" "auto5")" > >>> + if [ -n "$radio5" ] ; then > >>> + radio="$radio5" > >>> + staiface="w5sta" > >>> + else > >>> + staiface="w2sta" > >>> + fi > >>> > >>> #and here we add the station > >>> - if ! wifiAddSta "$radio" "config.franken.freifunk.net" > >> "configSta"; then > >>> + if ! wifiAddSta "$radio" "config.franken.freifunk.net" > >> "configSta" "$staiface" ; then > >>> echo "Can't add Sta interface on $radio." > >>> exit 1 > >>> else > >>> @@ -124,11 +129,11 @@ if [ -s /tmp/keyxchangev2data ]; then > >>> json_get_var mesh_essid mesh_essid > >>> json_get_var essid essid > >>> json_get_var ntpip ntp_ip > >>> - # i think the next things we don't active this in the first > >> version! we can do it later > >>> - #json_get_var channel2 channel2 > >>> + # Additional parameters may be activated in future versions > >>> + json_get_var chan2ghz channel2 > >>> #json_get_var mode2 mode2 > >>> json_get_var mesh_type2 mesh_type2 > >>> - #json_get_var channel5 channel5 > >>> + json_get_var chan5ghz channel5 > >>> #json_get_var mode5 mode5 > >>> json_get_var mesh_type5 mesh_type5 > >>> #json_get_var protocol protocol > >>> diff --git > >>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > >> b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > >>> index 7e418c2..b1ff5a9 100644 > >>> --- a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > >>> +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > >>> @@ -25,7 +25,10 @@ wifiAddPhy() { > >>> local channel=$2 > >>> local radio="radio$(echo "$phy" | tr -d -C "0-9")" > >>> local hwmode="11g" > >>> - if [ "$channel" -gt "14" ]; then > >>> + if [ "$channel" = "auto5" ] ; then > >>> + hwmode="11a" > >>> + channel="auto" > >>> + elif ( ! [ "$channel" = "auto" ] ) && [ "$channel" -gt "14" ]; > >>> +then > >>> hwmode="11a" > >>> fi > >>> > >>> @@ -60,7 +63,7 @@ wifiAddPhyCond() { > >>> local freq=$2 > >>> local channel=$3 > >>> local radio="" > >>> - > >>> + > >>> if iw phy "$phy" info | grep -q -m1 "${freq}... MHz"; then > >>> radio="$(wifiAddPhy "$phy" "$channel")" > >>> if [ -z "$radio" ]; then > >>> @@ -148,21 +151,17 @@ wifiAddAP() { > >>> } > >>> > >>> wifiAddSta() { > >>> - if [ $# -ne "3" ] > >>> + if [ $# -ne "4" ] > >>> then > >>> - echo "Usage: wifiAddSta <radio> <essid> <network>" > >>> + echo "Usage: wifiAddSta <radio> <essid> <network> <iface>" > >>> return 1 > >>> fi > >>> > >>> local radio=$1 > >>> local essid=$2 > >>> local network=$3 > >>> + local iface=$4 > >>> > >>> - local channel=$(uci get "wireless.${radio}.channel") > >>> - local iface="w2sta" > >>> - if [ "$channel" -gt "14" ]; then > >>> - iface="w5sta" > >>> - fi > >>> uci batch <<-__EOF__ > >>> set wireless.${iface}='wifi-iface' > >>> set wireless.${iface}.device='${radio}' > >>> -- > >>> 2.7.4 > >>> > > > > > > -- > > franken-dev mailing list > > franken-dev@freifunk.net > > http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net
Hi On 20.10.2017 00:30, mail@adrianschmutzler.de wrote: > Wie wärs mit > > [ -z "$chan2ghz" ] && chan2ghz="1" weiß nicht ob das ne gute Idee ist? Wenn kein Channel drin steht ist die Hoodfile defekt. Ich würde eher versuchen weiterhin eine korrekte zu bekommen und den Router nicht auf irgendwas (was vermutlich eh nicht funktioniert) zu konfigurieren. Das ganze brachte mich aber auf eine Idee: Eigentlich sollten die Router ihre angebotene Hoodfile dynamisch schreiben. Zumindest sollte in der Hoodfile der Channel stehen, auf den das Gerät auch eingestellt sind. Wenn ich nämlich bei mir die Channels aufteile (Kirchturm mit 4 Sektoren zum Beispiel) und jemand im Nordsektor mit Kanal 5 die Hoodfile mit Kanal 13 zieht, ist das irgendwie doof. Also wäre es toll, wenn der Router der auf Kanal 5 ist, in die Hoodfile auch Kanal 5 schreibt. Dadurch kann dann auch problemlos der Kanal nach Lust & Lauen geändert werden, Meshrouter machen diese Änderung mit ("Oh kein GW mehr? Machen wir mal STA und holen uns die aktuellste json wo der neue Kanal drinnen steht...") Problem dabei, Meshrouter holen sich die File wärend des Betriebs vom Gateway und da steht wieder 13 (im oberen Beispiel) drinnen. Das müsste man auch irgendwie abfangen. Ich fände das schon sehr cool aber vermutlich doch recht aufwendig. mfg Christian > > ? > >> -----Original Message----- >> From: Fabian Bläse [mailto:fabian@blaese.de] >> Sent: Freitag, 20. Oktober 2017 00:20 >> To: mail@adrianschmutzler.de; franken-dev@freifunk.net >> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >> >> Was wollen wir tun, wenn im json kein Channel drin steht? Aktuell dürfte das >> recht unschöne Fehlermeldungen geben. >> >> Fabian >> >>> On 19. Oct 2017, at 22:47, <mail@adrianschmutzler.de> >> <mail@adrianschmutzler.de> wrote: >>> >>> Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>> >>>> -----Original Message----- >>>> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On >> Behalf >>>> Of Fabian Bläse >>>> Sent: Donnerstag, 19. Oktober 2017 22:39 >>>> To: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>> Cc: franken-dev@freifunk.net >>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >>>> >>>> Tested-by: Fabian Bläse <fabian@blaese.de> >>>> >>>>> On 15. Oct 2017, at 11:29, Adrian Schmutzler >>>> <freifunk@adrianschmutzler.de> wrote: >>>>> >>>>> Changes in v2: >>>>> - rebase due to conflict with 802.11s >>>>> >>>>> Changes in v3: >>>>> - Fix wrong variable name introduced in v2 >>>>> >>>>> Changes in v4: >>>>> - Fixed comment >>>>> - Fixed channel comparison for wXsta >>>>> >>>>> Changes in v5: >>>>> - Make radio in wifiAddPhyCond local >>>>> >>>>> Changes in v6: >>>>> - Rebase >>>>> >>>>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>>> Signed-off-by: Fabian Bläse <fabian@blaese.de> >>>>> --- >>>>> .../fff/fff-hoods/files/usr/sbin/configurehood | 19 ++++++++++++--- >> --- >>>> - >>>>> .../fff/fff-wireless/files/lib/functions/fff/wireless | 17 >>>>> ++++++++--------- >>>>> 2 files changed, 20 insertions(+), 16 deletions(-) >>>>> >>>>> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>> index 8ce9133..d64345f 100755 >>>>> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>> @@ -74,12 +74,17 @@ else >>>>> fi >>>>> #now we look for phy and add this >>>>> for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do >>>>> - radio="$(wifiAddPhyCond "$phy" "2" "$chan2ghz")" >>>>> - radio5="$(wifiAddPhyCond "$phy" "5" "$chan5ghz")" >>>>> - [ -n "$radio5" ] && radio="$radio5" >>>>> + radio="$(wifiAddPhyCond "$phy" "2" "auto")" >>>>> + radio5="$(wifiAddPhyCond "$phy" "5" "auto5")" >>>>> + if [ -n "$radio5" ] ; then >>>>> + radio="$radio5" >>>>> + staiface="w5sta" >>>>> + else >>>>> + staiface="w2sta" >>>>> + fi >>>>> >>>>> #and here we add the station >>>>> - if ! wifiAddSta "$radio" "config.franken.freifunk.net" >>>> "configSta"; then >>>>> + if ! wifiAddSta "$radio" "config.franken.freifunk.net" >>>> "configSta" "$staiface" ; then >>>>> echo "Can't add Sta interface on $radio." >>>>> exit 1 >>>>> else >>>>> @@ -124,11 +129,11 @@ if [ -s /tmp/keyxchangev2data ]; then >>>>> json_get_var mesh_essid mesh_essid >>>>> json_get_var essid essid >>>>> json_get_var ntpip ntp_ip >>>>> - # i think the next things we don't active this in the first >>>> version! we can do it later >>>>> - #json_get_var channel2 channel2 >>>>> + # Additional parameters may be activated in future versions >>>>> + json_get_var chan2ghz channel2 >>>>> #json_get_var mode2 mode2 >>>>> json_get_var mesh_type2 mesh_type2 >>>>> - #json_get_var channel5 channel5 >>>>> + json_get_var chan5ghz channel5 >>>>> #json_get_var mode5 mode5 >>>>> json_get_var mesh_type5 mesh_type5 >>>>> #json_get_var protocol protocol >>>>> diff --git >>>>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>> b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>> index 7e418c2..b1ff5a9 100644 >>>>> --- a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>> +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>> @@ -25,7 +25,10 @@ wifiAddPhy() { >>>>> local channel=$2 >>>>> local radio="radio$(echo "$phy" | tr -d -C "0-9")" >>>>> local hwmode="11g" >>>>> - if [ "$channel" -gt "14" ]; then >>>>> + if [ "$channel" = "auto5" ] ; then >>>>> + hwmode="11a" >>>>> + channel="auto" >>>>> + elif ( ! [ "$channel" = "auto" ] ) && [ "$channel" -gt "14" ]; >>>>> +then >>>>> hwmode="11a" >>>>> fi >>>>> >>>>> @@ -60,7 +63,7 @@ wifiAddPhyCond() { >>>>> local freq=$2 >>>>> local channel=$3 >>>>> local radio="" >>>>> - >>>>> + >>>>> if iw phy "$phy" info | grep -q -m1 "${freq}... MHz"; then >>>>> radio="$(wifiAddPhy "$phy" "$channel")" >>>>> if [ -z "$radio" ]; then >>>>> @@ -148,21 +151,17 @@ wifiAddAP() { >>>>> } >>>>> >>>>> wifiAddSta() { >>>>> - if [ $# -ne "3" ] >>>>> + if [ $# -ne "4" ] >>>>> then >>>>> - echo "Usage: wifiAddSta <radio> <essid> <network>" >>>>> + echo "Usage: wifiAddSta <radio> <essid> <network> <iface>" >>>>> return 1 >>>>> fi >>>>> >>>>> local radio=$1 >>>>> local essid=$2 >>>>> local network=$3 >>>>> + local iface=$4 >>>>> >>>>> - local channel=$(uci get "wireless.${radio}.channel") >>>>> - local iface="w2sta" >>>>> - if [ "$channel" -gt "14" ]; then >>>>> - iface="w5sta" >>>>> - fi >>>>> uci batch <<-__EOF__ >>>>> set wireless.${iface}='wifi-iface' >>>>> set wireless.${iface}.device='${radio}' >>>>> -- >>>>> 2.7.4 >>>>> >>> >>> >>> -- >>> franken-dev mailing list >>> franken-dev@freifunk.net >>> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net > >
Hallo, ich würde mich da tatsächlich an das Hoodfile halten und das WiFi entsprechend deaktivieren. Wenn man ein kaputtes Hoodfile bekommt, dann ist das halt so. Kann ja möglicherweise auch einen guten Grund haben bei einer dezentralen Hood ein Band zu deaktivieren. Fabian > On 20. Oct 2017, at 08:18, Christian Dresel <fff@chrisi01.de> wrote: > > Hi > > On 20.10.2017 00:30, mail@adrianschmutzler.de wrote: >> Wie wärs mit >> >> [ -z "$chan2ghz" ] && chan2ghz="1" > > weiß nicht ob das ne gute Idee ist? Wenn kein Channel drin steht ist die > Hoodfile defekt. Ich würde eher versuchen weiterhin eine korrekte zu > bekommen und den Router nicht auf irgendwas (was vermutlich eh nicht > funktioniert) zu konfigurieren. > > Das ganze brachte mich aber auf eine Idee: > Eigentlich sollten die Router ihre angebotene Hoodfile dynamisch > schreiben. Zumindest sollte in der Hoodfile der Channel stehen, auf den > das Gerät auch eingestellt sind. Wenn ich nämlich bei mir die Channels > aufteile (Kirchturm mit 4 Sektoren zum Beispiel) und jemand im > Nordsektor mit Kanal 5 die Hoodfile mit Kanal 13 zieht, ist das > irgendwie doof. > > Also wäre es toll, wenn der Router der auf Kanal 5 ist, in die Hoodfile > auch Kanal 5 schreibt. > > Dadurch kann dann auch problemlos der Kanal nach Lust & Lauen geändert > werden, Meshrouter machen diese Änderung mit ("Oh kein GW mehr? Machen > wir mal STA und holen uns die aktuellste json wo der neue Kanal drinnen > steht...") > > Problem dabei, Meshrouter holen sich die File wärend des Betriebs vom > Gateway und da steht wieder 13 (im oberen Beispiel) drinnen. Das müsste > man auch irgendwie abfangen. > > Ich fände das schon sehr cool aber vermutlich doch recht aufwendig. > > mfg > > Christian > >> >> ? >> >>> -----Original Message----- >>> From: Fabian Bläse [mailto:fabian@blaese.de] >>> Sent: Freitag, 20. Oktober 2017 00:20 >>> To: mail@adrianschmutzler.de; franken-dev@freifunk.net >>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >>> >>> Was wollen wir tun, wenn im json kein Channel drin steht? Aktuell dürfte das >>> recht unschöne Fehlermeldungen geben. >>> >>> Fabian >>> >>>> On 19. Oct 2017, at 22:47, <mail@adrianschmutzler.de> >>> <mail@adrianschmutzler.de> wrote: >>>> >>>> Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>> >>>>> -----Original Message----- >>>>> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On >>> Behalf >>>>> Of Fabian Bläse >>>>> Sent: Donnerstag, 19. Oktober 2017 22:39 >>>>> To: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>>> Cc: franken-dev@freifunk.net >>>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >>>>> >>>>> Tested-by: Fabian Bläse <fabian@blaese.de> >>>>> >>>>>> On 15. Oct 2017, at 11:29, Adrian Schmutzler >>>>> <freifunk@adrianschmutzler.de> wrote: >>>>>> >>>>>> Changes in v2: >>>>>> - rebase due to conflict with 802.11s >>>>>> >>>>>> Changes in v3: >>>>>> - Fix wrong variable name introduced in v2 >>>>>> >>>>>> Changes in v4: >>>>>> - Fixed comment >>>>>> - Fixed channel comparison for wXsta >>>>>> >>>>>> Changes in v5: >>>>>> - Make radio in wifiAddPhyCond local >>>>>> >>>>>> Changes in v6: >>>>>> - Rebase >>>>>> >>>>>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>>>> Signed-off-by: Fabian Bläse <fabian@blaese.de> >>>>>> --- >>>>>> .../fff/fff-hoods/files/usr/sbin/configurehood | 19 ++++++++++++--- >>> --- >>>>> - >>>>>> .../fff/fff-wireless/files/lib/functions/fff/wireless | 17 >>>>>> ++++++++--------- >>>>>> 2 files changed, 20 insertions(+), 16 deletions(-) >>>>>> >>>>>> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>> index 8ce9133..d64345f 100755 >>>>>> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>> @@ -74,12 +74,17 @@ else >>>>>> fi >>>>>> #now we look for phy and add this >>>>>> for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do >>>>>> - radio="$(wifiAddPhyCond "$phy" "2" "$chan2ghz")" >>>>>> - radio5="$(wifiAddPhyCond "$phy" "5" "$chan5ghz")" >>>>>> - [ -n "$radio5" ] && radio="$radio5" >>>>>> + radio="$(wifiAddPhyCond "$phy" "2" "auto")" >>>>>> + radio5="$(wifiAddPhyCond "$phy" "5" "auto5")" >>>>>> + if [ -n "$radio5" ] ; then >>>>>> + radio="$radio5" >>>>>> + staiface="w5sta" >>>>>> + else >>>>>> + staiface="w2sta" >>>>>> + fi >>>>>> >>>>>> #and here we add the station >>>>>> - if ! wifiAddSta "$radio" "config.franken.freifunk.net" >>>>> "configSta"; then >>>>>> + if ! wifiAddSta "$radio" "config.franken.freifunk.net" >>>>> "configSta" "$staiface" ; then >>>>>> echo "Can't add Sta interface on $radio." >>>>>> exit 1 >>>>>> else >>>>>> @@ -124,11 +129,11 @@ if [ -s /tmp/keyxchangev2data ]; then >>>>>> json_get_var mesh_essid mesh_essid >>>>>> json_get_var essid essid >>>>>> json_get_var ntpip ntp_ip >>>>>> - # i think the next things we don't active this in the first >>>>> version! we can do it later >>>>>> - #json_get_var channel2 channel2 >>>>>> + # Additional parameters may be activated in future versions >>>>>> + json_get_var chan2ghz channel2 >>>>>> #json_get_var mode2 mode2 >>>>>> json_get_var mesh_type2 mesh_type2 >>>>>> - #json_get_var channel5 channel5 >>>>>> + json_get_var chan5ghz channel5 >>>>>> #json_get_var mode5 mode5 >>>>>> json_get_var mesh_type5 mesh_type5 >>>>>> #json_get_var protocol protocol >>>>>> diff --git >>>>>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>> b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>>> index 7e418c2..b1ff5a9 100644 >>>>>> --- a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>>> +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>>> @@ -25,7 +25,10 @@ wifiAddPhy() { >>>>>> local channel=$2 >>>>>> local radio="radio$(echo "$phy" | tr -d -C "0-9")" >>>>>> local hwmode="11g" >>>>>> - if [ "$channel" -gt "14" ]; then >>>>>> + if [ "$channel" = "auto5" ] ; then >>>>>> + hwmode="11a" >>>>>> + channel="auto" >>>>>> + elif ( ! [ "$channel" = "auto" ] ) && [ "$channel" -gt "14" ]; >>>>>> +then >>>>>> hwmode="11a" >>>>>> fi >>>>>> >>>>>> @@ -60,7 +63,7 @@ wifiAddPhyCond() { >>>>>> local freq=$2 >>>>>> local channel=$3 >>>>>> local radio="" >>>>>> - >>>>>> + >>>>>> if iw phy "$phy" info | grep -q -m1 "${freq}... MHz"; then >>>>>> radio="$(wifiAddPhy "$phy" "$channel")" >>>>>> if [ -z "$radio" ]; then >>>>>> @@ -148,21 +151,17 @@ wifiAddAP() { >>>>>> } >>>>>> >>>>>> wifiAddSta() { >>>>>> - if [ $# -ne "3" ] >>>>>> + if [ $# -ne "4" ] >>>>>> then >>>>>> - echo "Usage: wifiAddSta <radio> <essid> <network>" >>>>>> + echo "Usage: wifiAddSta <radio> <essid> <network> <iface>" >>>>>> return 1 >>>>>> fi >>>>>> >>>>>> local radio=$1 >>>>>> local essid=$2 >>>>>> local network=$3 >>>>>> + local iface=$4 >>>>>> >>>>>> - local channel=$(uci get "wireless.${radio}.channel") >>>>>> - local iface="w2sta" >>>>>> - if [ "$channel" -gt "14" ]; then >>>>>> - iface="w5sta" >>>>>> - fi >>>>>> uci batch <<-__EOF__ >>>>>> set wireless.${iface}='wifi-iface' >>>>>> set wireless.${iface}.device='${radio}' >>>>>> -- >>>>>> 2.7.4 >>>>>> >>>> >>>> >>>> -- >>>> franken-dev mailing list >>>> franken-dev@freifunk.net >>>> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net >> >> >
Hallo, siehe unten. > -----Original Message----- > From: Christian Dresel [mailto:fff@chrisi01.de] > Sent: Freitag, 20. Oktober 2017 08:18 > To: mail@adrianschmutzler.de; franken-dev@freifunk.net; 'Fabian Bläse' > <fabian@blaese.de> > Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway > > Hi > > On 20.10.2017 00:30, mail@adrianschmutzler.de wrote: > > Wie wärs mit > > > > [ -z "$chan2ghz" ] && chan2ghz="1" > > weiß nicht ob das ne gute Idee ist? Wenn kein Channel drin steht ist die > Hoodfile defekt. Ich würde eher versuchen weiterhin eine korrekte zu > bekommen und den Router nicht auf irgendwas (was vermutlich eh nicht > funktioniert) zu konfigurieren. > > Das ganze brachte mich aber auf eine Idee: > Eigentlich sollten die Router ihre angebotene Hoodfile dynamisch schreiben. > Zumindest sollte in der Hoodfile der Channel stehen, auf den das Gerät auch > eingestellt sind. Wenn ich nämlich bei mir die Channels aufteile (Kirchturm > mit 4 Sektoren zum Beispiel) und jemand im Nordsektor mit Kanal 5 die > Hoodfile mit Kanal 13 zieht, ist das irgendwie doof. > Im Moment ist ja das Gateway die Standardquelle, wenn du das so wie oben machen willst, müsste man das Konzept ändern, sodass immer ein w2sta aktiv ist und den Hoodfile von anderen Routern zieht. Weiß nicht, ob mir das gefällt. > Also wäre es toll, wenn der Router der auf Kanal 5 ist, in die Hoodfile auch > Kanal 5 schreibt. > > Dadurch kann dann auch problemlos der Kanal nach Lust & Lauen geändert > werden, Meshrouter machen diese Änderung mit ("Oh kein GW mehr? > Machen wir mal STA und holen uns die aktuellste json wo der neue Kanal > drinnen > steht...") Siehe oben. In der jetzigen Konfiguration würde so permanent zwischen Normalbetrieb (w2ap/w2mesh) und w2sta hin- und hergeschaltet. > > Problem dabei, Meshrouter holen sich die File wärend des Betriebs vom > Gateway und da steht wieder 13 (im oberen Beispiel) drinnen. Das müsste > man auch irgendwie abfangen. Die Alternative wäre, jeweils lokal den Kanal zu überschreiben. Das wäre dann so ähnlich machbar wie für die SSID in meinem Patch, nur mit mehr Unwägbarkeiten: https://pw.freifunk-franken.de/patch/605/ Grüße Adrian > > Ich fände das schon sehr cool aber vermutlich doch recht aufwendig. > > mfg > > Christian > > > > > ? > > > >> -----Original Message----- > >> From: Fabian Bläse [mailto:fabian@blaese.de] > >> Sent: Freitag, 20. Oktober 2017 00:20 > >> To: mail@adrianschmutzler.de; franken-dev@freifunk.net > >> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway > >> > >> Was wollen wir tun, wenn im json kein Channel drin steht? Aktuell > >> dürfte das recht unschöne Fehlermeldungen geben. > >> > >> Fabian > >> > >>> On 19. Oct 2017, at 22:47, <mail@adrianschmutzler.de> > >> <mail@adrianschmutzler.de> wrote: > >>> > >>> Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > >>> > >>>> -----Original Message----- > >>>> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On > >> Behalf > >>>> Of Fabian Bläse > >>>> Sent: Donnerstag, 19. Oktober 2017 22:39 > >>>> To: Adrian Schmutzler <freifunk@adrianschmutzler.de> > >>>> Cc: franken-dev@freifunk.net > >>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway > >>>> > >>>> Tested-by: Fabian Bläse <fabian@blaese.de> > >>>> > >>>>> On 15. Oct 2017, at 11:29, Adrian Schmutzler > >>>> <freifunk@adrianschmutzler.de> wrote: > >>>>> > >>>>> Changes in v2: > >>>>> - rebase due to conflict with 802.11s > >>>>> > >>>>> Changes in v3: > >>>>> - Fix wrong variable name introduced in v2 > >>>>> > >>>>> Changes in v4: > >>>>> - Fixed comment > >>>>> - Fixed channel comparison for wXsta > >>>>> > >>>>> Changes in v5: > >>>>> - Make radio in wifiAddPhyCond local > >>>>> > >>>>> Changes in v6: > >>>>> - Rebase > >>>>> > >>>>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > >>>>> Signed-off-by: Fabian Bläse <fabian@blaese.de> > >>>>> --- > >>>>> .../fff/fff-hoods/files/usr/sbin/configurehood | 19 > ++++++++++++--- > >> --- > >>>> - > >>>>> .../fff/fff-wireless/files/lib/functions/fff/wireless | 17 > >>>>> ++++++++--------- > >>>>> 2 files changed, 20 insertions(+), 16 deletions(-) > >>>>> > >>>>> diff --git > >>>>> a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > >>>> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > >>>>> index 8ce9133..d64345f 100755 > >>>>> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > >>>>> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > >>>>> @@ -74,12 +74,17 @@ else > >>>>> fi > >>>>> #now we look for phy and add this > >>>>> for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do > >>>>> - radio="$(wifiAddPhyCond "$phy" "2" > "$chan2ghz")" > >>>>> - radio5="$(wifiAddPhyCond "$phy" "5" > "$chan5ghz")" > >>>>> - [ -n "$radio5" ] && radio="$radio5" > >>>>> + radio="$(wifiAddPhyCond "$phy" "2" "auto")" > >>>>> + radio5="$(wifiAddPhyCond "$phy" "5" > "auto5")" > >>>>> + if [ -n "$radio5" ] ; then > >>>>> + radio="$radio5" > >>>>> + staiface="w5sta" > >>>>> + else > >>>>> + staiface="w2sta" > >>>>> + fi > >>>>> > >>>>> #and here we add the station > >>>>> - if ! wifiAddSta "$radio" > "config.franken.freifunk.net" > >>>> "configSta"; then > >>>>> + if ! wifiAddSta "$radio" > "config.franken.freifunk.net" > >>>> "configSta" "$staiface" ; then > >>>>> echo "Can't add Sta interface on $radio." > >>>>> exit 1 > >>>>> else > >>>>> @@ -124,11 +129,11 @@ if [ -s /tmp/keyxchangev2data ]; then > >>>>> json_get_var mesh_essid mesh_essid > >>>>> json_get_var essid essid > >>>>> json_get_var ntpip ntp_ip > >>>>> - # i think the next things we don't active this in the first > >>>> version! we can do it later > >>>>> - #json_get_var channel2 channel2 > >>>>> + # Additional parameters may be activated in future > versions > >>>>> + json_get_var chan2ghz channel2 > >>>>> #json_get_var mode2 mode2 > >>>>> json_get_var mesh_type2 mesh_type2 > >>>>> - #json_get_var channel5 channel5 > >>>>> + json_get_var chan5ghz channel5 > >>>>> #json_get_var mode5 mode5 > >>>>> json_get_var mesh_type5 mesh_type5 > >>>>> #json_get_var protocol protocol > >>>>> diff --git > >>>>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > >>>> b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > >>>>> index 7e418c2..b1ff5a9 100644 > >>>>> --- > >>>>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > >>>>> +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wirele > >>>>> +++ ss > >>>>> @@ -25,7 +25,10 @@ wifiAddPhy() { > >>>>> local channel=$2 > >>>>> local radio="radio$(echo "$phy" | tr -d -C "0-9")" > >>>>> local hwmode="11g" > >>>>> - if [ "$channel" -gt "14" ]; then > >>>>> + if [ "$channel" = "auto5" ] ; then > >>>>> + hwmode="11a" > >>>>> + channel="auto" > >>>>> + elif ( ! [ "$channel" = "auto" ] ) && [ "$channel" -gt "14" ]; > >>>>> +then > >>>>> hwmode="11a" > >>>>> fi > >>>>> > >>>>> @@ -60,7 +63,7 @@ wifiAddPhyCond() { > >>>>> local freq=$2 > >>>>> local channel=$3 > >>>>> local radio="" > >>>>> - > >>>>> + > >>>>> if iw phy "$phy" info | grep -q -m1 "${freq}... MHz"; then > >>>>> radio="$(wifiAddPhy "$phy" "$channel")" > >>>>> if [ -z "$radio" ]; then > >>>>> @@ -148,21 +151,17 @@ wifiAddAP() { } > >>>>> > >>>>> wifiAddSta() { > >>>>> - if [ $# -ne "3" ] > >>>>> + if [ $# -ne "4" ] > >>>>> then > >>>>> - echo "Usage: wifiAddSta <radio> <essid> <network>" > >>>>> + echo "Usage: wifiAddSta <radio> <essid> <network> > <iface>" > >>>>> return 1 > >>>>> fi > >>>>> > >>>>> local radio=$1 > >>>>> local essid=$2 > >>>>> local network=$3 > >>>>> + local iface=$4 > >>>>> > >>>>> - local channel=$(uci get "wireless.${radio}.channel") > >>>>> - local iface="w2sta" > >>>>> - if [ "$channel" -gt "14" ]; then > >>>>> - iface="w5sta" > >>>>> - fi > >>>>> uci batch <<-__EOF__ > >>>>> set wireless.${iface}='wifi-iface' > >>>>> set wireless.${iface}.device='${radio}' > >>>>> -- > >>>>> 2.7.4 > >>>>> > >>> > >>> > >>> -- > >>> franken-dev mailing list > >>> franken-dev@freifunk.net > >>> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net > > > >
hi On 20.10.2017 12:43, Adrian Schmutzler wrote: > Hallo, > > siehe unten. > >> -----Original Message----- >> From: Christian Dresel [mailto:fff@chrisi01.de] >> Sent: Freitag, 20. Oktober 2017 08:18 >> To: mail@adrianschmutzler.de; franken-dev@freifunk.net; 'Fabian Bläse' >> <fabian@blaese.de> >> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >> >> Hi >> >> On 20.10.2017 00:30, mail@adrianschmutzler.de wrote: >>> Wie wärs mit >>> >>> [ -z "$chan2ghz" ] && chan2ghz="1" >> >> weiß nicht ob das ne gute Idee ist? Wenn kein Channel drin steht ist die >> Hoodfile defekt. Ich würde eher versuchen weiterhin eine korrekte zu >> bekommen und den Router nicht auf irgendwas (was vermutlich eh nicht >> funktioniert) zu konfigurieren. >> >> Das ganze brachte mich aber auf eine Idee: >> Eigentlich sollten die Router ihre angebotene Hoodfile dynamisch schreiben. >> Zumindest sollte in der Hoodfile der Channel stehen, auf den das Gerät auch >> eingestellt sind. Wenn ich nämlich bei mir die Channels aufteile (Kirchturm >> mit 4 Sektoren zum Beispiel) und jemand im Nordsektor mit Kanal 5 die >> Hoodfile mit Kanal 13 zieht, ist das irgendwie doof. >> > > Im Moment ist ja das Gateway die Standardquelle, wenn du das so wie oben machen willst, müsste man das Konzept ändern, sodass immer ein w2sta aktiv ist und den Hoodfile von anderen Routern zieht. Weiß nicht, ob mir das gefällt. nicht zwingend, man kann auch per w2mesh (AdHoc/11s) direkt ohne Routing/Batman mit den direkten Nachbarn kommunizieren ;) Lass mal 2 Geräte meshen und probier auf einen: ping6 fe80::MAC:VON:W2MESH:IF:DES:NACHBARN%w2mesh voila Kommunikation vorbei am Batman direkt übers AdHoc/11s Netzwerk, wenn das w2mesh nun am Nachbar fe80::1 hätte, könnte man auch wget fe80::1%w2mesh machen... nur mal so zum überlegen. mfg Christian > >> Also wäre es toll, wenn der Router der auf Kanal 5 ist, in die Hoodfile auch >> Kanal 5 schreibt. >> >> Dadurch kann dann auch problemlos der Kanal nach Lust & Lauen geändert >> werden, Meshrouter machen diese Änderung mit ("Oh kein GW mehr? >> Machen wir mal STA und holen uns die aktuellste json wo der neue Kanal >> drinnen >> steht...") > > Siehe oben. In der jetzigen Konfiguration würde so permanent zwischen Normalbetrieb (w2ap/w2mesh) und w2sta hin- und hergeschaltet. > >> >> Problem dabei, Meshrouter holen sich die File wärend des Betriebs vom >> Gateway und da steht wieder 13 (im oberen Beispiel) drinnen. Das müsste >> man auch irgendwie abfangen. > > Die Alternative wäre, jeweils lokal den Kanal zu überschreiben. Das wäre dann so ähnlich machbar wie für die SSID in meinem Patch, nur mit mehr Unwägbarkeiten: > > https://pw.freifunk-franken.de/patch/605/ > > Grüße > > Adrian > >> >> Ich fände das schon sehr cool aber vermutlich doch recht aufwendig. >> >> mfg >> >> Christian >> >>> >>> ? >>> >>>> -----Original Message----- >>>> From: Fabian Bläse [mailto:fabian@blaese.de] >>>> Sent: Freitag, 20. Oktober 2017 00:20 >>>> To: mail@adrianschmutzler.de; franken-dev@freifunk.net >>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >>>> >>>> Was wollen wir tun, wenn im json kein Channel drin steht? Aktuell >>>> dürfte das recht unschöne Fehlermeldungen geben. >>>> >>>> Fabian >>>> >>>>> On 19. Oct 2017, at 22:47, <mail@adrianschmutzler.de> >>>> <mail@adrianschmutzler.de> wrote: >>>>> >>>>> Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>>> >>>>>> -----Original Message----- >>>>>> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On >>>> Behalf >>>>>> Of Fabian Bläse >>>>>> Sent: Donnerstag, 19. Oktober 2017 22:39 >>>>>> To: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>>>> Cc: franken-dev@freifunk.net >>>>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >>>>>> >>>>>> Tested-by: Fabian Bläse <fabian@blaese.de> >>>>>> >>>>>>> On 15. Oct 2017, at 11:29, Adrian Schmutzler >>>>>> <freifunk@adrianschmutzler.de> wrote: >>>>>>> >>>>>>> Changes in v2: >>>>>>> - rebase due to conflict with 802.11s >>>>>>> >>>>>>> Changes in v3: >>>>>>> - Fix wrong variable name introduced in v2 >>>>>>> >>>>>>> Changes in v4: >>>>>>> - Fixed comment >>>>>>> - Fixed channel comparison for wXsta >>>>>>> >>>>>>> Changes in v5: >>>>>>> - Make radio in wifiAddPhyCond local >>>>>>> >>>>>>> Changes in v6: >>>>>>> - Rebase >>>>>>> >>>>>>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>>>>> Signed-off-by: Fabian Bläse <fabian@blaese.de> >>>>>>> --- >>>>>>> .../fff/fff-hoods/files/usr/sbin/configurehood | 19 >> ++++++++++++--- >>>> --- >>>>>> - >>>>>>> .../fff/fff-wireless/files/lib/functions/fff/wireless | 17 >>>>>>> ++++++++--------- >>>>>>> 2 files changed, 20 insertions(+), 16 deletions(-) >>>>>>> >>>>>>> diff --git >>>>>>> a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>>> index 8ce9133..d64345f 100755 >>>>>>> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>>> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>>> @@ -74,12 +74,17 @@ else >>>>>>> fi >>>>>>> #now we look for phy and add this >>>>>>> for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do >>>>>>> - radio="$(wifiAddPhyCond "$phy" "2" >> "$chan2ghz")" >>>>>>> - radio5="$(wifiAddPhyCond "$phy" "5" >> "$chan5ghz")" >>>>>>> - [ -n "$radio5" ] && radio="$radio5" >>>>>>> + radio="$(wifiAddPhyCond "$phy" "2" "auto")" >>>>>>> + radio5="$(wifiAddPhyCond "$phy" "5" >> "auto5")" >>>>>>> + if [ -n "$radio5" ] ; then >>>>>>> + radio="$radio5" >>>>>>> + staiface="w5sta" >>>>>>> + else >>>>>>> + staiface="w2sta" >>>>>>> + fi >>>>>>> >>>>>>> #and here we add the station >>>>>>> - if ! wifiAddSta "$radio" >> "config.franken.freifunk.net" >>>>>> "configSta"; then >>>>>>> + if ! wifiAddSta "$radio" >> "config.franken.freifunk.net" >>>>>> "configSta" "$staiface" ; then >>>>>>> echo "Can't add Sta interface on $radio." >>>>>>> exit 1 >>>>>>> else >>>>>>> @@ -124,11 +129,11 @@ if [ -s /tmp/keyxchangev2data ]; then >>>>>>> json_get_var mesh_essid mesh_essid >>>>>>> json_get_var essid essid >>>>>>> json_get_var ntpip ntp_ip >>>>>>> - # i think the next things we don't active this in the first >>>>>> version! we can do it later >>>>>>> - #json_get_var channel2 channel2 >>>>>>> + # Additional parameters may be activated in future >> versions >>>>>>> + json_get_var chan2ghz channel2 >>>>>>> #json_get_var mode2 mode2 >>>>>>> json_get_var mesh_type2 mesh_type2 >>>>>>> - #json_get_var channel5 channel5 >>>>>>> + json_get_var chan5ghz channel5 >>>>>>> #json_get_var mode5 mode5 >>>>>>> json_get_var mesh_type5 mesh_type5 >>>>>>> #json_get_var protocol protocol >>>>>>> diff --git >>>>>>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>>> b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>>>> index 7e418c2..b1ff5a9 100644 >>>>>>> --- >>>>>>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>>>> +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wirele >>>>>>> +++ ss >>>>>>> @@ -25,7 +25,10 @@ wifiAddPhy() { >>>>>>> local channel=$2 >>>>>>> local radio="radio$(echo "$phy" | tr -d -C "0-9")" >>>>>>> local hwmode="11g" >>>>>>> - if [ "$channel" -gt "14" ]; then >>>>>>> + if [ "$channel" = "auto5" ] ; then >>>>>>> + hwmode="11a" >>>>>>> + channel="auto" >>>>>>> + elif ( ! [ "$channel" = "auto" ] ) && [ "$channel" -gt "14" ]; >>>>>>> +then >>>>>>> hwmode="11a" >>>>>>> fi >>>>>>> >>>>>>> @@ -60,7 +63,7 @@ wifiAddPhyCond() { >>>>>>> local freq=$2 >>>>>>> local channel=$3 >>>>>>> local radio="" >>>>>>> - >>>>>>> + >>>>>>> if iw phy "$phy" info | grep -q -m1 "${freq}... MHz"; then >>>>>>> radio="$(wifiAddPhy "$phy" "$channel")" >>>>>>> if [ -z "$radio" ]; then >>>>>>> @@ -148,21 +151,17 @@ wifiAddAP() { } >>>>>>> >>>>>>> wifiAddSta() { >>>>>>> - if [ $# -ne "3" ] >>>>>>> + if [ $# -ne "4" ] >>>>>>> then >>>>>>> - echo "Usage: wifiAddSta <radio> <essid> <network>" >>>>>>> + echo "Usage: wifiAddSta <radio> <essid> <network> >> <iface>" >>>>>>> return 1 >>>>>>> fi >>>>>>> >>>>>>> local radio=$1 >>>>>>> local essid=$2 >>>>>>> local network=$3 >>>>>>> + local iface=$4 >>>>>>> >>>>>>> - local channel=$(uci get "wireless.${radio}.channel") >>>>>>> - local iface="w2sta" >>>>>>> - if [ "$channel" -gt "14" ]; then >>>>>>> - iface="w5sta" >>>>>>> - fi >>>>>>> uci batch <<-__EOF__ >>>>>>> set wireless.${iface}='wifi-iface' >>>>>>> set wireless.${iface}.device='${radio}' >>>>>>> -- >>>>>>> 2.7.4 >>>>>>> >>>>> >>>>> >>>>> -- >>>>> franken-dev mailing list >>>>> franken-dev@freifunk.net >>>>> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net >>> >>> > >
Hallo Christian, das setzt aber andere ifs voraus, als wir im Moment gesetzt haben, und außerdem bräuchten wir dann wahrscheinlich wirklich fblaeses Patch damit die Port für configap und Gateway gleich bleiben. Grüße Adrian > -----Original Message----- > From: Christian Dresel [mailto:fff@chrisi01.de] > Sent: Freitag, 20. Oktober 2017 12:46 > To: Adrian Schmutzler <mail@adrianschmutzler.de>; franken- > dev@freifunk.net > Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway > > hi > > On 20.10.2017 12:43, Adrian Schmutzler wrote: > > Hallo, > > > > siehe unten. > > > >> -----Original Message----- > >> From: Christian Dresel [mailto:fff@chrisi01.de] > >> Sent: Freitag, 20. Oktober 2017 08:18 > >> To: mail@adrianschmutzler.de; franken-dev@freifunk.net; 'Fabian Bläse' > >> <fabian@blaese.de> > >> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway > >> > >> Hi > >> > >> On 20.10.2017 00:30, mail@adrianschmutzler.de wrote: > >>> Wie wärs mit > >>> > >>> [ -z "$chan2ghz" ] && chan2ghz="1" > >> > >> weiß nicht ob das ne gute Idee ist? Wenn kein Channel drin steht ist > >> die Hoodfile defekt. Ich würde eher versuchen weiterhin eine korrekte > >> zu bekommen und den Router nicht auf irgendwas (was vermutlich eh > >> nicht > >> funktioniert) zu konfigurieren. > >> > >> Das ganze brachte mich aber auf eine Idee: > >> Eigentlich sollten die Router ihre angebotene Hoodfile dynamisch > schreiben. > >> Zumindest sollte in der Hoodfile der Channel stehen, auf den das > >> Gerät auch eingestellt sind. Wenn ich nämlich bei mir die Channels > >> aufteile (Kirchturm mit 4 Sektoren zum Beispiel) und jemand im > >> Nordsektor mit Kanal 5 die Hoodfile mit Kanal 13 zieht, ist das irgendwie > doof. > >> > > > > Im Moment ist ja das Gateway die Standardquelle, wenn du das so wie > oben machen willst, müsste man das Konzept ändern, sodass immer ein > w2sta aktiv ist und den Hoodfile von anderen Routern zieht. Weiß nicht, ob > mir das gefällt. > > nicht zwingend, man kann auch per w2mesh (AdHoc/11s) direkt ohne > Routing/Batman mit den direkten Nachbarn kommunizieren ;) Lass mal 2 > Geräte meshen und probier auf einen: > > ping6 fe80::MAC:VON:W2MESH:IF:DES:NACHBARN%w2mesh > > voila Kommunikation vorbei am Batman direkt übers AdHoc/11s Netzwerk, > wenn das w2mesh nun am Nachbar fe80::1 hätte, könnte man auch wget > fe80::1%w2mesh machen... > > nur mal so zum überlegen. > > mfg > > Christian > > > > >> Also wäre es toll, wenn der Router der auf Kanal 5 ist, in die > >> Hoodfile auch Kanal 5 schreibt. > >> > >> Dadurch kann dann auch problemlos der Kanal nach Lust & Lauen > >> geändert werden, Meshrouter machen diese Änderung mit ("Oh kein GW > mehr? > >> Machen wir mal STA und holen uns die aktuellste json wo der neue > >> Kanal drinnen > >> steht...") > > > > Siehe oben. In der jetzigen Konfiguration würde so permanent zwischen > Normalbetrieb (w2ap/w2mesh) und w2sta hin- und hergeschaltet. > > > >> > >> Problem dabei, Meshrouter holen sich die File wärend des Betriebs vom > >> Gateway und da steht wieder 13 (im oberen Beispiel) drinnen. Das > >> müsste man auch irgendwie abfangen. > > > > Die Alternative wäre, jeweils lokal den Kanal zu überschreiben. Das wäre > dann so ähnlich machbar wie für die SSID in meinem Patch, nur mit mehr > Unwägbarkeiten: > > > > https://pw.freifunk-franken.de/patch/605/ > > > > Grüße > > > > Adrian > > > >> > >> Ich fände das schon sehr cool aber vermutlich doch recht aufwendig. > >> > >> mfg > >> > >> Christian > >> > >>> > >>> ? > >>> > >>>> -----Original Message----- > >>>> From: Fabian Bläse [mailto:fabian@blaese.de] > >>>> Sent: Freitag, 20. Oktober 2017 00:20 > >>>> To: mail@adrianschmutzler.de; franken-dev@freifunk.net > >>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway > >>>> > >>>> Was wollen wir tun, wenn im json kein Channel drin steht? Aktuell > >>>> dürfte das recht unschöne Fehlermeldungen geben. > >>>> > >>>> Fabian > >>>> > >>>>> On 19. Oct 2017, at 22:47, <mail@adrianschmutzler.de> > >>>> <mail@adrianschmutzler.de> wrote: > >>>>> > >>>>> Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > >>>>> > >>>>>> -----Original Message----- > >>>>>> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On > >>>> Behalf > >>>>>> Of Fabian Bläse > >>>>>> Sent: Donnerstag, 19. Oktober 2017 22:39 > >>>>>> To: Adrian Schmutzler <freifunk@adrianschmutzler.de> > >>>>>> Cc: franken-dev@freifunk.net > >>>>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by > >>>>>> gateway > >>>>>> > >>>>>> Tested-by: Fabian Bläse <fabian@blaese.de> > >>>>>> > >>>>>>> On 15. Oct 2017, at 11:29, Adrian Schmutzler > >>>>>> <freifunk@adrianschmutzler.de> wrote: > >>>>>>> > >>>>>>> Changes in v2: > >>>>>>> - rebase due to conflict with 802.11s > >>>>>>> > >>>>>>> Changes in v3: > >>>>>>> - Fix wrong variable name introduced in v2 > >>>>>>> > >>>>>>> Changes in v4: > >>>>>>> - Fixed comment > >>>>>>> - Fixed channel comparison for wXsta > >>>>>>> > >>>>>>> Changes in v5: > >>>>>>> - Make radio in wifiAddPhyCond local > >>>>>>> > >>>>>>> Changes in v6: > >>>>>>> - Rebase > >>>>>>> > >>>>>>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > >>>>>>> Signed-off-by: Fabian Bläse <fabian@blaese.de> > >>>>>>> --- > >>>>>>> .../fff/fff-hoods/files/usr/sbin/configurehood | 19 > >> ++++++++++++--- > >>>> --- > >>>>>> - > >>>>>>> .../fff/fff-wireless/files/lib/functions/fff/wireless | 17 > >>>>>>> ++++++++--------- > >>>>>>> 2 files changed, 20 insertions(+), 16 deletions(-) > >>>>>>> > >>>>>>> diff --git > >>>>>>> a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > >>>>>> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > >>>>>>> index 8ce9133..d64345f 100755 > >>>>>>> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > >>>>>>> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > >>>>>>> @@ -74,12 +74,17 @@ else > >>>>>>> fi > >>>>>>> #now we look for phy and add this > >>>>>>> for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do > >>>>>>> - radio="$(wifiAddPhyCond "$phy" "2" > >> "$chan2ghz")" > >>>>>>> - radio5="$(wifiAddPhyCond "$phy" "5" > >> "$chan5ghz")" > >>>>>>> - [ -n "$radio5" ] && radio="$radio5" > >>>>>>> + radio="$(wifiAddPhyCond "$phy" "2" "auto")" > >>>>>>> + radio5="$(wifiAddPhyCond "$phy" "5" > >> "auto5")" > >>>>>>> + if [ -n "$radio5" ] ; then > >>>>>>> + radio="$radio5" > >>>>>>> + staiface="w5sta" > >>>>>>> + else > >>>>>>> + staiface="w2sta" > >>>>>>> + fi > >>>>>>> > >>>>>>> #and here we add the station > >>>>>>> - if ! wifiAddSta "$radio" > >> "config.franken.freifunk.net" > >>>>>> "configSta"; then > >>>>>>> + if ! wifiAddSta "$radio" > >> "config.franken.freifunk.net" > >>>>>> "configSta" "$staiface" ; then > >>>>>>> echo "Can't add Sta interface on > $radio." > >>>>>>> exit 1 > >>>>>>> else > >>>>>>> @@ -124,11 +129,11 @@ if [ -s /tmp/keyxchangev2data ]; then > >>>>>>> json_get_var mesh_essid mesh_essid > >>>>>>> json_get_var essid essid > >>>>>>> json_get_var ntpip ntp_ip > >>>>>>> - # i think the next things we don't active this in the first > >>>>>> version! we can do it later > >>>>>>> - #json_get_var channel2 channel2 > >>>>>>> + # Additional parameters may be activated in future > >> versions > >>>>>>> + json_get_var chan2ghz channel2 > >>>>>>> #json_get_var mode2 mode2 > >>>>>>> json_get_var mesh_type2 mesh_type2 > >>>>>>> - #json_get_var channel5 channel5 > >>>>>>> + json_get_var chan5ghz channel5 > >>>>>>> #json_get_var mode5 mode5 > >>>>>>> json_get_var mesh_type5 mesh_type5 > >>>>>>> #json_get_var protocol protocol diff --git > >>>>>>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > >>>>>> b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > >>>>>>> index 7e418c2..b1ff5a9 100644 > >>>>>>> --- > >>>>>>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless > >>>>>>> +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wire > >>>>>>> +++ le > >>>>>>> +++ ss > >>>>>>> @@ -25,7 +25,10 @@ wifiAddPhy() { > >>>>>>> local channel=$2 > >>>>>>> local radio="radio$(echo "$phy" | tr -d -C "0-9")" > >>>>>>> local hwmode="11g" > >>>>>>> - if [ "$channel" -gt "14" ]; then > >>>>>>> + if [ "$channel" = "auto5" ] ; then > >>>>>>> + hwmode="11a" > >>>>>>> + channel="auto" > >>>>>>> + elif ( ! [ "$channel" = "auto" ] ) && [ "$channel" -gt "14" ]; > >>>>>>> +then > >>>>>>> hwmode="11a" > >>>>>>> fi > >>>>>>> > >>>>>>> @@ -60,7 +63,7 @@ wifiAddPhyCond() { > >>>>>>> local freq=$2 > >>>>>>> local channel=$3 > >>>>>>> local radio="" > >>>>>>> - > >>>>>>> + > >>>>>>> if iw phy "$phy" info | grep -q -m1 "${freq}... MHz"; then > >>>>>>> radio="$(wifiAddPhy "$phy" "$channel")" > >>>>>>> if [ -z "$radio" ]; then > >>>>>>> @@ -148,21 +151,17 @@ wifiAddAP() { } > >>>>>>> > >>>>>>> wifiAddSta() { > >>>>>>> - if [ $# -ne "3" ] > >>>>>>> + if [ $# -ne "4" ] > >>>>>>> then > >>>>>>> - echo "Usage: wifiAddSta <radio> <essid> <network>" > >>>>>>> + echo "Usage: wifiAddSta <radio> <essid> <network> > >> <iface>" > >>>>>>> return 1 > >>>>>>> fi > >>>>>>> > >>>>>>> local radio=$1 > >>>>>>> local essid=$2 > >>>>>>> local network=$3 > >>>>>>> + local iface=$4 > >>>>>>> > >>>>>>> - local channel=$(uci get "wireless.${radio}.channel") > >>>>>>> - local iface="w2sta" > >>>>>>> - if [ "$channel" -gt "14" ]; then > >>>>>>> - iface="w5sta" > >>>>>>> - fi > >>>>>>> uci batch <<-__EOF__ > >>>>>>> set wireless.${iface}='wifi-iface' > >>>>>>> set wireless.${iface}.device='${radio}' > >>>>>>> -- > >>>>>>> 2.7.4 > >>>>>>> > >>>>> > >>>>> > >>>>> -- > >>>>> franken-dev mailing list > >>>>> franken-dev@freifunk.net > >>>>> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.ne > >>>>> t > >>> > >>> > > > >
hi Ja natürlich das wäre ein größerer Umbau. Ist mir vorhin erst eingefallen die Idee als ich die Mail schon weggeschickt hatte. Ich denke man sollte es mal in Erwägung ziehen ob man dorthin will (und ob es techn. überhaupt klappen würde, bisher ist es nur eine Spinnerei im Kopf) der Vorteil das man am Router recht problemlos den Kanal ändern kann (hauptsächlich Uplinkrouter oder Router die per Kabel Batman bekommen, bei reinen Meshrouter ist es recht sinnlos), weil Meshrouter automatisch da mitziehen würde ich mal nicht unterschätzen. mfg Christian On 20.10.2017 12:49, Adrian Schmutzler wrote: > Hallo Christian, > > das setzt aber andere ifs voraus, als wir im Moment gesetzt haben, und außerdem bräuchten wir dann wahrscheinlich wirklich fblaeses Patch damit die Port für configap und Gateway gleich bleiben. > > Grüße > > Adrian > >> -----Original Message----- >> From: Christian Dresel [mailto:fff@chrisi01.de] >> Sent: Freitag, 20. Oktober 2017 12:46 >> To: Adrian Schmutzler <mail@adrianschmutzler.de>; franken- >> dev@freifunk.net >> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >> >> hi >> >> On 20.10.2017 12:43, Adrian Schmutzler wrote: >>> Hallo, >>> >>> siehe unten. >>> >>>> -----Original Message----- >>>> From: Christian Dresel [mailto:fff@chrisi01.de] >>>> Sent: Freitag, 20. Oktober 2017 08:18 >>>> To: mail@adrianschmutzler.de; franken-dev@freifunk.net; 'Fabian Bläse' >>>> <fabian@blaese.de> >>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >>>> >>>> Hi >>>> >>>> On 20.10.2017 00:30, mail@adrianschmutzler.de wrote: >>>>> Wie wärs mit >>>>> >>>>> [ -z "$chan2ghz" ] && chan2ghz="1" >>>> >>>> weiß nicht ob das ne gute Idee ist? Wenn kein Channel drin steht ist >>>> die Hoodfile defekt. Ich würde eher versuchen weiterhin eine korrekte >>>> zu bekommen und den Router nicht auf irgendwas (was vermutlich eh >>>> nicht >>>> funktioniert) zu konfigurieren. >>>> >>>> Das ganze brachte mich aber auf eine Idee: >>>> Eigentlich sollten die Router ihre angebotene Hoodfile dynamisch >> schreiben. >>>> Zumindest sollte in der Hoodfile der Channel stehen, auf den das >>>> Gerät auch eingestellt sind. Wenn ich nämlich bei mir die Channels >>>> aufteile (Kirchturm mit 4 Sektoren zum Beispiel) und jemand im >>>> Nordsektor mit Kanal 5 die Hoodfile mit Kanal 13 zieht, ist das irgendwie >> doof. >>>> >>> >>> Im Moment ist ja das Gateway die Standardquelle, wenn du das so wie >> oben machen willst, müsste man das Konzept ändern, sodass immer ein >> w2sta aktiv ist und den Hoodfile von anderen Routern zieht. Weiß nicht, ob >> mir das gefällt. >> >> nicht zwingend, man kann auch per w2mesh (AdHoc/11s) direkt ohne >> Routing/Batman mit den direkten Nachbarn kommunizieren ;) Lass mal 2 >> Geräte meshen und probier auf einen: >> >> ping6 fe80::MAC:VON:W2MESH:IF:DES:NACHBARN%w2mesh >> >> voila Kommunikation vorbei am Batman direkt übers AdHoc/11s Netzwerk, >> wenn das w2mesh nun am Nachbar fe80::1 hätte, könnte man auch wget >> fe80::1%w2mesh machen... >> >> nur mal so zum überlegen. >> >> mfg >> >> Christian >> >>> >>>> Also wäre es toll, wenn der Router der auf Kanal 5 ist, in die >>>> Hoodfile auch Kanal 5 schreibt. >>>> >>>> Dadurch kann dann auch problemlos der Kanal nach Lust & Lauen >>>> geändert werden, Meshrouter machen diese Änderung mit ("Oh kein GW >> mehr? >>>> Machen wir mal STA und holen uns die aktuellste json wo der neue >>>> Kanal drinnen >>>> steht...") >>> >>> Siehe oben. In der jetzigen Konfiguration würde so permanent zwischen >> Normalbetrieb (w2ap/w2mesh) und w2sta hin- und hergeschaltet. >>> >>>> >>>> Problem dabei, Meshrouter holen sich die File wärend des Betriebs vom >>>> Gateway und da steht wieder 13 (im oberen Beispiel) drinnen. Das >>>> müsste man auch irgendwie abfangen. >>> >>> Die Alternative wäre, jeweils lokal den Kanal zu überschreiben. Das wäre >> dann so ähnlich machbar wie für die SSID in meinem Patch, nur mit mehr >> Unwägbarkeiten: >>> >>> https://pw.freifunk-franken.de/patch/605/ >>> >>> Grüße >>> >>> Adrian >>> >>>> >>>> Ich fände das schon sehr cool aber vermutlich doch recht aufwendig. >>>> >>>> mfg >>>> >>>> Christian >>>> >>>>> >>>>> ? >>>>> >>>>>> -----Original Message----- >>>>>> From: Fabian Bläse [mailto:fabian@blaese.de] >>>>>> Sent: Freitag, 20. Oktober 2017 00:20 >>>>>> To: mail@adrianschmutzler.de; franken-dev@freifunk.net >>>>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >>>>>> >>>>>> Was wollen wir tun, wenn im json kein Channel drin steht? Aktuell >>>>>> dürfte das recht unschöne Fehlermeldungen geben. >>>>>> >>>>>> Fabian >>>>>> >>>>>>> On 19. Oct 2017, at 22:47, <mail@adrianschmutzler.de> >>>>>> <mail@adrianschmutzler.de> wrote: >>>>>>> >>>>>>> Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>>>>> >>>>>>>> -----Original Message----- >>>>>>>> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On >>>>>> Behalf >>>>>>>> Of Fabian Bläse >>>>>>>> Sent: Donnerstag, 19. Oktober 2017 22:39 >>>>>>>> To: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>>>>>> Cc: franken-dev@freifunk.net >>>>>>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by >>>>>>>> gateway >>>>>>>> >>>>>>>> Tested-by: Fabian Bläse <fabian@blaese.de> >>>>>>>> >>>>>>>>> On 15. Oct 2017, at 11:29, Adrian Schmutzler >>>>>>>> <freifunk@adrianschmutzler.de> wrote: >>>>>>>>> >>>>>>>>> Changes in v2: >>>>>>>>> - rebase due to conflict with 802.11s >>>>>>>>> >>>>>>>>> Changes in v3: >>>>>>>>> - Fix wrong variable name introduced in v2 >>>>>>>>> >>>>>>>>> Changes in v4: >>>>>>>>> - Fixed comment >>>>>>>>> - Fixed channel comparison for wXsta >>>>>>>>> >>>>>>>>> Changes in v5: >>>>>>>>> - Make radio in wifiAddPhyCond local >>>>>>>>> >>>>>>>>> Changes in v6: >>>>>>>>> - Rebase >>>>>>>>> >>>>>>>>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>>>>>>> Signed-off-by: Fabian Bläse <fabian@blaese.de> >>>>>>>>> --- >>>>>>>>> .../fff/fff-hoods/files/usr/sbin/configurehood | 19 >>>> ++++++++++++--- >>>>>> --- >>>>>>>> - >>>>>>>>> .../fff/fff-wireless/files/lib/functions/fff/wireless | 17 >>>>>>>>> ++++++++--------- >>>>>>>>> 2 files changed, 20 insertions(+), 16 deletions(-) >>>>>>>>> >>>>>>>>> diff --git >>>>>>>>> a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>>>> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>>>>> index 8ce9133..d64345f 100755 >>>>>>>>> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>>>>> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>>>>> @@ -74,12 +74,17 @@ else >>>>>>>>> fi >>>>>>>>> #now we look for phy and add this >>>>>>>>> for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do >>>>>>>>> - radio="$(wifiAddPhyCond "$phy" "2" >>>> "$chan2ghz")" >>>>>>>>> - radio5="$(wifiAddPhyCond "$phy" "5" >>>> "$chan5ghz")" >>>>>>>>> - [ -n "$radio5" ] && radio="$radio5" >>>>>>>>> + radio="$(wifiAddPhyCond "$phy" "2" "auto")" >>>>>>>>> + radio5="$(wifiAddPhyCond "$phy" "5" >>>> "auto5")" >>>>>>>>> + if [ -n "$radio5" ] ; then >>>>>>>>> + radio="$radio5" >>>>>>>>> + staiface="w5sta" >>>>>>>>> + else >>>>>>>>> + staiface="w2sta" >>>>>>>>> + fi >>>>>>>>> >>>>>>>>> #and here we add the station >>>>>>>>> - if ! wifiAddSta "$radio" >>>> "config.franken.freifunk.net" >>>>>>>> "configSta"; then >>>>>>>>> + if ! wifiAddSta "$radio" >>>> "config.franken.freifunk.net" >>>>>>>> "configSta" "$staiface" ; then >>>>>>>>> echo "Can't add Sta interface on >> $radio." >>>>>>>>> exit 1 >>>>>>>>> else >>>>>>>>> @@ -124,11 +129,11 @@ if [ -s /tmp/keyxchangev2data ]; then >>>>>>>>> json_get_var mesh_essid mesh_essid >>>>>>>>> json_get_var essid essid >>>>>>>>> json_get_var ntpip ntp_ip >>>>>>>>> - # i think the next things we don't active this in the first >>>>>>>> version! we can do it later >>>>>>>>> - #json_get_var channel2 channel2 >>>>>>>>> + # Additional parameters may be activated in future >>>> versions >>>>>>>>> + json_get_var chan2ghz channel2 >>>>>>>>> #json_get_var mode2 mode2 >>>>>>>>> json_get_var mesh_type2 mesh_type2 >>>>>>>>> - #json_get_var channel5 channel5 >>>>>>>>> + json_get_var chan5ghz channel5 >>>>>>>>> #json_get_var mode5 mode5 >>>>>>>>> json_get_var mesh_type5 mesh_type5 >>>>>>>>> #json_get_var protocol protocol diff --git >>>>>>>>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>>>>> b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>>>>>> index 7e418c2..b1ff5a9 100644 >>>>>>>>> --- >>>>>>>>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>>>>>> +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wire >>>>>>>>> +++ le >>>>>>>>> +++ ss >>>>>>>>> @@ -25,7 +25,10 @@ wifiAddPhy() { >>>>>>>>> local channel=$2 >>>>>>>>> local radio="radio$(echo "$phy" | tr -d -C "0-9")" >>>>>>>>> local hwmode="11g" >>>>>>>>> - if [ "$channel" -gt "14" ]; then >>>>>>>>> + if [ "$channel" = "auto5" ] ; then >>>>>>>>> + hwmode="11a" >>>>>>>>> + channel="auto" >>>>>>>>> + elif ( ! [ "$channel" = "auto" ] ) && [ "$channel" -gt "14" ]; >>>>>>>>> +then >>>>>>>>> hwmode="11a" >>>>>>>>> fi >>>>>>>>> >>>>>>>>> @@ -60,7 +63,7 @@ wifiAddPhyCond() { >>>>>>>>> local freq=$2 >>>>>>>>> local channel=$3 >>>>>>>>> local radio="" >>>>>>>>> - >>>>>>>>> + >>>>>>>>> if iw phy "$phy" info | grep -q -m1 "${freq}... MHz"; then >>>>>>>>> radio="$(wifiAddPhy "$phy" "$channel")" >>>>>>>>> if [ -z "$radio" ]; then >>>>>>>>> @@ -148,21 +151,17 @@ wifiAddAP() { } >>>>>>>>> >>>>>>>>> wifiAddSta() { >>>>>>>>> - if [ $# -ne "3" ] >>>>>>>>> + if [ $# -ne "4" ] >>>>>>>>> then >>>>>>>>> - echo "Usage: wifiAddSta <radio> <essid> <network>" >>>>>>>>> + echo "Usage: wifiAddSta <radio> <essid> <network> >>>> <iface>" >>>>>>>>> return 1 >>>>>>>>> fi >>>>>>>>> >>>>>>>>> local radio=$1 >>>>>>>>> local essid=$2 >>>>>>>>> local network=$3 >>>>>>>>> + local iface=$4 >>>>>>>>> >>>>>>>>> - local channel=$(uci get "wireless.${radio}.channel") >>>>>>>>> - local iface="w2sta" >>>>>>>>> - if [ "$channel" -gt "14" ]; then >>>>>>>>> - iface="w5sta" >>>>>>>>> - fi >>>>>>>>> uci batch <<-__EOF__ >>>>>>>>> set wireless.${iface}='wifi-iface' >>>>>>>>> set wireless.${iface}.device='${radio}' >>>>>>>>> -- >>>>>>>>> 2.7.4 >>>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> franken-dev mailing list >>>>>>> franken-dev@freifunk.net >>>>>>> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.ne >>>>>>> t >>>>> >>>>> >>> >>> > >
Hallo Christian, soweit technisch möglich will man auf jeden Fall dorthin (zumindest ich). Man würde damit auch ein wenig vom Gateway unabhängiger werden, dann hat man nicht so einen harten Single Point of Failure. Würde ich aber von der Priorität erstmal etwas nach hinten schieben. Ist eigentlich schon geklärt, was mit den fe80::1 Anfragen passiert, wenn es mehrere Gateways gibt? Den Patch brauchen wir sowieso spätestens um die Gateway Firmware vernünftig zu machen. Daher sollte der auf jeden Fall schon mit in die erste alpha, um keine Kompatibilität zu brechen. Fabian > On 20. Oct 2017, at 12:52, Christian Dresel <fff@chrisi01.de> wrote: > > hi > > Ja natürlich das wäre ein größerer Umbau. Ist mir vorhin erst > eingefallen die Idee als ich die Mail schon weggeschickt hatte. Ich > denke man sollte es mal in Erwägung ziehen ob man dorthin will (und ob > es techn. überhaupt klappen würde, bisher ist es nur eine Spinnerei im > Kopf) der Vorteil das man am Router recht problemlos den Kanal ändern > kann (hauptsächlich Uplinkrouter oder Router die per Kabel Batman > bekommen, bei reinen Meshrouter ist es recht sinnlos), weil Meshrouter > automatisch da mitziehen würde ich mal nicht unterschätzen. > > mfg > > Christian > > On 20.10.2017 12:49, Adrian Schmutzler wrote: >> Hallo Christian, >> >> das setzt aber andere ifs voraus, als wir im Moment gesetzt haben, und außerdem bräuchten wir dann wahrscheinlich wirklich fblaeses Patch damit die Port für configap und Gateway gleich bleiben. >> >> Grüße >> >> Adrian >> >>> -----Original Message----- >>> From: Christian Dresel [mailto:fff@chrisi01.de] >>> Sent: Freitag, 20. Oktober 2017 12:46 >>> To: Adrian Schmutzler <mail@adrianschmutzler.de>; franken- >>> dev@freifunk.net >>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >>> >>> hi >>> >>> On 20.10.2017 12:43, Adrian Schmutzler wrote: >>>> Hallo, >>>> >>>> siehe unten. >>>> >>>>> -----Original Message----- >>>>> From: Christian Dresel [mailto:fff@chrisi01.de] >>>>> Sent: Freitag, 20. Oktober 2017 08:18 >>>>> To: mail@adrianschmutzler.de; franken-dev@freifunk.net; 'Fabian Bläse' >>>>> <fabian@blaese.de> >>>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >>>>> >>>>> Hi >>>>> >>>>> On 20.10.2017 00:30, mail@adrianschmutzler.de wrote: >>>>>> Wie wärs mit >>>>>> >>>>>> [ -z "$chan2ghz" ] && chan2ghz="1" >>>>> >>>>> weiß nicht ob das ne gute Idee ist? Wenn kein Channel drin steht ist >>>>> die Hoodfile defekt. Ich würde eher versuchen weiterhin eine korrekte >>>>> zu bekommen und den Router nicht auf irgendwas (was vermutlich eh >>>>> nicht >>>>> funktioniert) zu konfigurieren. >>>>> >>>>> Das ganze brachte mich aber auf eine Idee: >>>>> Eigentlich sollten die Router ihre angebotene Hoodfile dynamisch >>> schreiben. >>>>> Zumindest sollte in der Hoodfile der Channel stehen, auf den das >>>>> Gerät auch eingestellt sind. Wenn ich nämlich bei mir die Channels >>>>> aufteile (Kirchturm mit 4 Sektoren zum Beispiel) und jemand im >>>>> Nordsektor mit Kanal 5 die Hoodfile mit Kanal 13 zieht, ist das irgendwie >>> doof. >>>>> >>>> >>>> Im Moment ist ja das Gateway die Standardquelle, wenn du das so wie >>> oben machen willst, müsste man das Konzept ändern, sodass immer ein >>> w2sta aktiv ist und den Hoodfile von anderen Routern zieht. Weiß nicht, ob >>> mir das gefällt. >>> >>> nicht zwingend, man kann auch per w2mesh (AdHoc/11s) direkt ohne >>> Routing/Batman mit den direkten Nachbarn kommunizieren ;) Lass mal 2 >>> Geräte meshen und probier auf einen: >>> >>> ping6 fe80::MAC:VON:W2MESH:IF:DES:NACHBARN%w2mesh >>> >>> voila Kommunikation vorbei am Batman direkt übers AdHoc/11s Netzwerk, >>> wenn das w2mesh nun am Nachbar fe80::1 hätte, könnte man auch wget >>> fe80::1%w2mesh machen... >>> >>> nur mal so zum überlegen. >>> >>> mfg >>> >>> Christian >>> >>>> >>>>> Also wäre es toll, wenn der Router der auf Kanal 5 ist, in die >>>>> Hoodfile auch Kanal 5 schreibt. >>>>> >>>>> Dadurch kann dann auch problemlos der Kanal nach Lust & Lauen >>>>> geändert werden, Meshrouter machen diese Änderung mit ("Oh kein GW >>> mehr? >>>>> Machen wir mal STA und holen uns die aktuellste json wo der neue >>>>> Kanal drinnen >>>>> steht...") >>>> >>>> Siehe oben. In der jetzigen Konfiguration würde so permanent zwischen >>> Normalbetrieb (w2ap/w2mesh) und w2sta hin- und hergeschaltet. >>>> >>>>> >>>>> Problem dabei, Meshrouter holen sich die File wärend des Betriebs vom >>>>> Gateway und da steht wieder 13 (im oberen Beispiel) drinnen. Das >>>>> müsste man auch irgendwie abfangen. >>>> >>>> Die Alternative wäre, jeweils lokal den Kanal zu überschreiben. Das wäre >>> dann so ähnlich machbar wie für die SSID in meinem Patch, nur mit mehr >>> Unwägbarkeiten: >>>> >>>> https://pw.freifunk-franken.de/patch/605/ >>>> >>>> Grüße >>>> >>>> Adrian >>>> >>>>> >>>>> Ich fände das schon sehr cool aber vermutlich doch recht aufwendig. >>>>> >>>>> mfg >>>>> >>>>> Christian >>>>> >>>>>> >>>>>> ? >>>>>> >>>>>>> -----Original Message----- >>>>>>> From: Fabian Bläse [mailto:fabian@blaese.de] >>>>>>> Sent: Freitag, 20. Oktober 2017 00:20 >>>>>>> To: mail@adrianschmutzler.de; franken-dev@freifunk.net >>>>>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by gateway >>>>>>> >>>>>>> Was wollen wir tun, wenn im json kein Channel drin steht? Aktuell >>>>>>> dürfte das recht unschöne Fehlermeldungen geben. >>>>>>> >>>>>>> Fabian >>>>>>> >>>>>>>> On 19. Oct 2017, at 22:47, <mail@adrianschmutzler.de> >>>>>>> <mail@adrianschmutzler.de> wrote: >>>>>>>> >>>>>>>> Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>>>>>> >>>>>>>>> -----Original Message----- >>>>>>>>> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On >>>>>>> Behalf >>>>>>>>> Of Fabian Bläse >>>>>>>>> Sent: Donnerstag, 19. Oktober 2017 22:39 >>>>>>>>> To: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>>>>>>> Cc: franken-dev@freifunk.net >>>>>>>>> Subject: Re: [PATCH v6] fff-hoods: Use channel provided by >>>>>>>>> gateway >>>>>>>>> >>>>>>>>> Tested-by: Fabian Bläse <fabian@blaese.de> >>>>>>>>> >>>>>>>>>> On 15. Oct 2017, at 11:29, Adrian Schmutzler >>>>>>>>> <freifunk@adrianschmutzler.de> wrote: >>>>>>>>>> >>>>>>>>>> Changes in v2: >>>>>>>>>> - rebase due to conflict with 802.11s >>>>>>>>>> >>>>>>>>>> Changes in v3: >>>>>>>>>> - Fix wrong variable name introduced in v2 >>>>>>>>>> >>>>>>>>>> Changes in v4: >>>>>>>>>> - Fixed comment >>>>>>>>>> - Fixed channel comparison for wXsta >>>>>>>>>> >>>>>>>>>> Changes in v5: >>>>>>>>>> - Make radio in wifiAddPhyCond local >>>>>>>>>> >>>>>>>>>> Changes in v6: >>>>>>>>>> - Rebase >>>>>>>>>> >>>>>>>>>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> >>>>>>>>>> Signed-off-by: Fabian Bläse <fabian@blaese.de> >>>>>>>>>> --- >>>>>>>>>> .../fff/fff-hoods/files/usr/sbin/configurehood | 19 >>>>> ++++++++++++--- >>>>>>> --- >>>>>>>>> - >>>>>>>>>> .../fff/fff-wireless/files/lib/functions/fff/wireless | 17 >>>>>>>>>> ++++++++--------- >>>>>>>>>> 2 files changed, 20 insertions(+), 16 deletions(-) >>>>>>>>>> >>>>>>>>>> diff --git >>>>>>>>>> a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>>>>> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>>>>>> index 8ce9133..d64345f 100755 >>>>>>>>>> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>>>>>> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >>>>>>>>>> @@ -74,12 +74,17 @@ else >>>>>>>>>> fi >>>>>>>>>> #now we look for phy and add this >>>>>>>>>> for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do >>>>>>>>>> - radio="$(wifiAddPhyCond "$phy" "2" >>>>> "$chan2ghz")" >>>>>>>>>> - radio5="$(wifiAddPhyCond "$phy" "5" >>>>> "$chan5ghz")" >>>>>>>>>> - [ -n "$radio5" ] && radio="$radio5" >>>>>>>>>> + radio="$(wifiAddPhyCond "$phy" "2" "auto")" >>>>>>>>>> + radio5="$(wifiAddPhyCond "$phy" "5" >>>>> "auto5")" >>>>>>>>>> + if [ -n "$radio5" ] ; then >>>>>>>>>> + radio="$radio5" >>>>>>>>>> + staiface="w5sta" >>>>>>>>>> + else >>>>>>>>>> + staiface="w2sta" >>>>>>>>>> + fi >>>>>>>>>> >>>>>>>>>> #and here we add the station >>>>>>>>>> - if ! wifiAddSta "$radio" >>>>> "config.franken.freifunk.net" >>>>>>>>> "configSta"; then >>>>>>>>>> + if ! wifiAddSta "$radio" >>>>> "config.franken.freifunk.net" >>>>>>>>> "configSta" "$staiface" ; then >>>>>>>>>> echo "Can't add Sta interface on >>> $radio." >>>>>>>>>> exit 1 >>>>>>>>>> else >>>>>>>>>> @@ -124,11 +129,11 @@ if [ -s /tmp/keyxchangev2data ]; then >>>>>>>>>> json_get_var mesh_essid mesh_essid >>>>>>>>>> json_get_var essid essid >>>>>>>>>> json_get_var ntpip ntp_ip >>>>>>>>>> - # i think the next things we don't active this in the first >>>>>>>>> version! we can do it later >>>>>>>>>> - #json_get_var channel2 channel2 >>>>>>>>>> + # Additional parameters may be activated in future >>>>> versions >>>>>>>>>> + json_get_var chan2ghz channel2 >>>>>>>>>> #json_get_var mode2 mode2 >>>>>>>>>> json_get_var mesh_type2 mesh_type2 >>>>>>>>>> - #json_get_var channel5 channel5 >>>>>>>>>> + json_get_var chan5ghz channel5 >>>>>>>>>> #json_get_var mode5 mode5 >>>>>>>>>> json_get_var mesh_type5 mesh_type5 >>>>>>>>>> #json_get_var protocol protocol diff --git >>>>>>>>>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>>>>>> b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>>>>>>> index 7e418c2..b1ff5a9 100644 >>>>>>>>>> --- >>>>>>>>>> a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless >>>>>>>>>> +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wire >>>>>>>>>> +++ le >>>>>>>>>> +++ ss >>>>>>>>>> @@ -25,7 +25,10 @@ wifiAddPhy() { >>>>>>>>>> local channel=$2 >>>>>>>>>> local radio="radio$(echo "$phy" | tr -d -C "0-9")" >>>>>>>>>> local hwmode="11g" >>>>>>>>>> - if [ "$channel" -gt "14" ]; then >>>>>>>>>> + if [ "$channel" = "auto5" ] ; then >>>>>>>>>> + hwmode="11a" >>>>>>>>>> + channel="auto" >>>>>>>>>> + elif ( ! [ "$channel" = "auto" ] ) && [ "$channel" -gt "14" ]; >>>>>>>>>> +then >>>>>>>>>> hwmode="11a" >>>>>>>>>> fi >>>>>>>>>> >>>>>>>>>> @@ -60,7 +63,7 @@ wifiAddPhyCond() { >>>>>>>>>> local freq=$2 >>>>>>>>>> local channel=$3 >>>>>>>>>> local radio="" >>>>>>>>>> - >>>>>>>>>> + >>>>>>>>>> if iw phy "$phy" info | grep -q -m1 "${freq}... MHz"; then >>>>>>>>>> radio="$(wifiAddPhy "$phy" "$channel")" >>>>>>>>>> if [ -z "$radio" ]; then >>>>>>>>>> @@ -148,21 +151,17 @@ wifiAddAP() { } >>>>>>>>>> >>>>>>>>>> wifiAddSta() { >>>>>>>>>> - if [ $# -ne "3" ] >>>>>>>>>> + if [ $# -ne "4" ] >>>>>>>>>> then >>>>>>>>>> - echo "Usage: wifiAddSta <radio> <essid> <network>" >>>>>>>>>> + echo "Usage: wifiAddSta <radio> <essid> <network> >>>>> <iface>" >>>>>>>>>> return 1 >>>>>>>>>> fi >>>>>>>>>> >>>>>>>>>> local radio=$1 >>>>>>>>>> local essid=$2 >>>>>>>>>> local network=$3 >>>>>>>>>> + local iface=$4 >>>>>>>>>> >>>>>>>>>> - local channel=$(uci get "wireless.${radio}.channel") >>>>>>>>>> - local iface="w2sta" >>>>>>>>>> - if [ "$channel" -gt "14" ]; then >>>>>>>>>> - iface="w5sta" >>>>>>>>>> - fi >>>>>>>>>> uci batch <<-__EOF__ >>>>>>>>>> set wireless.${iface}='wifi-iface' >>>>>>>>>> set wireless.${iface}.device='${radio}' >>>>>>>>>> -- >>>>>>>>>> 2.7.4 >>>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> franken-dev mailing list >>>>>>>> franken-dev@freifunk.net >>>>>>>> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.ne >>>>>>>> t >>>>>> >>>>>> >>>> >>>> >> >> > > -- > franken-dev mailing list > franken-dev@freifunk.net > http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net