Merge pull request #3484 from dibdot/travelmate

travelmate: update 0.2.5
This commit is contained in:
Hannu Nyman 2016-11-06 20:13:10 +02:00 committed by GitHub
commit bc638d3100
3 changed files with 22 additions and 17 deletions

View File

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

View File

@ -18,16 +18,23 @@ To avoid these kind of deadlocks, travelmate set all station interfaces in an "a
* iw (default) or iwinfo for wlan scanning * iw (default) or iwinfo for wlan scanning
## OpenWrt / LEDE trunk Installation & Usage ## OpenWrt / LEDE trunk Installation & Usage
* download the package [here](https://downloads.lede-project.org/snapshots/packages/x86_64/packages)
* install 'travelmate' (_opkg install travelmate_) * install 'travelmate' (_opkg install travelmate_)
* configure your network to support (multiple) wlan uplinks and set travelmate config options (details see below) * configure your network to support (multiple) wlan uplinks and set travelmate config options (details see below)
* set 'trm\_enabled' option in travelmate config to '1' * set 'trm\_enabled' option in travelmate config to '1'
* travelmate starts automatically during boot, triggered by procd as soon as the wireless subsystem is up & running * travelmate starts automatically during boot, triggered by procd as soon as the wireless subsystem is up & running
## LuCI travelmate companion package
* download the package [here](https://downloads.lede-project.org/snapshots/packages/x86_64/luci)
* install 'luci-app-travelmate' (_opkg install luci-app-travelmate_)
* the application is located in LuCI under 'Services' menu
* _Thanks to Hannu Nyman for this great LuCI frontend!_
## Chaos Calmer installation notes ## Chaos Calmer installation notes
* 'travelmate' is _not_ available as an ipk package in the Chaos Calmer download repository * 'travelmate' and 'luci-app-travelmate' are _not_ available as ipk packages in the Chaos Calmer download repository
* download the package from a development snapshot package directory, i.e. look [here](https://downloads.lede-project.org/snapshots/packages/x86_64/packages/) * download the packages from a development snapshot directory (see download links above)
* manually transfer the package to your routers temp directory (with tools like _sshfs_ or _winscp_) * manually transfer the packages to your routers temp directory (with tools like _sshfs_ or _winscp_)
* install the package as described above * install the packages as described above
## Travelmate config options ## Travelmate config options
* mandatory config options: * mandatory config options:

View File

@ -11,7 +11,7 @@
LC_ALL=C LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin" PATH="/usr/sbin:/usr/bin:/sbin:/bin"
trm_pid="${$}" trm_pid="${$}"
trm_ver="0.2.4" trm_ver="0.2.5"
trm_debug=0 trm_debug=0
trm_loop=30 trm_loop=30
trm_maxretry=3 trm_maxretry=3
@ -106,7 +106,7 @@ trm_check()
json_get_var trm_status up json_get_var trm_status up
if [ "${trm_status}" = "1" ] || [ -n "${trm_uplink}" ] if [ "${trm_status}" = "1" ] || [ -n "${trm_uplink}" ]
then then
trm_log "debug" "check::: interface: ${interface}, status: ${trm_status}, uplink-sta: ${trm_uplink}, uplink-ssid: ${trm_ssid} count: ${cnt}" trm_log "debug" "check::: interface: ${interface}, status: ${trm_status}, uplink-cfg: ${trm_uplink}, uplink-ssid: ${trm_ssid}, loop-cnt: ${cnt}, error-cnt: $((trm_count_${trm_config}))"
json_cleanup json_cleanup
break break
fi fi
@ -119,6 +119,7 @@ trm_check()
ubus call network reload ubus call network reload
eval "trm_count_${trm_uplink}=\$((trm_count_${trm_uplink}+1))" eval "trm_count_${trm_uplink}=\$((trm_count_${trm_uplink}+1))"
trm_checklist="" trm_checklist=""
trm_uplink=""
trm_log "info" "uplink ${trm_ssid} get lost" trm_log "info" "uplink ${trm_ssid} get lost"
elif [ -z "${trm_uplink}" ] && [ -n "${trm_checklist}" ] elif [ -z "${trm_uplink}" ] && [ -n "${trm_checklist}" ]
then then
@ -189,7 +190,6 @@ while true
do do
if [ -z "${trm_uplink}" ] || [ "${trm_status}" = "0" ] if [ -z "${trm_uplink}" ] || [ "${trm_status}" = "0" ]
then then
trm_uplink=""
trm_aplist="" trm_aplist=""
trm_stalist="" trm_stalist=""
config_load wireless config_load wireless
@ -213,7 +213,7 @@ do
trm_network="${sta##*_}" trm_network="${sta##*_}"
trm_ifname="$(uci -q get wireless."${trm_config}".ifname)" trm_ifname="$(uci -q get wireless."${trm_config}".ifname)"
trm_ssid="\"$(uci -q get wireless."${trm_config}".ssid)\"" trm_ssid="\"$(uci -q get wireless."${trm_config}".ssid)\""
if [ $((trm_count_${trm_config}_${trm_network})) -lt $((trm_maxretry)) ] || [ $((trm_maxretry)) -eq 0 ] if [ $((trm_count_${trm_config})) -lt $((trm_maxretry)) ] || [ $((trm_maxretry)) -eq 0 ]
then then
if [ -n "$(printf "${trm_ssidlist}" | grep -Fo "${trm_ssid}")" ] if [ -n "$(printf "${trm_ssidlist}" | grep -Fo "${trm_ssid}")" ]
then then
@ -221,28 +221,27 @@ do
if [ "${trm_status}" = "1" ] if [ "${trm_status}" = "1" ]
then then
trm_checklist="${trm_network}" trm_checklist="${trm_network}"
trm_uplink="${trm_config}_${trm_network}" trm_uplink="${trm_config}"
trm_set "defer" trm_set "defer"
trm_log "info" "wwan interface \"${trm_ifname}\" connected to uplink ${trm_ssid}" trm_log "info" "wwan interface \"${trm_ifname}\" connected to uplink ${trm_ssid}"
break 2 break 2
else else
trm_set "revert" trm_set "revert"
eval "trm_count_${trm_config}_${trm_network}=\$((trm_count_${trm_config}_${trm_network}+1))" eval "trm_count_${trm_config}=\$((trm_count_${trm_config}+1))"
fi fi
fi fi
elif [ $((trm_count_${trm_config}_${trm_network})) -eq $((trm_maxretry)) ] && [ $((trm_maxretry)) -ne 0 ] elif [ $((trm_count_${trm_config})) -eq $((trm_maxretry)) ] && [ $((trm_maxretry)) -ne 0 ]
then then
eval "trm_count_${trm_config}_${trm_network}=\$((trm_count_${trm_config}_${trm_network}+1))" eval "trm_count_${trm_config}=\$((trm_count_${trm_config}+1))"
trm_log "info" "uplink ${trm_ssid} disabled due to permanent connection failures" trm_log "info" "uplink ${trm_ssid} disabled due to permanent connection failures"
fi fi
done done
fi fi
sleep 5 sleep 5
done done
sleep 5
else else
trm_check trm_check
if [ -n "${trm_checklist}" ] if [ -n "${trm_uplink}" ]
then then
sleep ${trm_loop} sleep ${trm_loop}
fi fi