A moon-phase-driven captive portal created by Tega Brain...
This wireless access point is influenced by the phase of the moon. It acts as a captive portal and shows moon-phase information on the mandatory signon screen...
Wireless parameters reflect the current moon phase....
- signal power waxes and wanes between full strength 15dBm at New Moon and barely connectible 0dBm at Full Moon
- SSID adapts to show an apropriate unicode moon emodicon
- You have this router with factory installed standard OpenWRT image...
- The router is connected to the internet via the WAN port.
- You have a laptop with SSH on it that can connect to the router over Wifi.
- Press and hold the reset button for 8 seconds to reboot the router to factory default state
- Wait for the AP to come back up and connect to it over Wifi (default password is "goodlife")
- Navigate to 192.168.8.1
- Set new password
- Wait for the AP to come back up and connect to it with the new password
- SSH to 192.168.8.1 and log in with the new password
- Enter this command...
opkg update
... to get the package manager ready for the installs we are about to do.
- Enter this command...
opkg install wireless-tools
... to get the iwconfig
command that we will use to dynamically adjust the wifi signal strength. (I know we should be able to use just iw
, but it doens't seem to work.)
- Enter these comands...
opkg install nodogsplash
/etc/init.d/nodogsplash enable
...to install the nodogsplash package and enable it to run automatically on boot.
-
Copy the contents of
/etc
of this repo to the/etc
directory on the device. I use SCP. -
Run the install script...
cd /etc/moonWap
chmod +x install.sh
./install.sh
...to install the moonWAP
configuration.
- Reboot to start
nodogsplash
.
- Connect to the device over Wifi using the password you set above
- Navigate to 192.168.8.1
- Remove Wifi security under
Advanced Settings->Network>-Wifi->Edit->Wireless Security->Encryption->No Encryption
. Be sure to hitSave & Apply
.
Note that this process is slightly more complicated than it needs to be since GitHub only allows HTTPS access and our distributtion does not have an HTTPS capable client.
- Get the Weaved OpenWRT tarball from here...
https://github.com/weaved/installer/tree/master/binaries
...and download it to the box (I use WinSCP to copy it).
- Unpack the tarball and install...
tar -xvf weaved-OpenWRT-9331-0.94.tar
cd weaved
./install.sh
- Optionally disable the
http
tunnel since we won't need it.
rm /etc/init.d/weavedWEB
- Log into the Weaved website and wait for this new machine to show up under services.
There follwing parameters in the /etc/nodogsplash/nodogsplash.conf
file might be relevant...
Default: 20
Set MaxClients to the maximum number of users allowed to connect at any time. (Does not include users on the TrustedMACList, who do not authenticate.)
Default: 10
Set ClientIdleTimeout to the desired of number of minutes of inactivity before a user is automatically 'deauthenticated'.
Default: 360
Set ClientForceTimeout to the desired number of minutes before a user is automatically 'deauthenticated', whether active or not
Once the device boots up, it will create a wifi network. The SSID will be a little picture of the moon and will corespond to the current phase.
Upon connecting to the wifi network, you should automatically see a splash screen with the current status of the access point. Click on the moon image to gain access to the internet.
The router automatically updates the moon phase parameters each night at midnight. You will need to reconnect to the new SSID if it changes to a new emoticon durring the update.
You can check the details of the most recent moonphase calculation by connecting and then browsing to...
http://192.168.8.1:2050/pages/mooncalc.html
..which will show something like...
Calcuilating moon phase for 2016-04-13 22:06:46
Recent new moon was at 2016-03-09 01:24:00
Current lunar cycle lenth is 2551442 seconds (~29 days)
It has been 3098566 seconds (~35 dayss) since recent new moon
We are 547124 seconds (~6 days) into the current lunar cycle
Curently day 6 of 30 in lunar month
SSID = ð
Name = FIRST QUARTER
Image = moon-0044.jpg
QOS = 50% AND WANING
Power= 8 of 15
Note that the SSID uses emoji unicodes which seem to be displayed correctly when in SSIDs but do not display as glyphs inside HTML documents in browsers at the moment.
- Right now nodogsplash does not do anything to DNS requests, so the access point must have an internet connection or else the initial probe will fail and the user will not see the login screen. Might be nice to catch these DNS requests and serve them locally.
- Might be nice to animate the moon and signal strength localy in javascript.