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.

139 lines
5.9 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/LEDE 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 set all station interfaces in 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/LEDE environment
  9. * fast uplink connections
  10. * manual / automatic mode support, the latter one checks the existing uplink connection regardless of ifdown event trigger every n seconds
  11. * support of devices with multiple radios
  12. * procd init and hotplug support
  13. * runtime information accessible via ubus service call
  14. * status & debug logging to syslog
  15. ## Prerequisites
  16. * [OpenWrt](https://openwrt.org) or [LEDE](https://www.lede-project.org) trunk
  17. * iw (default) or iwinfo for wlan scanning
  18. ## OpenWrt / LEDE trunk Installation & Usage
  19. * download the package [here](https://downloads.lede-project.org/snapshots/packages/x86_64/packages)
  20. * install 'travelmate' (_opkg install travelmate_)
  21. * configure your network to support (multiple) wlan uplinks and set travelmate config options (see below)
  22. * set 'trm\_enabled' option in travelmate config to '1'
  23. * travelmate starts automatically during boot and will be triggered by procd interface triggers
  24. ## LuCI travelmate companion package
  25. * download the package [here](https://downloads.lede-project.org/snapshots/packages/x86_64/luci)
  26. * install 'luci-app-travelmate' (_opkg install luci-app-travelmate_)
  27. * the application is located in LuCI under 'Services' menu
  28. * _Thanks to Hannu Nyman for this great LuCI frontend!_
  29. ## Travelmate config options
  30. * travelmate config options:
  31. * trm\_enabled => main switch to enable/disable the travelmate service (default: '0', disabled)
  32. * trm\_debug => enable/disable debug logging (default: '0', disabled)
  33. * trm\_automatic => keep travelmate in an active state (default: '1', enabled)
  34. * trm\_maxwait => how long (in seconds) should travelmate wait for a successful wlan interface reload action (default: '30')
  35. * trm\_maxretry => how many times should travelmate try to find an uplink after a trigger event (default: '3')
  36. * trm\_timeout => timeout in seconds for "automatic mode" (default: '60')
  37. * trm\_iw => set this option to '0' to use iwinfo for wlan scanning (default: '1', use iw)
  38. * trm\_radio => limit travelmate to a dedicated radio, e.g. 'radio0' (default: not set, use all radios)
  39. * trm\_iface => restrict the procd interface trigger to a (list of) certain wan interface(s) or disable it at all (default: wan wwan)
  40. ## Runtime information
  41. **receive travelmate information via ubus:**
  42. <pre><code>
  43. ubus call service get_data '{"name":"travelmate"}'
  44. This will output the current connection status, e.g.:
  45. {
  46. "travelmate": {
  47. "travelmate": {
  48. "last_rundate": "02.04.2017 07:22:03",
  49. "online_status": "true",
  50. "station_interface": "wwan",
  51. "station_radio": "radio1",
  52. "station_ssid": "blackhole",
  53. "system": "LEDE Reboot SNAPSHOT r3888-8fb39f1682",
  54. "travelmate_version": "0.6.0"
  55. }
  56. }
  57. }
  58. </code></pre>
  59. ## Setup
  60. **1. configure a wwan interface in /etc/config/network:**
  61. <pre><code>
  62. [...]
  63. config interface 'wwan'
  64. option proto 'dhcp'
  65. [...]
  66. </code></pre>
  67. **2. add this interface to your firewall configuration in /etc/config/firewall:**
  68. <pre><code>
  69. [...]
  70. config zone
  71. option name 'wan'
  72. option network 'wan wan6 wwan'
  73. [...]
  74. </code></pre>
  75. **3. add required ap and wwan stations to your wireless configuration in etc/config/wireless:**
  76. <pre><code>
  77. [...]
  78. config wifi-iface
  79. option device 'radio0'
  80. option network 'lan'
  81. option mode 'ap'
  82. option ssid 'example_ap'
  83. option encryption 'psk2+ccmp'
  84. option key 'abc'
  85. option disabled '0'
  86. [...]
  87. config wifi-iface
  88. option device 'radio0'
  89. option network 'wwan'
  90. option mode 'sta'
  91. option ssid 'example_01'
  92. option encryption 'psk2+ccmp'
  93. option key 'abc'
  94. option disabled '1'
  95. config wifi-iface
  96. option device 'radio0'
  97. option network 'wwan'
  98. option mode 'sta'
  99. option ssid 'example_02'
  100. option encryption 'psk2+ccmp'
  101. option key 'xyz'
  102. option disabled '1'
  103. config wifi-iface
  104. option device 'radio0'
  105. option network 'wwan'
  106. option mode 'sta'
  107. option ssid 'example_03'
  108. option encryption 'none'
  109. option disabled '1'
  110. [...]
  111. </code></pre>
  112. **4. reload network configuration & start travelmate:**
  113. <pre><code>
  114. /etc/init.d/network reload
  115. /etc/init.d/travelmate start
  116. </code></pre>
  117. ## Support
  118. Please join the travelmate discussion in this [forum thread](https://forum.openwrt.org/viewtopic.php?id=67697) or contact me by [mail](mailto:dev@brenken.org)
  119. ## Removal
  120. * stop the travelmate daemon with _/etc/init.d/travelmate stop_
  121. * optional: remove the travelmate package (_opkg remove travelmate_)
  122. Have fun!
  123. Dirk