Switch branches/tags
Nothing to show
Find file History
Latest commit 332c7d1 Sep 25, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md Update README.md Jul 18, 2018
config.h Fix Aug 7, 2018
config.xml HTTPd not enabled by default Aug 12, 2018
datalogger.h Fix typo Aug 23, 2018
datalogger.ino Update Sep 23, 2018
dataserver.cpp Update Aug 7, 2018
platformio.ini Improve May 19, 2018


This Arduino sketch is designed for running on Freematics ONE+ and the ESP32 Arduino Telematics Kit, to collect vehicle telemetry data from OBD-II, GPS and motion sensor, store the collected data in Flash or microSD card and provide access for data through WiFi and BLE.

Data Collection

The sketch collects follow data.

  • Vehicle OBD-II PIDs data (from OBD port)
  • Battery voltage (from OBD port)
  • Geolocation data (from connected GNSS receiver)
  • Acceleration data (from built-in motion sensor)
  • Orientation data (computed from motion sensor data fusion)


When GNSS receiver is connected and detected, geolocation data will be obtained and logged. GPS UTC time is used to sync the device's real-time clock.


The device orientation (yaw, pitch roll) can be calculated from collected motion sensor data with quanterion algorithm. This normally reflects the orientation of the vehicle if the device is fixed to vehicle (e.g. firmly plugged in OBD port) This feature consumes extra computation power and is disabled by default.


By default, ESP32's internal flash is used for data storage (file-based, using SPIFFS). Simple rotation logging is implemented due to limited storage size. MicroSD data logging is also supported.

HTTP Server

A multiple-connection HTTP server HTTP server runs over ESP32's WiFi (AP and/or station). A set of REST API provides remote access to device status, statistics and real-time data and logged data.

Implemented HTTP APIs:

  • /api/info - device info
  • /api/live - live data (OBD/GPS/MEMS)
  • /api/list - list of log files
  • /api/log/[file #] - content of CSV format log file
  • /api/data/[file #]?pid=[PID # in HEX] - JSON array of PID data


A TCP server (default port 4000) is brought up and the NMEA data stream from GNSS receiver is redirected to a incoming TCP connection. This can be used to visualize GNSS signal with software like u-blox u-center over WiFi.