travelmate: update 1.2.3

* remove needless third status "not connected", use only "running / not
connected" and "connected"
* change indentation from spaces to tabs (saves 4kb)
* small fixes
* update readme

Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
Dirk Brenken 2018-09-08 22:28:04 +02:00
parent 3b6e346a4c
commit 1d69658670
4 changed files with 364 additions and 374 deletions

View file

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=travelmate
PKG_VERSION:=1.2.2
PKG_VERSION:=1.2.3
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>

View file

@ -20,7 +20,7 @@ To avoid these kind of deadlocks, travelmate set all station interfaces in an "a
* optional: the LuCI frontend shows the WiFi QR codes from all configured Access Points. It allows you to connect your Android or iOS devices to your routers WiFi using the QR code
## Prerequisites
* [OpenWrt](https://openwrt.org), tested with the stable release series (17.01.x) and with the latest OpenWrt snapshot
* [OpenWrt](https://openwrt.org), tested with the stable release series (18.06.x) and with the latest OpenWrt snapshot
* iwinfo for wlan scanning, uclient-fetch for captive portal detection
* optional: qrencode 4.x for QR code support
@ -57,12 +57,12 @@ To avoid these kind of deadlocks, travelmate set all station interfaces in an "a
~# /etc/init.d/travelmate status
::: travelmate runtime information
+ travelmate_status : connected (net ok/78)
+ travelmate_version : 1.2.1
+ travelmate_version : 1.2.3
+ station_id : radio1/blackhole/01:02:03:04:05:06
+ station_interface : trm_wwan
+ faulty_stations :
+ last_rundate : 28.07.2018 21:17:45
+ system : TP-LINK RE450, OpenWrt SNAPSHOT r7540+5-20c4819c7b
+ last_rundate : 07.09.2018 17:22:37
+ system : TP-LINK RE450, OpenWrt SNAPSHOT r8018-42f158314e
</code></pre>
## Manual Setup
@ -127,6 +127,8 @@ edit /etc/config/travelmate and set 'trm_enabled' to '1'
**A:** Travelmate tries n times (default 3) to connect, then the respective uplink will be marked as "faulty" in the JSON runtime file and hereafter ignored. To reset the JSON runtime file, simply restart travelmate.
**Q:** How to connect to hidden uplinks?
**A:** See 'example\_hidden' STA configuration above, option 'SSID' and 'BSSID' must be specified for successful connections.
**Q:** Any recommendations regarding suitable DNS settings to easily connect to captive portals?
**A:** Use a simple DNS forwarder like dnsmasq and disable the option 'rebind_protection'.
## Support
Please join the travelmate discussion in this [forum thread](https://forum.lede-project.org/t/travelmate-support-thread/5155) or contact me by [mail](mailto:dev@brenken.org)

View file

@ -38,7 +38,6 @@ reload_service()
stop_service()
{
rc_procd "${trm_script}" stop
rc_procd start_service
}
status()
@ -46,11 +45,11 @@ status()
local key keylist value rtfile="$(uci_get travelmate global trm_rtfile)"
rtfile="${rtfile:-"/tmp/trm_runtime.json"}"
if [ -s "${rtfile}" ]
json_load_file "${rtfile}" >/dev/null 2>&1
json_select data >/dev/null 2>&1
if [ ${?} -eq 0 ]
then
printf "%s\n" "::: travelmate runtime information"
json_load "$(cat "${rtfile}" 2>/dev/null)"
json_select data
json_get_keys keylist
for key in ${keylist}
do

View file

@ -10,7 +10,7 @@
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
trm_ver="1.2.2"
trm_ver="1.2.3"
trm_sysver="unknown"
trm_enabled=0
trm_debug=0
@ -220,10 +220,7 @@ f_jsnup()
status="connected (${trm_connection:-"-"})"
else
unset trm_connection
if [ "${status}" = "false" ]
then
status="not connected"
fi
status="running / not connected"
fi
dev_status="$(ubus -S call network.wireless status 2>/dev/null)"
@ -290,7 +287,7 @@ f_main()
config_load wireless
config_foreach f_prep wifi-iface
uci_commit wireless
f_check "dev" "running"
f_check "dev" "running / not connected"
json_get_var faulty_list "faulty_stations"
f_log "debug" "f_main ::: iwinfo: ${trm_iwinfo}, dev_list: ${trm_devlist}, sta_list: ${trm_stalist:0:800}, faulty_list: ${faulty_list:-"-"}"
for dev in ${trm_devlist}
@ -375,14 +372,6 @@ f_main()
sleep $(( ${trm_maxwait} / 6 ))
done
done
if [ ! -s "${trm_rtfile}" ]
then
trm_ifstatus="false"
f_jsnup
fi
elif [ ! -s "${trm_rtfile}" ]
then
f_jsnup
fi
}
@ -398,13 +387,13 @@ fi
# initialize json runtime file
#
if [ ! -s "${trm_rtfile}" ]
json_load_file "${trm_rtfile}" >/dev/null 2>&1
json_select data >/dev/null 2>&1
if [ ${?} -ne 0 ]
then
> "${trm_rtfile}"
json_init
json_add_object "data"
else
json_load_file "${trm_rtfile}"
json_select data
fi
# control travelmate actions