Recoil:HubWDS

From Lazer Swarm Wiki
Jump to navigation Jump to search

YouTube Video Walkthroughs

Implement WDS on Recoil Game Hubs

This procedure can be used to implement WDS (Wireless Distribution System) on stock Recoil Game Hubs (Atheros AR9331 SoC).

As this is a hub and spoke system the master hub should be in the centermost position. For example C==M==C will function M==C==C will not. You may have up to 4 clients to a single master.

First update to the current firmware (1.0.99) by powering on the hub, connecting to it with the official Recoil app and trying to start a Battle, you do not need a tagger connected you may just select "mobile only" player. Follow all the instructions, once that is finished you may close the app.

As a safety measure, If the client hub doesn't find its master within about 180 seconds after boot, it will revert to its original configuration (you will know because it will start broadcasting its original SSID). If this happens and you want the hub to operate as a WDS client again, you just have to power it off and on again. The failover script will also kickstart a new instance of the recoil app, so you could then use it to run a stock recoil game after it starts broadcasting its default SSID.

There is also a bug in this version of hostapd where if a WDS client loses connection but re-established a link before the master has aged out the old connection traffic will not flow... I have made changes to status.htm showing the amount of time that has elapsed since a client went offline. If a client does get disconnected you will need to turn it off and wait until the status page shows a blank "last seen" time, then turn it on and it will reconnect.

The setup script adds two aliases to make working with your hubs in the future simpler and installs openssh.

alias ssh1='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no [email protected] 2>/dev/null'
alias scp1='scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no HubWDS3.7.tgz [email protected]:/tmp/tmp/ 2>/dev/null'
pkg install openssh -y >/dev/null 2>&1

makemaster.sh configures the currently connected Recoil hub into a WDS master and copies its MAC address to the MACS file for use by makeclient.sh. The master hub scripts install several packages, makes the necessary changes to configuration files and patches the Recoilâ„¢ binaries. It also enables a http server that displayes wds client statuses and makes the USB host port available. The LED pins get re repurposed to show wds client status as well.

  • List of files packed in the HubWDS3.7.tgz:
block-mount_2016-07-24-addd7dc21fe99f2701c1d4708071578052af401d_mips_34kc.ipk
kernel_4.4.15-1-ee1da07d253ffe4010e42e59785b734b_mips_34kc.ipk
kmod-fs-vfat_4.4.15-1_mips_34kc.ipk
kmod-nls-base_4.4.15-1_mips_34kc.ipk
kmod-nls-cp437_4.4.15-1_mips_34kc.ipk
kmod-nls-iso8859-1_4.4.15-1_mips_34kc.ipk
kmod-nls-utf8_4.4.15-1_mips_34kc.ipk
client.sh
master.sh
stationstatus.sh
WDSCheck.sh

makeclient.sh reads MACS file for the master mac address. Then configures the currently connected Recoil Hub into a WDS client and adds that Hubs MAC to the MACS file.

The "old" method - using existing installation of Termux or a Linux terminal - master + client

The (what I call "old") method uses Termux as a Linux bash terminal. It downloads the WDS archive, unpacks it and executes the either makemaster.sh or makeclient.sh script. But as the ssh-dss protcol has been deactivated with newer versions of openssh in Termux the option ssh-rsa had to be taken. On mobile phones (like in these instructions) it seemed not possible to use the required Auth Key and establish the connection to the router. So these following instructions are merely for older Termux installations (do not carry out setup.sh - as it will update openssh) or for Linux terminals (either native or in a Windows shell).

Phone setup

  • As there are no good terminal programs left on the Apple store since OpenTerm went away these directions are intended for Androids only (for now)

PC setup

For Windows 10 users please follow the instructions in the attached link: https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/ This will tell you how you install a WSL (Windows Subsystem intended for Linux) on your Windows PC. It takes about 5 minutes and a reboot - that's it. It will give you the opportunity to start the Linux Terminal just by pressing WINDOWS+R and entering "Bash". Create your username and password and you are redy to go.

 mkdir wds 
 cd wds 

fetch WDS files

  • Make sure you are connected to the Internet
  • Download the archive containing the scripts and the HubWDS3.7.tgz
curl -O https://recoil-game.de/wds/wds.tar > wds.tar
  • extract the files
tar xvf wds.tar
  • run the setup.sh script (which will install/update openssh)
./setup.sh
 exit 
  • Now re-open Termux/Linux Bash and continue

building your set

  • connect to hub SSID to be made the WDS master.
  • From Termux/Terminal run makemaster.sh
 ./makemaster.sh 
  • This will copy HubWDS3.7.tgz to the hub showing the percentage of completion
  • Then it will initiate the master.sh on the hub, resolving in a display of the master's MAC address
  • Switch it off and then on again - it should show the WiFi SSID Recoil Game Hub_WDS


  • Put the master away (still switched on) and connect to the next hub WiFi SSID you want to make the first client
  • From Termux/Terminal run makeclient.sh
 ./makeclient.sh 
  • Follow the on screen directions
  • Following this procedure you may add up to 4 clients in total

The new method - using WinSCP on PC and ssh-client on your mobile - just master

This new method will download the required archive HubWDS3.7.tgz from the webserver and put it manually on your Recoil Game Hub in a WinSCP session. After that you may connect with your mobile via ssh and carry out 3 single commands to have that archive unpacked and started. This method however is not capable of creating additional clients linked to the existing master. With this you can just create master hubs - which might be sufficient if you just want to benefit from sticky WiFi, UDP-support and webserver capabilities.

Using WinSCP on your PC

  • First you have to install WinSCP on your PC. It is freeware - find it here: https://winscp.net/eng/download.php
  • Second you have to download the archive to be put on your Recoil Game Hub - find it here: https://recoil-game.de/wds/HubWDS3.7.tgz
  • Now you connect via WiFi to your Recoil Game Hub you want to mod
  • Start WinSCP and connect to your Recoil Game Hub using SCP - ip: 11.11.11.1 username: root and password left blank


WinSCP login.jpg


  • Add\Update the unknown host in the next windows
  • Now navigate to the directory /tmp/tmp/
  • Drag and drop (or copy and paste) the downloaded HubWDS3.7.tgz into that directory
  • Close WinSCP

Using ssh-client on your mobile

You may probably take any ssh client you fancy on your mobile, but I have used ConnectBot which proved to be sufficient.

  • Download ConnectBot from Google Play - find it here: https://play.google.com/store/search?q=connectbot&c=apps&hl=en
  • Connect to your Hub with Wifi - the SSID should run like "Recoil Game Hub_d47ff3" where last part equals the last 6 digits of the Hub's MAC address
  • Open ConnectBot and create a new connection pressing the "+" button
  • Enter as username@hostname: [email protected] - still no password required
  • Save and tap on it to connect
  • window
  • Enter the following commands followed by an Enter
cd /tmp/tmp/
tar zxf HubWDS3.7.tgz
./makemaster.sh
reboot
  • Now press the power button of the hub to switch it off
  • Then press the power button to switch it on again
  • The SSID should now run Recoil Game Hub_WDS if everything went fine

Verify the system works

  • Connect to ssid 'Recoil Game Hub_WDS' (key = 'recoil123') - this makes it much more "sticky" for the phones.
  • You should now be able to ping and ssh into both 11.11.11.1 and 11.11.11.2 and any other clients (.2,.3,.4,.5) you have created

Modify SSID and password

  • You might also be able to connect to the router with WinSCP ( protocol SCP, 11.11.11.1, port 22, username:root no password ).
  • Navigate to /etc/config/ and open the file "wireless".
  • In the second block "config wifi-iface" you can modify the ssid ( default: Recoil Game Hub_WDS ) and the key ( default: recoil123 ).
  • Save, close the file and reboot the router to apply changes.

Revert configuration / Reset Router

To revert a hub to its stock configuration, use the debrick method at the top of the main Recoil:Hub page this will return the device to factory recoil default.


To recover from configuration errors or just to return to a factory state you can connect to the hub by ssh ([email protected]) or by the serial console and issue the following commands:

firstboot -y && reboot


Ssh reset s.jpg

Wait one minute and press the power button to power the hub off, press the button again to power on the hub. When the light goes solid it is finished and is now in a factory fresh state. Before carrying out the WDS-Mod again you will have to connect a phone to the SSID, run the latest Recoil Game App and allow it to re-update the hub. When it is finished power down the hub and switch it on again.