The forumslogger (or Forumslader-logger) is a small man-in-the-middle board for logging [Forumslader automatiklader](http://www.forumslader.de/automatiklader/) data.
The Automatiklader can also be enhanced with a [bluetooth module](http://www.forumslader.de/automatiklader/erweiterungen/bluetooth/), allowing a phone to log precise speed (using the dynamo activity), battery charge, and other values using the [forumslader Andoird app](https://play.google.com/store/apps/details?id=com.duringsoft.forumslader).
Thus instead of using Bluetooth to get the Forumslader data (like the phone would do), we remove the Forumslader Bluetooth module, connect our logger board directly to the underlying serial port, and our board will have a Bluetooth module so to forward the data again to the phone.
Since our board sits between the Forumslader and phone it can log the data all the time.
This also adds timestamps to the Forumslader data (every second the GPS sends the UTC time) and log the actual route cycled.
While GPS also provides speed, the Forumslader data based on the dynamo is much more precise (similar applies to the distance).
On top of the Forumslader commands, the logger provides additional commands to list, retrieve, and delete the logged data files (starting with `$FLL,`, for Forums-Lader-Logger).
*`$FLL,LS;`: will list the log files. Example
<pre>
$FLL,LS,BOL;
$FLL,LS,forumslogger_2017-08-19_04-30-41.txt;
$FLL,LS,forumslogger_2017-08-17_10-11-55.txt;
$FLL,LS,EOL;
</pre>
* to remove a file, use `$FLL,RM,forumslogger_YYYY-MM-DD_hh:mm:ss.txt;`. This will return `$FLL,RM,OK;` or `$FLL,RM,ERROR;`
* to retrieve/dump a log file, use `$FLL,CAT,forumslogger_YYYY-MM-DD_hh:mm:ss.txt;`. Example:
The forumslogger uses a common HC-05 Bluetooth module for communication with the user.
Accordingly it is necessary to configure this Bluetooth module.
For that enter the AT control mode:
* connect the Bluetooth module to a USB to UART converter
* press and hold the button on the module
* plug the USB to UART converter to a computer
* the module should blink every two seconds, indicating it entered the AT control mode
* connect to the module using the USB to UART serial port with a baud rate of 38400 (8N1)
Alternative war to enter the AT control mode are described [here](https://alselectro.wordpress.com/2014/10/18/bluetooth-module-hc-05how-to-pair-2-modulesat-command-walkthrough/).
Once connect configure the Bluetooth module:
* enter `AT` to check if the UART communication is working. The module should respond with OK
* change default PIN for a tiny bit of better security: `AT+PSWD=1337`
* change the normal mode baud rate: `AT+UART=115200,0,0` (the Forumslader uses 9600 but there is no good technical reason to keep this slow speed, and the forumslogger uses 115200)
* set the device name: `AT+NAME=forumslogger` (different to `Forumslader` to avoid confusion)
Now connect to Bluetooth module to the forumlogger.
When powered the module will rapidly blink (in normal mode).
Once paired and connected the module will double blink every 3 seconds.
There are two firmware images: `bootloader` and `application`.
The `bootloader` image allows to flash the `application` over USB using the DFU protocol.
The `bootloader` is started first and immediately jumps to the `application` if it is valid and the DFU mode is not forced (i.e. by pressing the user button on the board or requesting a DFU detach in the `application`).
The main application should be implemented in `application.c`.
It is up to the application to advertise USB DFU support (i.e. as does the provided USB CDC ACM example).