Hello Guest, Welcome to Apnea Board !
As a guest, you are limited to certain areas of the board and there are some features you can't use.
To post a message, you must create a free account using a valid email address.

or Create an Account


New Posts   Today's Posts

O2 Insight Pro - Where/How are Sleep Reports/Data Stored?
#1
Question 
O2 Insight Pro - Where/How are Sleep Reports/Data Stored?
Where are the Sleep Reports (or the data they are based on) stored in O2 Insight Pro for macOS, and how could I correct their datetimes?

The reason I ask is that sometimes the O2Ring gets the start date/time wrong (for unknown reason).
For example the other night my sleep start was 22:28 but the ring recorded the start as being 14:28.

As posted earlier, the fix regarding getting the correct datetime in OSCAR is staggeringly simple - just edit the (binary) file name.

However, I'd still like to fix what O2 Insight Pro has already read-in (directly, e.g. via BlueTooth) from the O2Ring.

I tried altering the file name and also the datetimes in the (SQLite) database used by O2 Insight. This fix part-worked, making the correct date/time appear in the left-hand panel of O2 Insight. However the "Sleep Report" it displayed (when I clicked on that date/time) still showed the original (wrong) date/time.

So I wonder, where are these Sleep Reports (or the data they are based on) stored? I am not talking about exporting PDF/CSV, just the "under the hood" stuff upon which the "Sleep Report" displayed on-screen by O2 Insight is based. For example so that I can try editing or even deleting the "offending" one to see if it gets regenerated with the correct datetime (i.e. matching the one in the filename and database).

Anyone know? Or any relevant tips?
Post Reply Post Reply
#2
RE: O2 Insight Pro - Where/How are Sleep Reports/Data Stored?
BTW: These are the steps I followed to "part-fix" the Sleep report datetimes:
* I closed O2 Insight Pro
* I corrected this file to instead be named: "20230331222850", reflecting 22:28
* I then edited O2 Insight's database (in SQLite): "db_o2.db", as follows...
* In Table "tb_check", for the relevant entry/row I changed the values in columns "flowid", "checktime" and "startDateTime" to include the correct datetime (as per the renamed file)
* I wrote (saved) these changes to the database

Following that, I opened O2 Insight Pro
In its left-hand panel, the list of sessions now showed the edited entry with its correct time: 22:28
When I clicked on that entry, the main window area showed the corresponding "Sleep report"
However, the times displayed in it were still wrong - showing a start-time of 14:18

I guess that the Sleep Report originally generated for the session/file/database-entry must be getting re-used here?
Post Reply Post Reply
#3
RE: O2 Insight Pro - Where/How are Sleep Reports/Data Stored?
I'm Mac challenged, so go with me on this.  The Windows version of O2 Insight Pro has a "Configure" button where you can set the device's time and date.  Another option is to get the mobile app, ViHealth.  This will allow you to connect via Bluetooth to the device.  When ViHealth connects to the device, its time/date is automatically updated.

- Red
Crimson Nape
Apnea Board Moderator
www.ApneaBoard.com
___________________________________
Useful Links -or- When All Else Fails:
The Guide to Understanding OSCAR
OSCAR Chart Organization
Attaching Images and Files on Apnea Board
Apnea Helpful Tips

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
Post Reply Post Reply
#4
RE: O2 Insight Pro - Where/How are Sleep Reports/Data Stored?
Thank you for trying to help, though I'm familiar with all that.

My question is more "under the hood" of O2 Insight.

I know about the Sync Clock option - but that would only affect future recordings.
Also I know how to fix timestamps onbinary data files and their corresponding entries in O2 Insight's database.

I am seeking a way to fix incorrect timestamps on existing Sleep Reports, that were produced when I first downloaded their corresponding data (binary files) into O2 Insight.
I expect that can only be achieved by a "hack" type of method.

Thank you anyhow.
Post Reply Post Reply
#5
RE: O2 Insight Pro - Where/How are Sleep Reports/Data Stored?
Since your thread deals with a software issue, I am moving it to the Software Support Forum.

- Red
Crimson Nape
Apnea Board Moderator
www.ApneaBoard.com
___________________________________
Useful Links -or- When All Else Fails:
The Guide to Understanding OSCAR
OSCAR Chart Organization
Attaching Images and Files on Apnea Board
Apnea Helpful Tips

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
Post Reply Post Reply
#6
RE: O2 Insight Pro - Where/How are Sleep Reports/Data Stored?
Oops, sorry, yes, that's where it belongs.
Post Reply Post Reply
#7
RE: O2 Insight Pro - Where/How are Sleep Reports/Data Stored?
Here’s the path on my Mac (Old MacBook running Monterey)

/Users/me/Library/Containers/com.viatom.O2PCViewer-BLE/Data/Library/Application Support/O2_Insight_Pro/DATA/Serial_Number/

“Serial Number” corresponds to my O2 ring.

Hope that’s useful
Post Reply Post Reply
#8
RE: O2 Insight Pro - Where/How are Sleep Reports/Data Stored?
Thanks, though I already knew about that - the path to O2Insight's imported binary files.
Indeed, these are the very files I referred to in my original post:
"I tried altering the file name and also the datetimes in the (SQLite) database used by O2 Insight."

As I explained, these alterations succeeded in getting the correct date and time to appear in the left-hand panel of O2Insight, but when I clicked on these the "Sleep Report" in the main part of the Window still had the old (incorrect) datetimes.

So my question is: what else needs changing, in order to either correct those sleep reports or delete them so that they (maybe?) get regenerated. Any advice appreciatd.
Post Reply Post Reply
#9
RE: O2 Insight Pro - Where/How are Sleep Reports/Data Stored?
The binary file has the date and start time embedded in its header data.  You would have to edit each file with a hex editor to change these.  

Here are the byte offsets and their meaning: (I've listed the data in ASCII for easier reading)
------ Year:  bytes 2 & 3(*256)  Example: (b2)231+(b3)7 = 231+1792 (7*256) = 2023
------ Month: byte 4
------ Day: byte 5
------ Hour: byte 6
------ Minute: byte 7
------ Seconds: byte 8

I hope this may help.
- Red
Crimson Nape
Apnea Board Moderator
www.ApneaBoard.com
___________________________________
Useful Links -or- When All Else Fails:
The Guide to Understanding OSCAR
OSCAR Chart Organization
Attaching Images and Files on Apnea Board
Apnea Helpful Tips

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
Post Reply Post Reply
#10
Cool 
RE: O2 Insight Pro - Where/How are Sleep Reports/Data Stored?
Yessss! SSSSiirrrrr!! You did it again!!!

That did the job fine.
Counting the byte numbers from 0 (zero) and with hex convertor (website) in hand.

So for O2 Insight (app):
* Left-hand panel displays date-time based purely on file name (text)
* Content panel displays date-time based purely on file header (binary)

I have now copied the file with modified-header over to OSCAR's data folder (which I keep separate) and that still works too (bonus!).

I had spent so many hours (over days) trying to find some kind of "other file", which clearly didn't exist...

Thanks Red,
David
Post Reply Post Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Getting O2 Insight Pro files to OSCAR? SnoozeBest 18 416 04-14-2024, 02:45 PM
Last Post: Crimson Nape
Question OK TO IMPORT SLEEP DATA FROM OLD SD CARD INTO OSCAR W/O MESSING UP CURRENT DATA? Plmnb 3 233 03-29-2024, 11:02 AM
Last Post: Plmnb
  OSCAR Reports Omitted Some ResMed Sleep Sessions RTolley 2 209 03-17-2024, 08:58 PM
Last Post: RTolley
  Viatom/WellUE data is different than OSCAR displayed data GordK 3 322 02-23-2024, 04:48 PM
Last Post: GordK
  Generating reports for doctor TechieHippie 5 412 02-19-2024, 07:54 PM
Last Post: TechieHippie
  Data structure / data definition of AirSense 11 CD, CMSd50+ or OSCAR?hing obvious, … Perickson 4 1,679 02-18-2024, 01:49 PM
Last Post: Perickson
  OSCAR Reports do not appear to have O2 and Pulse Data SKPC 5 574 12-31-2023, 11:05 PM
Last Post: Crimson Nape


New Posts   Today's Posts


About Apnea Board

Apnea Board is an educational web site designed to empower Sleep Apnea patients.