Skip to content
pedroriveraPublic

About

Download and plot recordings from Wellue/Viatom O2 oximeters (Checkme O2 Max, O2Ring) over Bluetooth LE

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

o2sync

Download and plot recordings from Wellue / Viatom "O2" pulse oximeters over Bluetooth LE — no cable, no vendor app. Built and verified against a Checkme O2 Max (advertises as O2M xxxxxx); other devices speaking the same "Oxy" protocol (O2Ring, Checkme O2, SleepU, WearO2, KidsO2, BabyO2, Oxylink) are matched by name but untested.

Uses bleak, so it runs on Linux (BlueZ) and Windows (WinRT), and should work on macOS.

Install

pip install o2sync            # or "o2sync[plot]" for matplotlib PNG output

From a checkout, for development: pip install -e ".[test]".

Linux: needs BlueZ (bluetoothctl should work) and a user allowed to use D-Bus Bluetooth (default on desktop distros). Windows: Windows 10/11 with Bluetooth LE. Smart App Control can block bleak's unsigned winrt module ("An Application Control policy has blocked this file") until it has vetted that version; it usually clears after a while. Installing with constraints.txt (pip install -c constraints.txt o2sync) pins the versions verified to work. Smart App Control can also block the o2sync.exe launcher that pip generates; if running o2sync fails that way, use python -m o2sync ... instead, which takes the same arguments.

Use

Wake the oximeter (press its button), keep it close, and close the ViHealth app on your phone — the device accepts only one connection and only advertises for a short while after waking. It must not be recording.

o2sync sync                    # scan, fix the device clock, download new files to ./recordings
o2sync sync --csv --report     # ...and write CSVs + recordings/report.html
o2sync plot recordings         # HTML report of everything downloaded so far
o2sync plot recordings --png pngs   # matplotlib PNGs (pip install "o2sync[plot]")
o2sync csv recordings/20261202053700
o2sync config                  # show the alert settings
o2sync config --spo2-alert off # or e.g. --spo2-threshold 88, --hr-alert on --hr-low 45 --hr-high 130
o2sync scan | info | gatt      # exploration helpers;  o2sync raw 14  sends a raw command

o2sync config changes the device's own vibration alerts. It reads every value back and reports an error if the device didn't apply it.

Plotting

o2sync plot (or o2sync sync --report) writes a self-contained HTML report — no plotting libraries needed — with summary statistics and SpO₂, pulse and motion charts per recording. Gaps mark samples where the finger was off, the dashed line marks 90 % SpO₂, and the page follows the system's light/dark theme. See an example report from a 30-minute recording (download it and open it in a browser to see it rendered).

Example o2sync report: a 30-minute recording with SpO₂ around 96–98 %, pulse 59–96 bpm and motion bars

From Python

import o2sync

result = o2sync.sync("recordings")          # -> SyncResult
for rec in result.recordings:               # newly downloaded o2sync.Recording objects
    print(rec.summary())
    print(rec.samples[0])                   # Sample(time, spo2, pulse, motion, vibration); None = invalid

rec = o2sync.Recording.from_file("recordings/20261202053700")
o2sync.save_html_report([rec], "report.html")

sync() never deletes anything from the device and skips files already present in the output folder. Files are saved unchanged under their device name (yyyyMMddHHmmss), the raw format other tools such as OSCAR import. The device keeps a rolling buffer and drops its oldest recordings by itself, so sync regularly. Pass set_time=False to leave the device clock alone or address= to skip scanning. An async variant, o2sync.async_sync(), and a lower-level o2sync.O2Client are available.

How it works

See PROTOCOL.md for the BLE protocol and file format. Code layout:

Module Purpose
protocol.py framing, CRC-8, response reassembly
client.py O2Client: info, set time, list/read files
recording.py parser for file versions 3/5, CSV export
sync.py sync() / async_sync()
plot.py dependency-free HTML/SVG report; optional matplotlib
transport/ minimal BLE interface + bleak implementation

Tests run without hardware against a simulated device: pytest.

Not medical software. Readings are whatever the device recorded; don't use this for diagnosis. Not affiliated with Wellue or Viatom. MIT licensed — see LICENSE.

About

Download and plot recordings from Wellue/Viatom O2 oximeters (Checkme O2 Max, O2Ring) over Bluetooth LE

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages