This device was planned for University of Helsinki, GREENTRAVEL project.
The aim is to create a device which stores GPS location whenever either of the two wireless buttons are pressed.
The device is a ESP8266-based microcontroller with following components:
- ESP8266 Wemos D1
- Two AUREL RX-4MHCS 4 channel receivers (manual)
- Two AUREL HCS-TX-3 (with one button) transmitters
- ublox NEO 6M GPS receiver (breakout board GY-GPS6MV2)
- Joy-IT uSD micro-SD breakout board
- Seeed Studio LiPo charger/booster 106990290
- LiPo battery 2000 mAh
- a button putting the device to transmit mode
- a led signalling transmit mode
- power switch
- Transparent box, see
doc/aliexpress_airlgee_box.jpeg
When booting, the unit initialises GPS and microSD card. In case of error, the device reports the error code (see below). A successful initialisation process reports with three short beeps.
After this the device starts the normal operation. Here, it receives the GPS data and waits an user action.
- Pressing the RED button is acknowledged by one long signal.
- Pressing the GREEN button is acknowledged by two short signals.
- The RED and GREEN buttons give with three short signals if number of satellites is zero or the GPS location is older than three minutes.
- Pressing the WiFi button starts the data upload (see below).
Pressing the RED/GREEN button writes the last received GPS information to log file.
The data upload process uploads the log data to server. After an successful upload the local log files are removed. Signals during the upload process
- Pressing the WiFi button is acknowledged by short-long-short signals.
- When trying to connect to the WiFi the unit sends short signals.
- If the device cannot connect to the WiFi network, the error code 6 is communicated.
- After an successful upload the device sends short-long-short signals.
- An failed upload is communicated by error code 7. In this case the WiFi connection was successful but the log server could not be contacted. The local data will be kept intact.
Errors codes are signalled as number of beeps after a S-O-S beep. The error message is also written to the
serial console (see signalBeepAndHalt()
).
Error codes:
- Failed to initialise SD writer
- Failed to initialise GPS serial device
- LittleFS mount failed (required by Otadrive)
- Could not open data file for reading
-
- Failed to upload data to server (wifi connection)
- Failed to upload data to server (https connection)
- Clear memory:
- Close switch > LED blink > Open switch > LED off > Close switch > LED blink > Open switch
- Teach new button:
- Close switch > LED blink > Press remote button > LED stady on
You have to repeat the programming procedure for both red and green receiver.
For more information see doc/AUREL_RX_MHCS.pdf
The src/
directory contains a small PHP server which
- receives data uploads from devices
- allows device users to check that their devices and data upload is working
- allows device fleet administrator to download log file
The setup is simple:
- Copy the
index.php
to PHP-enabled directory - Rename
settings.php.sample
tosettings.php
and edit constantDATA_PATH
to point a directory where the web server has write access - Create sha256 digest from your password:
echo -n "my admin password" | sha256sum
- Place this hash digest to
admin_password
file inDATA_PATH
directory. Add a newline after the hash string.
The documents in doc/
folder are subject to their own copyrights.