Random, semi-coherent real-time driving directions
random-directions generates random, semi-coherent driving directions.
They’re not particularly good directions, and they don’t exactly head towards
a particular destination, but they’re directions nonetheless.
There are two main components to this system: the navigator and the sensor
client. The navigator is the program that actually produces the directions.
The sensor client sends sensor data to the navigator.
The sensor client must be run on an Android device in Termux, while the
navigator can be run anywhere. You must ensure that changes to files in this
repository are propagated to both the navigator and the sensor client.
There is one additional component, the local IP storage server. This is a
publicly accessible web server that serves as storage for local IP addresses,
so that the navigator and sensor client can find each other. The local IP
storage server doesn’t need most of this repository; it needs only thelocal-ip
directory.
All programs must be run in a Unix-like environment.
On the sensor client device (Android), in Termux:
On the navigator device:
On the local IP storage server:
Run pip3 install -r requirements.txt
to install the Python packages. You can
also use requirements.freeze.txt
instead to install specific versions of the
dependencies that have been verified to work.
Set up the local IP storage server:
local-ip
directory to a publicly accessible web server.local-ip/index.txt
and local-ip/set.py
can be accessed overlocal-ip/set.py
is executed as a CGI script.send_ip/config.py
. Set HOST
to the hostname of the web server.SET_URL
to the URL of local-ip/set.py
.sensors/config.py
. Set GET_IP_URL
to the URL oflocal-ip/index.txt
.config.py
files have been propagated toSet up the sensor client:
apt install termux-api
.termux-sensors -l
to determine the name of thesensors/config.py
. Set MAGNETOMETER
and GRAVITY
to the namesconfig.py
have been propagated to both theSet up the navigator:
sensors/config.py
.PORT
. If not, change PORT
on all devices.scripts/send-sensors.sh
on the Android device (sensor client).scripts/start-directions.sh
to start the navigator. The navigatorsend-sensors.sh
.Note that various scripts create a .cache
directory in the root of this
repository and write files into it. This directory may be deleted, although it
is best to do so when none of these programs are running.
random-directions is licensed under version 3 or later of the GNU Affero
General Public License. See LICENSE.