Apnea Board Forum - CPAP | Sleep Apnea
Viatom/Wellue Check Me O2 [interface cable] - Printable Version

+- Apnea Board Forum - CPAP | Sleep Apnea (https://www.apneaboard.com/forums)
+-- Forum: Public Area (https://www.apneaboard.com/forums/Forum-Public-Area)
+--- Forum: Software Support Forum (https://www.apneaboard.com/forums/Forum-Software-Support-Forum)
+--- Thread: Viatom/Wellue Check Me O2 [interface cable] (/Thread-Viatom-Wellue-Check-Me-O2-interface-cable)



Viatom/Wellue Check Me O2 [interface cable] - Kingsway - 06-19-2023

I recently emailed Viatom to enquire how I might download  to my PC from the Viatom/Wellue Check Me O2 that I bought on Amazon a couple of years ago.

To my amazement, they sent  me a  free Viatom Checkme O2 Interface Cable by return!

This cable is availlble online here in the UK, but at a price of £96.00 ($122.00) !!!  Bug-eyed  Company name spelled like    "S*****D"   Avoid!!!


NB   I believe this proprietary cable - black in colour - may  come with the CheckMe O2 PRO - but the non-pro version, just comes with a charge-only cable, white in colour.


RE: Viatom/Wellue Check Me O2 [interface cable] - data01 - 08-24-2023

I have the white colour cable, which came with my CheckMe O2 Max, and it connects with my computer without any issues.


RE: Viatom/Wellue Check Me O2 [interface cable] - Muggzy - 11-13-2023

For whatever it's worth, I purchased a "Wellue USB Charge Data Cable O2Ring and KidsO2, PC Data Cable" (it's essentially just a generic USB/Serial cable) for around $14 from Amazon, and it works flawlessly for importing from  my O2Ring, OxyLink, and WearO2 into the O2 Insight program.

Which is also how I discovered that the OSCAR code mistakenly treats the "File Format version" flag in the saved binary file header as some sort of model identifier  Dont-know


RE: Viatom/Wellue Check Me O2 [interface cable] - Crimson Nape - 11-13-2023

Muggzy - Please explain in detail what you are referring to in the statement, "OSCAR code mistakenly treats the "File Format version" flag in the saved binary file header as some sort of model identifier"

- Red


RE: Viatom/Wellue Check Me O2 [interface cable] - Muggzy - 11-13-2023

In ViatomLoader.cpp in the ViatomFile:TonguearseHeader() function:
Code:
   const unsigned char* header = (const unsigned char*) data.constData();
   int sig   = header[0] | (header[1] << 8);
   int year  = header[2] | (header[3] << 8);
   int month = header[4];
   int day   = header[5];
   int hour  = header[6];
   int min   = header[7];
   int sec   = header[8];

The first byte of the header, called sig in this case, is later referred to in several places as if it identifies a "CheckMe O2 Max", such as here in ReadData():
Code:
if (m_sig == 5) {
   // Confirm that CheckMe O2 Max is a true 2s sample rate.
   CHECK_VALUE(all_are_duplicated, false);
} else {
   // Confirm that older models are actually a 4s sample rate.
   CHECK_VALUE(m_sig, 3);
   CHECK_VALUE(all_are_duplicated, true);
}

However, the first byte in the header file corresponds to the File Version in the O2 Insight database, regardless of model type as shown here: 






I have verified that the binary file formats are identical for the OxyLink, O2 Ring, and Wear O2 models from Viatom with variations on the following code:
Code:
[TestMethod]
public void ReadViatomBinaryFile()
{
    const int HEADER_SIZE = 40;
    const int RECORD_SIZE = 5;

    string path = @"[REDACTED, CHANGES ACCORDING TO WHICH FILE I WANT TO TEST]";

    Assert.IsTrue( File.Exists( path ) );

    using var file   = File.OpenRead( path );
    using var reader = new BinaryReader( file );

    int fileVersion = reader.ReadInt16();
    Assert.IsTrue( fileVersion is 3 or 5 ); // Never actually encountered FileVersion=5, but apparently someone else has and it's binary compatible

    int year = reader.ReadInt16();
    Assert.AreEqual( 2023, year );

    int month = reader.ReadByte();
    Assert.IsTrue( month >= 1 && month <= 12 );
            
    int day = reader.ReadByte();
    Assert.IsTrue( day is >= 1 and <= 31 );
            
    int hour = reader.ReadByte();
    Assert.IsTrue( hour is >= 0 and <= 24 );
            
    int minute = reader.ReadByte();
    Assert.IsTrue( minute is >= 0 and <= 60 );
            
    int second = reader.ReadByte();
    Assert.IsTrue( second is >= 0 and <= 60 );

    var expectedTimestamp = DateTime.Parse( "2023-10-04 03:17:47.000" );
    var headerTimestamp   = new DateTime( year, month, day, hour, minute, second );
    Assert.AreEqual( expectedTimestamp, headerTimestamp );

    // Read timestamp (NOTE: The filename also appears to be a timestamp. Do they always match?)
    var filenameTimestamp = DateTime.ParseExact( Path.GetFileName( path ), "yyyyMMddHHmmsss", CultureInfo.InvariantCulture );
    Assert.AreEqual( expectedTimestamp, filenameTimestamp );

    // Read and validate file size
    int fileSize = reader.ReadInt32();
    Assert.AreEqual( file.Length, fileSize );
            
    // Read duration of recording
    var duration = TimeSpan.FromSeconds( reader.ReadInt16() );
    Assert.AreEqual( TimeSpan.FromSeconds( 5316 ), duration );

    // Skip the rest of the header, as it doesn't provide any useful information for us.
    file.Position = HEADER_SIZE;
    
    // The rest of the file should be an exact multiple of RECORD_SIZE
    Assert.AreEqual( 0, (fileSize - HEADER_SIZE) % RECORD_SIZE );

    int    recordCount = (fileSize - HEADER_SIZE) / RECORD_SIZE;
    double frequency   = 1.0 / (duration.TotalSeconds / recordCount);

    for( int i = 0; i < recordCount; i++ )
    {
        var spO2      = reader.ReadByte();
        var pulse     = reader.ReadByte();
        var isInvalid = reader.ReadByte();
        var motion    = reader.ReadByte();
        var vibration = reader.ReadByte();
        
        Debug.WriteLine( $"OX: {spO2}, PULSE: {pulse}, MOT: {motion}, INVALID: {isInvalid}, VIB: {vibration}" );
    }
}



RE: Viatom/Wellue Check Me O2 [interface cable] - Crimson Nape - 11-13-2023

When the loader was first written, only the SleepU and O2Ring were on the market. At that time, this value was 0x02 until the Checkme arrived. It was using the 0x03 designator, but the prior two still carried the 0x02 value in all data files. I will look into updating the code.

Thanks!
- Red


RE: Viatom/Wellue Check Me O2 [interface cable] - Muggzy - 11-14-2023

Gotcha. Makes sense.

I think it's worth reiterating that the right cable works for more models than just the ones that come with it. You can get an OxyLink and the cable for less money than an O2 ring, which I found helpful.