@ -9,146 +9,171 @@ To avoid these kind of deadlocks, travelmate will set all station interfaces to
* STA interfaces operating in an "always off" mode, to make sure that the AP is always accessible
* easy setup within normal OpenWrt environment
* strong LuCI-Support with builtin interface wizard and a wireless station manager
* render the QR-Code of the selected Access Point in LuCI to comfortably transfer the WLAN credentials to your mobile devices
* fast uplink connections
* support all kinds of uplinks, incl. hidden and enterprise uplinks
* support all kinds of uplinks, incl. hidden and enterprise uplinks (WEP-based uplinks are no longer supported!)
* continuously checks the existing uplink connection (quality), e.g. for conditional uplink (dis-) connections
* automatically add open uplinks to your wireless config, e.g. hotel captive portals
* captive portal detection with internet online check and a 'heartbeat' function to keep the uplink connection up & running
* captive portal auto-login hook (configured via uci/LuCI), you could reference an external script for captive portal auto-logins (see example below)
* captive portal auto-login hook (configured via uci/LuCI), you are able to reference an external script for captive portal auto-logins (see example below)
* includes a vpn hook with support for 'wireguard' or 'openvpn' client setups to handle VPN (re-) connections automatically
* includes an email hook to 'msmtp' to send notification e-mails after every succesful uplink connect
* proactively scan and switch to a higher prioritized uplink, despite of an already existing connection
* connection tracking which keeps start and end date of an uplink connection
* automatically disable the uplink after n minutes, e.g. for timed connections
* automatically (re-)enable the uplink after n minutes, e.g. after failed login attempts
* option to generate a random unicast MAC address for each uplink connection
* ntp time sync before sending emails
* support devices with multiple radios in any order
* procd init and hotplug support
* procd init and ntp-hotplug support
* runtime information available via LuCI & via 'status' init command
* status & debug logging to syslog
* 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 router’s WiFi using the QR code
## Prerequisites
* [OpenWrt](https://openwrt.org), tested with the stable release series (19.07.x) and with the latest OpenWrt snapshot
* iwinfo for wlan scanning, uclient-fetch for captive portal detection, dnsmasq as dns backend
* optional: qrencode 4.x for QR code support
* optional: wpad (the full version, not wpad-mini) to use Enterprise WiFi
* optional: curl to use external scripts for captive portal auto-logins
* [OpenWrt](https://openwrt.org), only compatible with the forthcoming stable 20.x or the latest OpenWrt snapshot
* 'dnsmasq' as dns backend
* 'iwinfo' for wlan scanning
* 'curl' for connection checking and all kinds of captive portal magic, e.g. cp detection and auto-logins
* a 'wpad' variant to support various WPA encrypted networks (WEP-based uplinks are no longer supported!)
* optional: 'qrencode' for AP QR code support
* optional: 'wireguard' or 'openvpn' for vpn client connections
* optional: 'msmtp' to send out travelmate related status messages via email
## Installation & Usage
* download the package [here](https://downloads.openwrt.org/snapshots/packages/x86_64/packages)
* install both packages (_opkg install travelmate_, _opkg install luci-app-travelmate_)
* the LuCI application is located under the 'Services' menu
* start the travelmate 'Interface Wizard' once
* add multiple uplink stations as you like via the 'Wireless Stations' tab
* happy traveling ...
## Travelmate config options
* usually the pre-configured travelmate setup works quite well and no manual config overrides are needed, all listed options apply to the 'global' section:
* trm\_enabled => main switch to enable/disable the travelmate service (bool/default: '0', disabled)
* trm\_radio => limit travelmate to a single radio (e.g. 'radio1') or change the overall scanning priority (e.g. 'radio1 radio2 radio0') (default: not set, use all radios 0-n)
* trm\_triggerdelay => additional trigger delay in seconds before travelmate processing begins (int/default: '2')
## Captive Portal auto-logins
For automated captive portal logins you could reference external shell scripts. All login scripts should be executable and located in '/etc/travelmate' with the extension '.login'. The provided 'wifionice.login' script example requires curl and automates the login to german ICE hotspots, it also explains the principle approach to extract runtime data like security tokens for a successful login. Hopefully more scripts for different captive portals will be provided by the community ...
A typical/successful captive portal login looks like this:
Once your vpn client connection is running, you can reference to that setup in travelmate to handle VPN (re-) connections automatically.
## E-Mail setup
To use E-Mail notifications you have to setup the package 'msmtp'.
Modify the file '/etc/msmtprc', e.g. for gmail:
<pre><code>
[...]
Mon Aug 5 10:15:48 2019 user.info travelmate-1.4.10[1481]: travelmate instance started ::: action: start, pid: 1481
Mon Aug 5 10:16:17 2019 user.info travelmate-1.4.10[1481]: captive portal login '/etc/travelmate/wifionice.login' for 'www.wifionice.de' has been executed with rc '0'
Mon Aug 5 10:16:23 2019 user.info travelmate-1.4.10[1481]: connected to uplink 'radio1/WIFIonICE/-' (1/5, GL.iNet GL-AR750S, OpenWrt SNAPSHOT r10644-cb49e46a8a)
defaults
auth on
tls on
tls_certcheck off
timeout 5
syslog LOG_MAIL
[...]
account trm_notify
host smtp.gmail.com
port 587
from xxx@gmail.com
user yyy
password zzz
</code></pre>
## Runtime information
**receive travelmate runtime information:**
<pre><code>
~# /etc/init.d/travelmate status
::: travelmate runtime information
+ travelmate_status : connected (net ok/100)
+ travelmate_version : 1.4.10
+ station_id : radio1/blackhole/-
+ station_interface : trm_wwan
+ faulty_stations :
+ last_rundate : 2019.08.03-20:37:19
+ system : GL.iNet GL-AR750S, OpenWrt SNAPSHOT r10644-cb49e46a8a
</code></pre>
To debug travelmate runtime problems, please always enable the 'trm\_debug' flag, restart travelmate and scan the system log (_logread -e "travelmate"_)
Finally enable E-Mail support in travelmate and add a valid E-Mail receiver address.
## Manual Setup
**1. configure the travelmate wwan interface in /etc/config/network:**
## Captive Portal auto-logins
For automated captive portal logins you can reference an external shell script per uplink. All login scripts should be executable and located in '/etc/travelmate' with the extension '.login'. Currently the package ships five ready to run auto-login scripts:
* 'wifionice.login' for german ICE hotspots
* 'db-bahn.login' for german DB railway hotspots via portal login API (still WIP, only tested at Hannover central station)
* 'chs-hotel.login' for german chs hotels
* 'h-hotels.login' for Telekom hotspots in german h+hotels
* 'generic-user-pass.login' a template to demonstrate the optional parameter handling in login scripts
A typical and successful captive portal login looks like this:
<pre><code>
[...]
config interface 'trm_wwan'
option proto 'dhcp'
Thu Sep 10 13:30:16 2020 user.info trm-2.0.0[26222]: captive portal domain 'www.wifionice.de' added to to dhcp rebind whitelist
Thu Sep 10 13:30:19 2020 user.info trm-2.0.0[26222]: captive portal login '/etc/travelmate/wifionice.login ' for 'www.wifionice.de' has been executed with rc '0'
Thu Sep 10 13:30:19 2020 user.info trm-2.0.0[26222]: connected to uplink 'radio1/WIFIonICE/-' with mac 'B2:9D:F5:96:86:A4' (1/3)
[...]
</code></pre>
**2. add this interface to your firewall configuration in /etc/config/firewall:**
<pre><code>
[...]
config zone
option name 'wan'
option network 'wan wan6 trm_wwan'
[...]
</code></pre>
Hopefully more scripts for different captive portals will be provided by the community!
**3. at least add one ap and (multiple) wwan stations to your wireless configuration in etc/config/wireless:**
<pre><code>
[...]
config wifi-iface
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'example_ap'
option encryption 'psk2+ccmp'
option key 'abc'
option disabled '0'
[...]
config wifi-iface
option device 'radio0'
option network 'trm_wwan'
option mode 'sta'
option ssid 'example_usual'
option encryption 'psk2+ccmp'
option key 'abc'
option disabled '1'
[...]
config wifi-iface
option device 'radio0'
option network 'trm_wwan'
option mode 'sta'
option ssid 'example_hidden'
option bssid '00:11:22:33:44:55'
option encryption 'psk2+ccmp'
option key 'xyz'
option disabled '1'
[...]
</code></pre>
## Runtime information
**4. start travelmate:**
**receive travelmate runtime information:**
<pre><code>
edit /etc/config/travelmate and set 'trm_enabled' to '1'
+ system : GL.iNet GL-AR750S (NOR/NAND), OpenWrt SNAPSHOT r14430-2dda301d40
</code></pre>
To debug travelmate runtime problems, please always enable the 'trm\_debug' flag, restart travelmate and scan the system log (_logread -e "trm-"_)
## 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)
## Removal
* stop the travelmate daemon with _/etc/init.d/travelmate stop_
* optional: remove the travelmate package (_opkg remove travelmate_)