Skip to content

About

Modal Ring: Android application that records the COLMI Ring 2 accelerometer to CSV files, with a firmware modification that raises the accelerometer stream rate from 1 Hz to 12.5-100 Hz.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Modal Ring: accelerometer recorder for the COLMI Ring 2

Modal Ring is an Android application that records the accelerometer of the COLMI Ring 2 smart ring (hardware RT12) to comma-separated values (CSV) files. It was developed for the measurement of human motion and vibration during walking. The repository also contains a firmware study that raises the accelerometer stream of the ring from 1 sample per second to a rate selected in the application: 12.5, 25, 50, or 100 Hz.

Component Status (application: 2026-12-02, ring firmware and measurements: 2026-11-27)
Android application Modal Ring 1.9.5. Its recording is unchanged from 1.9.4, which was tested on a Samsung Galaxy A26 (Android 16).
Ring firmware Patched RT12CR2_1.01.15 on the test ring (Stage H, which extends Stage G: the ring never requests slow connection parameters while streaming, and after a Bluetooth pause its packet sender transmits the queued packets until the backlog is drained). Recovery image with the stock code: 1.01.16
Measured sampling rates 12.505 / 24.992 / 49.987 / 99.907 Hz at the nominal rates of 12.5 / 25 / 50 / 100 Hz, with 0 samples missed
100 Hz, 4 min, ring in motion 23977 samples, 0 missed, one continuous segment at 99.79 Hz (Stage G with application 1.9)
100 Hz, recorded together with 13 Yost inertial measurement units (IMUs) and the phone (Triple Recorder application) Four runs (2 x 120 s, 2 x 60 s): consecutive sample numbers from 1 to N, 0 missed, one segment, and a connection interval of 15 ms throughout (Stage H)

Ready to record Recording with the live signal Settings

Two seconds at each rate

Functionality

  • The application finds the ring even when the QRing application has paired it with the phone. Android keeps a paired ring connected, and the ring then stops advertising, so the application connects to it by its address.
  • When the application is opened, it connects to every ring that is paired with the phone. A ring that is not paired is found with Scan and connected with Connect. The application keeps the connection between recordings, so that the ring never becomes unreachable over Bluetooth. Record starts the stream immediately. It never waits for the ring to be removed from its charger. If the ring is on the charger, the application reports this and takes no further action.
  • The application restarts a stalled stream and reconnects after a dropped connection. If the ring nevertheless becomes unreachable, the application asks the user to touch the ring to its charger.
  • A recording lasts for a set number of seconds of data, or until Stop, and continues with the screen off.
  • The application writes accel.csv (acceleration in g, magnitude |a|, roll, pitch, raw counts, sample number, buffer slot and arrival time), the optional files optical.csv and packets.csv, and info.txt and log.txt to Documents/Ring_logs/... by default. The folder inside Documents is set in Settings under Save to.
  • With the patched firmware, the ring sends every sample of its buffer, and the application counts as missed the samples whose buffer slot numbers are skipped. A loss that leaves no skip in the slot numbers is not counted. With this firmware, samples that the ring marks as disturbed are also excluded, and at Stop the samples of each continuous segment receive uniformly spaced time stamps. The rate of each segment is fitted to the arrival times of its samples. The nominal rate is used instead when the segment spans less than 4 s, contains fewer than 10 distinct arrival times, or gives a fitted rate that differs from the nominal rate by more than 3 %.

Documentation

Document Content
docs/USER_GUIDE.md Installation, recording, settings, file columns and the characteristics of each sampling rate
docs/PROTOCOL.md The Bluetooth protocol of the ring: services, commands, stock and patched packets, rate codes and firmware update frames
docs/FIRMWARE.md The firmware study: image format, the cause of the 1 Hz stock rate, the accelerometer chip configuration, Stages 0, A, A2, B, B2, B3, C, C2, D, E, F, G and H, results, image hashes, and the rebuild, flashing and reversal procedures
docs/DEVELOPMENT.md Toolchain, build, signing, code map, the sequence of a recording, tests, phone test scripts, version history and future work

Building from source

The build requires the Java Development Kit (JDK) 17 and the Android Software Development Kit (SDK) with platform 34. The Gradle wrapper downloads Gradle 8.9.

.\gradlew testDebugUnitTest      # 57 JVM tests
.\gradlew assembleRelease        # app/build/outputs/apk/release/

Release signing reads keystore.properties, which is not tracked in git (see keystore.properties.example). Without this file, the release Android application package (APK) is unsigned and the debug APK is signed with the Android debug key. GitHub Actions builds and tests every push (.github/workflows/android.yml).

Repository layout

app/                      Android app (Kotlin, no third-party libraries beyond the Kotlin standard library and the JetBrains annotations it brings in)
  src/main/java/colmi/recorder/   Protocol, Ble, Hold (held link), RingSession, Core, Settings, UI, OTA
  src/test/java/colmi/recorder/   JVM tests (simulated ring, recorded packets, re-timing, update frames, notices)
tools/                    phone_run.py, phone_stress.py, ota_run.py (adb test drivers), plot_rates.py
firmware/                 patch builders (stage_*.py), Thumb assembler, disassembly helpers
pc/                       colmi_accel.py: the first PC script (bleak, stock firmware)
third_party/              Edge Impulse ring.py, fixed for the RT12 ring (Clear BSD License)
docs/                     the documents above and their images
LICENSE, THIRD_PARTY_NOTICES.md, CONTRIBUTORS.md, CONTRIBUTING.md

Firmware warning

Flashing modified firmware can render a ring unusable, and no wired recovery method is known. The patches were tested on a single ring. The vendor's firmware file and the images built from it are not included in this repository. The patch builders require the user's own copy of the stock file, from which they rebuild every image byte for byte, except the superseded Stage B image 1.00.95 and its recovery image 1.00.96 (docs/FIRMWARE.md). Each patch builder (stage_*.py) also writes a recovery image with the stock code.

Disclaimer of affiliation

COLMI and QRing are names that belong to their respective owners. This project is not produced, reviewed or endorsed by them. It communicates with the ring through the ring's own Bluetooth commands and does not use code from the vendor's application.

Credits

Modal Ring builds on the published work of the following authors. Their work remains their own, under their respective licenses.

  • Wesley Ellis, colmi_r02_client (MIT): the packet format and commands of the ring.
  • Edge Impulse Inc., example-data-collection-colmi-r02 (Clear BSD): the commands of the raw-sensor stream. third_party/edgeimpulse-colmi-r02/ring.py is their code under the Clear BSD License, with the local changes listed alongside it.
  • Devan Metz, colmi-r12-zwift (MIT): the firmware image format and the update frames (the format was read, and no code was copied).
  • atc1441, ATC_RF03_Ring (GPL-3.0): findings on the ring firmware. Its issue 24 showed that the raw-sensor rate is set inside the firmware. In that issue, halsbox identified the byte that sets this rate in the R02 firmware (the work was only consulted, and nothing was copied).
  • Included in the application: the Kotlin standard library and the JetBrains Java Annotations 13.0, on which the Kotlin standard library depends (JetBrains, Apache 2.0). Included in this repository: the Gradle wrapper files (Gradle authors, Apache 2.0).
  • Separately installed tools: bleak by Henrik Blidh (MIT) for the personal computer (PC) script and ring.py, Capstone by Nguyen Anh Quynh (BSD 3-Clause) for the firmware tools, and matplotlib, pandas and requests for the plots and ring.py. Gradle downloads JUnit 4.13.2 (Eclipse Public License 1.0) for the tests. THIRD_PARTY_NOTICES.md lists all of them.

License

Copyright (c) 2026 Jovdat Babazade. Modal Ring is released under an attribution-required, ownership-retained license (see LICENSE). In summary, the repository is public. Anyone may read and check it, and may build, run and modify it for their own research, teaching or learning. Anyone may also publish results with the credit "Modal Ring, developed by Jovdat Babazade". The credits to the authors above, and to the contributors in CONTRIBUTORS.md, must be kept in every copy and fork. The following are not permitted without written permission: redistribution of the code outside GitHub forks, redistribution of the APK or firmware images, commercial use and any claim of authorship.

Contributions are welcome. The procedure is described in CONTRIBUTING.md. Contributors retain the copyright in their own work and are credited in CONTRIBUTORS.md. They grant the owner the license set out in LICENSE Section 6. Modal Ring as a whole remains the owner's.

Two parts of the repository retain their own licenses: third_party/edgeimpulse-colmi-r02/ (The Clear BSD License) and the Gradle wrapper files gradlew, gradlew.bat and gradle/wrapper/ (Apache License 2.0). Details are given in THIRD_PARTY_NOTICES.md.

About

Modal Ring: Android application that records the COLMI Ring 2 accelerometer to CSV files, with a firmware modification that raises the accelerometer stream rate from 1 Hz to 12.5-100 Hz.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages