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.

152 lines
8.2 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. * captive portal detection with internet online check and a 'heartbeat' function to keep the uplink connection up & running
  14. * captive portal auto-login hook (configured via uci/LuCI), you could reference an external script for captive portal auto-logins (see example below)
  15. * proactively scan and switch to a higher prioritized uplink, despite of an already existing connection
  16. * support devices with multiple radios in any order
  17. * procd init and hotplug support
  18. * runtime information available via LuCI & via 'status' init command
  19. * status & debug logging to syslog
  20. * 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
  21. ## Prerequisites
  22. * [OpenWrt](https://openwrt.org), tested with the stable release series (19.07.x) and with the latest OpenWrt snapshot
  23. * iwinfo for wlan scanning, uclient-fetch for captive portal detection, dnsmasq as dns backend
  24. * optional: qrencode 4.x for QR code support
  25. * optional: wpad (the full version, not wpad-mini) to use Enterprise WiFi
  26. * optional: curl to use external scripts for captive portal auto-logins
  27. ## Installation & Usage
  28. * download the package [here](https://downloads.openwrt.org/snapshots/packages/x86_64/packages)
  29. * install 'travelmate' (_opkg install travelmate_)
  30. * configure your network:
  31. * recommended: use the LuCI frontend with builtin interface wizard and a wireless station manager
  32. * manual: see detailed configuration steps below
  33. * at least you need one configured AP and one STA interface
  34. ## LuCI travelmate companion package
  35. * download the package [here](https://downloads.openwrt.org/snapshots/packages/x86_64/luci)
  36. * install 'luci-app-travelmate' (_opkg install luci-app-travelmate_)
  37. * the application is located in LuCI under 'Services' menu
  38. ## Travelmate config options
  39. * usually the pre-configured travelmate setup works quite well and no manual config overrides are needed, all listed options apply to the 'global' section:
  40. * trm\_enabled => main switch to enable/disable the travelmate service (bool/default: '0', disabled)
  41. * trm\_debug => enable/disable debug logging (bool/default: '0', disabled)
  42. * trm\_captive => enable/disable the captive portal detection (bool/default: '1', enabled)
  43. * trm\_proactive => enable/disable the proactive uplink switch (bool/default: '1', enabled)
  44. * trm\_minquality => minimum signal quality threshold as percent for conditional uplink (dis-) connections (int/default: '35', valid range: 20-80)
  45. * trm\_maxwait => how long (in seconds) should travelmate wait for a successful wlan interface reload action (int/default: '30', valid range: 20-40)
  46. * trm\_maxretry => how many times should travelmate try to connect to an uplink (int/default: '3', valid range: 1-10)
  47. * trm\_timeout => overall retry timeout in seconds (int/default: '60', valid range: 30-300)
  48. * 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)
  49. * trm\_iface => uplink / procd trigger network interface (default: trm_wwan)
  50. * trm\_triggerdelay => additional trigger delay in seconds before travelmate processing begins (int/default: '2')
  51. ## Captive Portal auto-logins
  52. 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 succesful login. Hopefully more scripts for different captive portals will be provided by the community ...
  53. A typical/succesful captive portal login looks like this:
  54. <pre><code>
  55. [...]
  56. Mon Aug 5 10:15:48 2019 user.info travelmate-1.4.10[1481]: travelmate instance started ::: action: start, pid: 1481
  57. 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'
  58. 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)
  59. [...]
  60. </code></pre>
  61. ## Runtime information
  62. **receive travelmate runtime information:**
  63. <pre><code>
  64. ~# /etc/init.d/travelmate status
  65. ::: travelmate runtime information
  66. + travelmate_status : connected (net ok/100)
  67. + travelmate_version : 1.4.10
  68. + station_id : radio1/blackhole/-
  69. + station_interface : trm_wwan
  70. + faulty_stations :
  71. + last_rundate : 2019.08.03-20:37:19
  72. + system : GL.iNet GL-AR750S, OpenWrt SNAPSHOT r10644-cb49e46a8a
  73. </code></pre>
  74. To debug travelmate runtime problems, please always enable the 'trm\_debug' flag, restart travelmate and scan the system log (_logread -e "travelmate"_)
  75. ## Manual Setup
  76. **1. configure the travelmate wwan interface in /etc/config/network:**
  77. <pre><code>
  78. [...]
  79. config interface 'trm_wwan'
  80. option proto 'dhcp'
  81. [...]
  82. </code></pre>
  83. **2. add this interface to your firewall configuration in /etc/config/firewall:**
  84. <pre><code>
  85. [...]
  86. config zone
  87. option name 'wan'
  88. option network 'wan wan6 trm_wwan'
  89. [...]
  90. </code></pre>
  91. **3. at least add one ap and (multiple) wwan stations to your wireless configuration in etc/config/wireless:**
  92. <pre><code>
  93. [...]
  94. config wifi-iface
  95. option device 'radio0'
  96. option network 'lan'
  97. option mode 'ap'
  98. option ssid 'example_ap'
  99. option encryption 'psk2+ccmp'
  100. option key 'abc'
  101. option disabled '0'
  102. [...]
  103. config wifi-iface
  104. option device 'radio0'
  105. option network 'trm_wwan'
  106. option mode 'sta'
  107. option ssid 'example_usual'
  108. option encryption 'psk2+ccmp'
  109. option key 'abc'
  110. option disabled '1'
  111. [...]
  112. config wifi-iface
  113. option device 'radio0'
  114. option network 'trm_wwan'
  115. option mode 'sta'
  116. option ssid 'example_hidden'
  117. option bssid '00:11:22:33:44:55'
  118. option encryption 'psk2+ccmp'
  119. option key 'xyz'
  120. option disabled '1'
  121. [...]
  122. </code></pre>
  123. **4. start travelmate:**
  124. <pre><code>
  125. edit /etc/config/travelmate and set 'trm_enabled' to '1'
  126. /etc/init.d/travelmate restart
  127. </code></pre>
  128. ## Support
  129. 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)
  130. ## Removal
  131. * stop the travelmate daemon with _/etc/init.d/travelmate stop_
  132. * optional: remove the travelmate package (_opkg remove travelmate_)
  133. Have fun!
  134. Dirk