- For the track day enthusiast
- For the SW Engineer / maker
- HowTo
- Hardware build instructions
- Software build instructions
- Possible enhancements and ideas
- Credits and tools
The main goal of this device is to make GPS data (speed, location) available to mobile apps that can record data, for example for track riding. While there are many good (and not even too expensive) solutions out there, COVID-19 happened and this was a great way to spend some time building something myself.
Currently these apps are supported
- Harry's Lap Timer >> details here
- TrackAddict >> details here
- RaceChrono >> details here
- RaceTime >> details here
If you are not into the maker thing or if you don't know anyone who might be, look into RaceBox products like mini/miniS or a XGPS160.
This repo contains software, list of hardware, and (simple) schematics to build an ESP32 device to reads NMEA sentences from a GPS receiver compatible with u-blox M8 (for example BN880, BN220, or DIYmall Micro GPS with NEO-M8N ) and repeats them back to a logger device, either
- a TCP/IP socket
- a Bluetooth Low Energy (BLE) service
- a BT Classic (BT-SPP) stream
The logger device is likely going to be one of the Track Lap time apps listed above running on your phone.
Examples of actual devices are in hardware/assembled, at a cost of 25$ and 40$ (GPS receivers with active antennas are a little bit more expensive but worth it, and a larger battery helps as well)
A web configuration (extremely basic responsive HTML) panel allows changing configuration and select GPS parameters on the fly: access it via http://bonogps.local (when in WiFi AP mode, this becomes http://10.0.0.1 on Android without mDNS resolution).
The settings required by each app are available as presets that you can load for your device (iOS, Android). More information on what version, features, and connections of each app are in software/connecting.
You can also interface your GPS to uBlox u-center via TCP/IP, in this case be aware that the uart speed is fixed.
- Turn on the ESP32 and wait a few minutes for the GPS to get a fix on position (on BN devices, the red led will blink every second)
- Open your preferred mobile app and connect it to your BonoGPS-ABCD device (ABCD is a combination of 4 letters and numbers unique to your ESP32 device)
- Enjoy your ride!
Most runtime configurations are managed via its web-based interface: you can use your phone or any device with a web browser which is able to connect to either the built-in Access Point the BonoGPS provides or (if you are home and on you have configured the WiFi Client credentials) http://bonogps.local
The local built-in access point will be named BonoGPS-ABCD device (ABCD is a combination of 4 letters and numbers unique to your ESP32 device) and the password to it is in the source code (you can change it to your discretion - it's simply meant to avoid anyone connecting by mistake)
- GPS runtime settings: GPS messages, rate of updates, serial port speed
- Connections: List clients, enable BLE/BT-SPP connectivity, enable/disable the builtin TCP-IP messages repeater, switch between WiFi client to a well-known WiFi network or built-in Access Point
- Device: Put GPS in powersaving for some time, Disable WiFi, load preset configurations, save current configuration, collect information about current status of the device, save WiFi credentials for client mode restart the ESP32
The BOOT button (or another button of your choice) allows you to loop between WiFi modes on the fly:
- short press: toggle between WiFi Access Point (built in led, usually blue, slowly blinking 500 ms cycle see it) and no WiFi (built in led off)
- long press (at least 2 seconds): enable WiFi Client so that you can reach the unit from your preferred WiFi network (internal led/blue led light flashes rapidly 250 ms cycle see it)
If you load a preset or if you change a runtime settings, you can preserve it across restart of the device.
Go to Device > Save Config and you'll find these options
For convenience, the WiFi status (Start its own AP, or connect to a local WiFi) can be excluded or saved separately.
There are many mobile apps to log lap times, few accept custom devices, in particular on iOS. The ones below are tested.
Harry Lap Timer | TrackAddict | RaceChrono | Racetime | |
---|---|---|---|---|
iOS | BLE, TCP-IP | TCP-IP | ||
Android | BT-SPP, TCP-IP | BT-SPP | BT-SPP | BT-SPP |
See more info in each subfolder of connecting.
You can load a preset configuration from the configuration page selecting Device > Load Preset and then choosing your mobile phone device and app combination (when there are alternatives, the recommended option is in bold)
The minimum build is a ublox M8 series GPS receiver module connected to an ESP32:
- TX/RX from the GPS to a serial port (default in the code is UART2/Serial2) on ESP32. Remember: you need to connect RX on one device to TX on the other and viceversa
- the GPS power pins to ESP32: VCC to 3v3, GND to GND
BN220 comes with a 4 pin adapter cable for GND TX RX VCC, while BN880 includes 2 additionals pins for SDA and SCL of the IMU which are not used so you should leave them unconnected.
Schematics are relatively simple
- power the GPS module (3.3V on ESP32 to VCC on GPS receiver, GND on ESP32 to GND on GPS receiver)
- connect GPS RX to ESP32 UART2 TX and GPS TX to ESP32 UART2 RX (RX and TX are switched: GPS transmits, ESP32 receives)
Examples are in hardware/assembled including an example with more options using an ESP32 device type Lolin D32 Pro which has an internal battery charger hardware/esp32/lolin_d32_pro.md
Thanks to needs of a very active drone community, there are a lot of inexpensive GPS receivers: some considerations on performance/accuracy/cost are reported in the hardware/GPS folder.
What you need to configure is documented in the hardware/GPS folder: this is important, the performances of your GPS won't be optimal until you do, or the whole setup will not work at all.
This code is developed specifically for ESP32, and tested with PlatformIO (main development platform) and the Arduino IDE (1.8.13). More information on what libraries are needed and software organization in the software/building folder.
See issues with label enhancement on the github project
- Very valuable information from the mobile apps developers: Harry's Lap Timer forum, HP Tuner Track Adict forum, RaceChrono forum
- Email conversations with Harald Schlangmann (Harry's Lap Timer) and Roberto Morini (Racetime) who I thank for the time and effort in developing and supporting their apps
- There are several other similar projects on github, a few from which I learned a lot: RaceChronoDYI-TBeam RaceChrono BLE DIY device (GPS and CAN-Bus) DAWA
- Screenshot framing by Mockuphone and Android developers marketing tools
- The GPS Dictionary