travelmate: release 2.1.2-1

* fix a station scanning issue on single radio units (mainly a LuCI/JS issue) reported in the forum by multiple users

Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
Dirk Brenken 2024-01-06 19:53:30 +01:00
parent 6d47f66356
commit ce20f8d88b
No known key found for this signature in database
GPG key ID: 9D71CD547BFAE684
3 changed files with 17 additions and 16 deletions

View file

@ -1,13 +1,13 @@
#
# Copyright (c) 2016-2023 Dirk Brenken (dev@brenken.org)
# Copyright (c) 2016-2024 Dirk Brenken (dev@brenken.org)
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=travelmate
PKG_VERSION:=2.1.1
PKG_RELEASE:=3
PKG_VERSION:=2.1.2
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>

View file

@ -43,9 +43,8 @@ To avoid these kind of deadlocks, travelmate will set all station interfaces to
## Installation & Usage
* **Please note:** before you start with travelmate ...
* you should setup at least one Access Point, ideally on a separate radio,
* if you're updating from a former 1.x release, please use the '--force-reinstall --force-maintainer' options in opkg,
* and remove any existing travelmate related uplink stations in your wireless config manually
* setup at least one AP, ideally on a separate radio
* if you're using a single radio unit set the AP channel to 'auto'
* download [travelmate](https://downloads.openwrt.org/snapshots/packages/x86_64/packages)
* download [luci-app-travelmate](https://downloads.openwrt.org/snapshots/packages/x86_64/luci)
* install both packages (_opkg install travelmate_, _opkg install luci-app-travelmate_)

View file

@ -1,5 +1,5 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2016-2023 Dirk Brenken (dev@brenken.org)
# Copyright (c) 2016-2024 Dirk Brenken (dev@brenken.org)
# This is free software, licensed under the GNU General Public License v3.
# set (s)hellcheck exceptions
@ -15,6 +15,7 @@ extra_command "setup" "[<iface>] [<zone>] [<metric>] Setup the travelmate uplink
trm_init="/etc/init.d/travelmate"
trm_script="/usr/bin/travelmate.sh"
trm_pidfile="/var/run/travelmate.pid"
trm_scanfile="/var/run/travelmate.scan"
boot() {
if [ -s "${trm_pidfile}" ]; then
@ -76,19 +77,20 @@ status_service() {
}
scan() {
local result scan_name radio="${1}"
local result radio="${1}"
: > "${trm_scanfile}"
if [ -z "${radio}" ]; then
scan_name="$(ubus -S call network.wireless status 2>/dev/null | jsonfilter -q -l1 -e '@[@.up=true].interfaces[0].ifname')"
radio="$(ubus -S call network.wireless status 2>/dev/null | jsonfilter -q -l1 -e '@[@.up=true].interfaces[0].ifname')"
fi
result="$(iwinfo "${radio:-${scan_name}}" scan 2>/dev/null |
result="$(iwinfo "${radio}" scan 2>/dev/null |
awk 'BEGIN{FS="[[:space:]]"}/Address:/{var1=$NF}/ESSID:/{var2="";
for(i=12;i<=NF;i++)if(var2==""){var2=$i}else{var2=var2" "$i}}/Channel:/{var3=$NF}/Quality:/{split($NF,var0,"/")}/Encryption:/{var4="";
for(j=12;j<=NF;j++)if(var4==""){var4=$j}else{var4=var4" "$j};printf " %-11i%-10s%-35s%-20s%s\n",(var0[1]*100/var0[2]),var3,var2,var1,var4}' |
sort -rn)"
printf "%s\n" "::: Available nearby uplinks on '${radio:-${scan_name}}'"
printf "%s\n" ":::"
printf "::: %s\n:::\n" "Available nearby uplinks on '${radio}'"
if [ -n "${result}" ]; then
printf "%s\n" "${result}" > "${trm_scanfile}"
printf "%-15s%-10s%-35s%-20s%s\n" " Strength" "Channel" "ESSID" "BSSID" "Encryption"
printf "%s\n" " --------------------------------------------------------------------------------------"
printf "%s\n" "${result}"
@ -162,13 +164,13 @@ setup() {
}
assoc() {
local result assoc_name radio="${1}"
local result radio="${1}"
if [ -z "${radio}" ]; then
assoc_name="$(ubus -S call network.wireless status 2>/dev/null | jsonfilter -q -l1 -e '@[@.*.*.config.mode="ap"].interfaces[0].ifname')"
radio="$(ubus -S call network.wireless status 2>/dev/null | jsonfilter -q -l1 -e '@[@.*.*.config.mode="ap"].interfaces[0].ifname')"
fi
result="$(iwinfo "${radio:-${assoc_name}}" assoc 2>/dev/null | awk '/^[A-Z0-9:]+/{printf " %s\n",$1}')"
printf "%s\n" "::: Associated wlan stations on '${radio:-${assoc_name}}'"
result="$(iwinfo "${radio}" assoc 2>/dev/null | awk '/^[A-Z0-9:]+/{printf " %s\n",$1}')"
printf "%s\n" "::: Associated wlan stations on '${radio}'"
printf "%s\n" ":::"
if [ -n "${result}" ]; then
printf "%s\n" " MAC addresses"