Tag - MTK3339

Entries feed Comments feed

OpenCyclingComputer update

OpenCyclingComputer is finally reaching the "road ready" stage:

OpenCyclingComputer, Sep 2018

What works:

  • BLE connection with heart rate sensor. Also automatic re-connection and graceful quiet handling of all errors from bluez stack.
  • BLE connection with speed and cadence sensor. It's really wheel revolution and cadence sensor, but given wheel size it works as speed sensor.
  • Pressure sensor. Iit will be used as an altimeter in the near future. Coded with Kalman filter
  • Temperature sensor
  • GPS module - I still need to do some debugging here, but the drivers were tested on raspberry A+ and worked great.
  • YAML layouts. It's very easy to change the default layout - it's simply a text file + some background images.
  • Saving / reading config file. Also YAML,  so it's a human editable.
  • "Animated" heart rate and cadence icons showing that the related sensors are "alive" and keep sending notifications.
  • All settings can be edited from the OCC screen

Things that need polishing:

  • Calculating averages (speed, heart rate, etc)
  • Implementing Kalman filters where suitable
  • BLE scanning and selecting devices from the OCC screen
  • Calculating altitude and all related parameters like slope, pressure at sea level and others
  • BLE status icon works, but it doesn't show exactly what's happening with the connection
  • Implementing Low Battery warning/shut down (hardware is ready)
  • Improving ride log. Currently the format of the log is hard coded

Code develpoment:

  • defining sensor API for future extensions
  • plugging accelerometer into the current system
  • implementing inertion+gps navigation with multi input Kalman filter
  • code cleaning and refactoring

Python library for Raspberry PI for Ultimate GPS based on MTK3339 with serial interface as sold by Adafruit


Python library for Raspberry PI for Ultimate GPS based on MTK3339 with serial interface as sold by Adafruit. The library helps to set different chip parameters in a sane way. Currently supports minimum functional set of commands:

CMD_HOT_START - hot_start()

CMD_WARM_START - warm_start()

CMD_COLD_START - cold_start()

CMD_FULL_COLD_START - cold_reset()

SET_NMEA_UPDATERATE - set_nmea_update_rate()

SET_NMEA_BAUDRATE - set_baudrate()

API_SET_FIX_CTL - set_fix_update_rate()

API_SET_NMEA_OUTPUT - set_nmea_output()

SET_NAV_SPEED_TRESHOLD - set_nav_speed_threshold()

All functions are preforming basic range check to make sure values areaccepted by MTK3339 as there is no check if a call was successfull or not.

Example usage:

import mkt3339

gps = mt3339("/dev/ttyAMA0")






gps.set_nmea_output(gll = 0, rmc = 1, vtg = 0, gga = 5, gsa = 5, gsv = 5)

That library is part of Open Cycling Computer project