You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
8.4 KiB

  1. # travelmate, a wlan connection manager for travel router
  2. ## Description
  3. If you’re planning an upcoming vacation or a business trip, taking your laptop, tablet or smartphone give you the ability to connect with friends or complete work on the go. But many hotels don’t have a secure wireless network setup or you’re limited on using a single device at once. Investing in a portable, mini travel router is a great way to connect all of your devices at once while having total control over your own personalized wireless network.
  4. A logical combination of AP+STA mode on one physical radio allows most of OpenWrt supported router devices to connect to a wireless hotspot/station (STA) and provide a wireless access point (AP) from that hotspot at the same time. Downside of this solution: whenever the STA interface looses the connection it will go into an active scan cycle which renders the radio unusable for AP mode operation, therefore the AP is taken down if the STA looses its association.
  5. To avoid these kind of deadlocks, travelmate will set all station interfaces to an "always off" mode and connects automatically to available/configured hotspots.
  6. ## Main Features
  7. * STA interfaces operating in an "always off" mode, to make sure that the AP is always accessible
  8. * easy setup within normal OpenWrt environment
  9. * strong LuCI-Support with builtin interface wizard and a wireless station manager
  10. * fast uplink connections
  11. * support all kinds of uplinks, incl. hidden and enterprise uplinks
  12. * continuously checks the existing uplink connection (quality), e.g. for conditional uplink (dis-) connections
  13. * automatically add open uplinks to your wireless config, e.g. hotel captive portals
  14. * captive portal detection with internet online check and a 'heartbeat' function to keep the uplink connection up & running
  15. * captive portal auto-login hook (configured via uci/LuCI), you could reference an external script for captive portal auto-logins (see example below)
  16. * proactively scan and switch to a higher prioritized uplink, despite of an already existing connection
  17. * support devices with multiple radios in any order
  18. * procd init and hotplug support
  19. * runtime information available via LuCI & via 'status' init command
  20. * status & debug logging to syslog
  21. * 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
  22. ## Prerequisites
  23. * [OpenWrt](https://openwrt.org), tested with the stable release series (19.07.x) and with the latest OpenWrt snapshot
  24. * iwinfo for wlan scanning, uclient-fetch for captive portal detection, dnsmasq as dns backend
  25. * optional: qrencode 4.x for QR code support
  26. * optional: wpad (the full version, not wpad-mini) to use Enterprise WiFi
  27. * optional: curl to use external scripts for captive portal auto-logins
  28. ## Installation & Usage
  29. * download the package [here](https://downloads.openwrt.org/snapshots/packages/x86_64/packages)
  30. * install 'travelmate' (_opkg install travelmate_)
  31. * configure your network:
  32. * recommended: use the LuCI frontend with builtin interface wizard and a wireless station manager
  33. * manual: see detailed configuration steps below
  34. * at least you need one configured AP and one STA interface
  35. ## LuCI travelmate companion package
  36. * download the package [here](https://downloads.openwrt.org/snapshots/packages/x86_64/luci)
  37. * install 'luci-app-travelmate' (_opkg install luci-app-travelmate_)
  38. * the application is located in LuCI under 'Services' menu
  39. ## Travelmate config options
  40. * usually the pre-configured travelmate setup works quite well and no manual config overrides are needed, all listed options apply to the 'global' section:
  41. * trm\_enabled => main switch to enable/disable the travelmate service (bool/default: '0', disabled)
  42. * trm\_debug => enable/disable debug logging (bool/default: '0', disabled)
  43. * trm\_captive => enable/disable the captive portal detection (bool/default: '1', enabled)
  44. * trm\_proactive => enable/disable the proactive uplink switch (bool/default: '1', enabled)
  45. * trm\_autoadd => automatically add open uplinks to your wireless config (bool/default: '0', disabled)
  46. * trm\_minquality => minimum signal quality threshold as percent for conditional uplink (dis-) connections (int/default: '35', valid range: 20-80)
  47. * trm\_maxwait => how long (in seconds) should travelmate wait for a successful wlan interface reload action (int/default: '30', valid range: 20-40)
  48. * trm\_maxretry => how many times should travelmate try to connect to an uplink (int/default: '3', valid range: 1-10)
  49. * trm\_timeout => overall retry timeout in seconds (int/default: '60', valid range: 30-300)
  50. * 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)
  51. * trm\_iface => uplink / procd trigger network interface (default: trm_wwan)
  52. * trm\_triggerdelay => additional trigger delay in seconds before travelmate processing begins (int/default: '2')
  53. ## Captive Portal auto-logins
  54. 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 ...
  55. A typical/successful captive portal login looks like this:
  56. <pre><code>
  57. [...]
  58. Mon Aug 5 10:15:48 2019 user.info travelmate-1.4.10[1481]: travelmate instance started ::: action: start, pid: 1481
  59. 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'
  60. 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)
  61. [...]
  62. </code></pre>
  63. ## Runtime information
  64. **receive travelmate runtime information:**
  65. <pre><code>
  66. ~# /etc/init.d/travelmate status
  67. ::: travelmate runtime information
  68. + travelmate_status : connected (net ok/100)
  69. + travelmate_version : 1.4.10
  70. + station_id : radio1/blackhole/-
  71. + station_interface : trm_wwan
  72. + faulty_stations :
  73. + last_rundate : 2019.08.03-20:37:19
  74. + system : GL.iNet GL-AR750S, OpenWrt SNAPSHOT r10644-cb49e46a8a
  75. </code></pre>
  76. To debug travelmate runtime problems, please always enable the 'trm\_debug' flag, restart travelmate and scan the system log (_logread -e "travelmate"_)
  77. ## Manual Setup
  78. **1. configure the travelmate wwan interface in /etc/config/network:**
  79. <pre><code>
  80. [...]
  81. config interface 'trm_wwan'
  82. option proto 'dhcp'
  83. [...]
  84. </code></pre>
  85. **2. add this interface to your firewall configuration in /etc/config/firewall:**
  86. <pre><code>
  87. [...]
  88. config zone
  89. option name 'wan'
  90. option network 'wan wan6 trm_wwan'
  91. [...]
  92. </code></pre>
  93. **3. at least add one ap and (multiple) wwan stations to your wireless configuration in etc/config/wireless:**
  94. <pre><code>
  95. [...]
  96. config wifi-iface
  97. option device 'radio0'
  98. option network 'lan'
  99. option mode 'ap'
  100. option ssid 'example_ap'
  101. option encryption 'psk2+ccmp'
  102. option key 'abc'
  103. option disabled '0'
  104. [...]
  105. config wifi-iface
  106. option device 'radio0'
  107. option network 'trm_wwan'
  108. option mode 'sta'
  109. option ssid 'example_usual'
  110. option encryption 'psk2+ccmp'
  111. option key 'abc'
  112. option disabled '1'
  113. [...]
  114. config wifi-iface
  115. option device 'radio0'
  116. option network 'trm_wwan'
  117. option mode 'sta'
  118. option ssid 'example_hidden'
  119. option bssid '00:11:22:33:44:55'
  120. option encryption 'psk2+ccmp'
  121. option key 'xyz'
  122. option disabled '1'
  123. [...]
  124. </code></pre>
  125. **4. start travelmate:**
  126. <pre><code>
  127. edit /etc/config/travelmate and set 'trm_enabled' to '1'
  128. /etc/init.d/travelmate restart
  129. </code></pre>
  130. ## Support
  131. 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)
  132. ## Removal
  133. * stop the travelmate daemon with _/etc/init.d/travelmate stop_
  134. * optional: remove the travelmate package (_opkg remove travelmate_)
  135. Have fun!
  136. Dirk