Post Reply 
Oximetry - Do any of the pulse oximeters work with linux?
Author Message
pholynyk Offline

Advisory Members

Posts: 306
Joined: Mar 2015

Machine: ResMed AirSense 10 APAP
Mask Type: Full face mask
Mask Make & Model: Amara View
Humidifier: included
CPAP Pressure: 11-17
CPAP Software: SleepyHead

Other Comments:

Sex: Male
Location: Ontario, Canada

Post: #31
RE: Oximetry - Do any of the pulse oximeters work with linux?
Greg's command is a much better choice:
$ sudo lsusb -v -d10C4:|grep iProduct

Here is the page that has the SiLabs doc on USB bridges:

https://www.silabs.com/support/pages/doc...%20Bridges

There are a batch of App Notes that I downloaded and haven't read yet. I hope to get to them before my CMS50F arrives.
12-05-2015 05:18 PM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
happydreams Offline

Preferred Members

Posts: 23
Joined: Sep 2015

Machine: Respironics System 1 560P
Mask Type: Full face mask
Mask Make & Model: Resmed Airfit F10
Humidifier: Not used
CPAP Pressure: 8 cm
CPAP Software: SleepyHead Other Software

Other Comments:

Sex: Male
Location: NH, USA

Post: #32
RE: Oximetry - Do any of the pulse oximeters work with linux?
I have to make a retraction of my statement that the driver code would not compile on my machine. I can build the driver. However, I cannot build the test program that is included with the driver. Still, I'm not sure I want to replace my driver, unless it is pretty sure it is going to work.

Maybe it is just operator error. How did you connect your CMS50F to SH?
12-05-2015 05:57 PM
Find all posts by this user Post Reply Quote this message in a reply
GregLawson Offline

Members

Posts: 15
Joined: Nov 2015

Machine: PRS1 REMStar 560PBT
Mask Type: Nasal pillows
Mask Make & Model: PRS1 GoLife for Men Nasal pillow
Humidifier: PRS1 Series 60 Heated Hose
CPAP Pressure: 10 to 13
CPAP Software: SleepyHead Other Software

Other Comments: Engineer / programmer / exploratory data analyst / Independent irresponsible consultant

Sex: Male
Location: Los Angeles

Post: #33
RE: Oximetry - Do any of the pulse oximeters work with linux?
I discovered a few things about the interface to my Veridian 11-50DP oximeter:
  1. The USB cable is not a standard USB cable. I discovered this the hard way by switching it for one of those retractable USB cables, losing the original cable, and then calling up customer service to complain. When customer service said they had never heard of my problems, I threatened to return it to Costco for a refund. Fortunately I thought I should find and try the original cable before getting my refund. The original cable worked, none of the other more standard mini-USB cables I tried worked.
  2. Last night I managed to confuse myself about whether the oximeter was plugged in or not. I was typing 'lsusb -d10C4:' and checking whether it depended on whether the screen was powered on or not. Then it dawned on me that the CP2102 chip is in the cable, not the oximeter body: It makes a big difference which end of the cable is disconnected.
  3. Most of the time dmesg was showing that the cp10x driver was connecting then almost immediately disconnecting when I disconnected then connected the cable. Every once in a while it didn't disconnect. I wondered if it mattered which end of the cable I connected first, whether the oximeter screen was black or not, what file in /sys/bus/usb/ I had just accessed.

(12-03-2015 12:38 PM)GregLawson Wrote:  
(11-28-2015 10:34 AM)happydreams Wrote:  Or things to look for?
$ screen /dev/ttyUSB0
You may have to change permissions on /dev/ttyUSB0 (e.g. add self to the dialout group) and guess the baud rate (9600 or max?)
Be sure to read 'man screen' for the arcane exit command key sequence.
I enterred:
$ screen /dev/ttyUSB0 115200
And I got a constant stream of circular blobs with white question marks on them.
If I let the oximeter screen timeout and go black the characters quit streaming. If I turned the oximeter back on the characters returned.
My interpretation is that
  1. the driver is at least partially working
  2. I guessed the wrong speed (or possibly wrong parity or stop bits or binary values that are not valid printable characyters) causing the garbage character display,
  3. No command is required to get the oximeter to transmit

The path forward includes:
  1. Trying different baud rates, etc. (or search the code for this info),
  2. read file /dev/ttyUSB0 (which is streaming something) and dump in hex, see what values correspond to the oximeter display (or search the code for this info),

Unfortunately but coincidentally my favorite Linux system hangs a few minutes after booting up; I think I should have been much more careful about letting Gnome upgrade. So I'll be posting from my Acer Switch under Windows (it's a nightmare to install Linux on these 32/64 bit hybrids) while I fix my Debian installation. The positive side is that I should be able to test my oximeter on the presumably working Windows SleepyHead.

If I post quickly, I'm likely to say something stupid, if I wait till I can't say something stupid, I may never post.
If you are reading this I hope that I''ve achieved the right trade-off between signal and noise.
12-06-2015 09:33 PM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
Crimson Nape Offline

Monitors

Posts: 1,327
Joined: Oct 2014

Machine: ResMed S9 Autoset
Mask Type: Other
Mask Make & Model: P-10 / F&P Simplus / DreamWear
Humidifier: H5i w/Climateline
CPAP Pressure: 8 - EPR 3
CPAP Software: SleepyHead

Other Comments: CMS-50F & 50IW

Sex: Male
Location: Georgia

Post: #34
RE: Oximetry - Do any of the pulse oximeters work with linux?
(12-06-2015 09:33 PM)GregLawson Wrote:  I discovered a few things about the interface to my Veridian 11-50DP oximeter: . . .
. . . The USB cable is not a standard USB cable.

FYI:
The newer CMS-50 "F" and "I" models with version 3.7 firmware use a standard USB cable for their connection.

Statistics prove that people who have more birthdays live longer.
12-06-2015 10:53 PM
Find all posts by this user Post Reply Quote this message in a reply
GregLawson Offline

Members

Posts: 15
Joined: Nov 2015

Machine: PRS1 REMStar 560PBT
Mask Type: Nasal pillows
Mask Make & Model: PRS1 GoLife for Men Nasal pillow
Humidifier: PRS1 Series 60 Heated Hose
CPAP Pressure: 10 to 13
CPAP Software: SleepyHead Other Software

Other Comments: Engineer / programmer / exploratory data analyst / Independent irresponsible consultant

Sex: Male
Location: Los Angeles

Post: #35
RE: Oximetry - Do any of the pulse oximeters work with linux?
(12-04-2015 08:51 AM)GregLawson Wrote:  I have yet another new project:
  1. Move a Windows computer into my bedroom.
  2. Record a night with CPAP and oximeter.
  3. Automatically? align data in SH.
When I tried the Windows version of SleepyHead, I was disappointed to learn that it didn't work any better for my Veridian 11-50DP oximeter than the Linux version. In fact it was a little worse, the first time I ran SH it crashed; so far in a few days of SH on Linux it hasn't crashed at all.
Using the Windows SH oximeter import wizard:
  1. The 'record attached to a computer' option is dimmed and not clickable.
  2. If I click 'Import directly from a recording on a device', it searches for an oximeter ('Scanning for compatible oximeters'), but doesn't recognize the Veridian 11-50DP. The cancel button does nothing; the only way out is to click the close window box and confirm you want to kill SleepyHead (and possibly lose data). If the oximeter's display is black when I hit enter the wizard, I got slightly farther to a message 'Connecting to oximeter', but that seemed to hang also.

(12-04-2015 08:51 AM)GregLawson Wrote:  I think the short term solution to the time-alignment problem (see start page of SH oximeter wizard) is to use the SH oximeter import wizard button to "Record attached to computer overnight (provides plethysomogram)".
I guess I was wrong here. The only working short term solution to the time-alignment problem is the all manual approach.
(12-04-2015 08:51 AM)GregLawson Wrote:  
  1. Export aligned data to a csv file.
  2. Import data into my favorite statistical analysis program (open source R anyone?)
  3. Somehow statistically correlate CPAP apnea scoring with SPO2 desaturation scoring.
  4. Hopefully feel relatively confident that SPO2 desaturation is the unambiguous metric of success for CPAP treatment.
SleepyHead's csv export function is less detailed than I had hoped. SH seems to be exporting summary data, not the data behind the squiggly graphs. Presumably all the squiggly data is in the binary files SH has been helpfully collecting.

If I post quickly, I'm likely to say something stupid, if I wait till I can't say something stupid, I may never post.
If you are reading this I hope that I''ve achieved the right trade-off between signal and noise.
12-07-2015 09:32 AM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
happydreams Offline

Preferred Members

Posts: 23
Joined: Sep 2015

Machine: Respironics System 1 560P
Mask Type: Full face mask
Mask Make & Model: Resmed Airfit F10
Humidifier: Not used
CPAP Pressure: 8 cm
CPAP Software: SleepyHead Other Software

Other Comments:

Sex: Male
Location: NH, USA

Post: #36
RE: Oximetry - Do any of the pulse oximeters work with linux?
Bump. Anyone make progress? Is there a way I could monitor the unit's output? I see the use of screen. I am not getting any output, this may be due to permissions. No activity. I have set the serial port /dev/ttyUSB0 according to the code in serialoximeter.cpp (excerpted below) to 19200, odd parity, 8 data bit, 1 stop bit, and no flow control.

bool SerialOximeter::openDevice()
{
if (port.isEmpty()) {
if (!scanDevice("",m_vendorID, m_productID))
return false;
}
serial.setPortName(port);
if (!serial.open(QSerialPort::ReadWrite))
return false;

// forward this stuff

// Set up serial port attributes
serial.setBaudRate(QSerialPort::Baud19200);
serial.setParity(QSerialPort::OddParity);
serial.setStopBits(QSerialPort::OneStop);
serial.setDataBits(QSerialPort::Data8);
serial.setFlowControl(QSerialPort::NoFlowControl);

m_streaming = true;
m_abort = false;
m_importing = false;

// connect relevant signals
connect(&serial,SIGNAL(readyRead()), this, SLOT(dataAvailable()));

return true;
}

Nothing showing on gtkterm Sad Even if I run as sudo gtkterm. More importantly, nothing showing up in SleepyHead.

Am I missing something like I need to be in a certain menu of the CMS50F? Or something equally simple? Or is this unit a dud?
12-18-2015 02:49 PM
Find all posts by this user Post Reply Quote this message in a reply
pholynyk Offline

Advisory Members

Posts: 306
Joined: Mar 2015

Machine: ResMed AirSense 10 APAP
Mask Type: Full face mask
Mask Make & Model: Amara View
Humidifier: included
CPAP Pressure: 11-17
CPAP Software: SleepyHead

Other Comments:

Sex: Male
Location: Ontario, Canada

Post: #37
RE: Oximetry - Do any of the pulse oximeters work with linux?
@ HappyDreams - Take a look at SleepLib/loader_plugins/cms50f37_loader.cpp - you will see that it uses 115200 baud, among other things... the plugin overloads the openDevice method, and most of the others.
I also have enabled debug output on the sleepyhead command line; it shows a whole bunch of stuff going back and forth. I'm afraid I have to do the holiday cleanup routine, and I will get back at this after Christmas.
12-18-2015 03:37 PM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
happydreams Offline

Preferred Members

Posts: 23
Joined: Sep 2015

Machine: Respironics System 1 560P
Mask Type: Full face mask
Mask Make & Model: Resmed Airfit F10
Humidifier: Not used
CPAP Pressure: 8 cm
CPAP Software: SleepyHead Other Software

Other Comments:

Sex: Male
Location: NH, USA

Post: #38
RE: Oximetry - Do any of the pulse oximeters work with linux?
(12-18-2015 03:37 PM)pholynyk Wrote:  @ HappyDreams - Take a look at SleepLib/loader_plugins/cms50f37_loader.cpp - you will see that it uses 115200 baud, among other things... the plugin overloads the openDevice method, and most of the others.
I also have enabled debug output on the sleepyhead command line; it shows a whole bunch of stuff going back and forth. I'm afraid I have to do the holiday cleanup routine, and I will get back at this after Christmas.

Thanks for taking a look at this. I appreciate your efforts and others in this thread.
How do I enter the debug flag? I would like to know this for future issues.

I hate to mark this issue closed, but, after issuing a few break commands to the CMS50F, (via gtkterm) I reconnected the oximeter to SH. Much to my surprise, I was able to connect! I can't tell what I did different from last time, but I was able to import the old data I collected on 11/27. This morning, I was able to collect data from last night and review it in SleepyHead. What I found is the subject of a different thread.

Thanks again.
12-19-2015 03:33 PM
Find all posts by this user Post Reply Quote this message in a reply
pholynyk Offline

Advisory Members

Posts: 306
Joined: Mar 2015

Machine: ResMed AirSense 10 APAP
Mask Type: Full face mask
Mask Make & Model: Amara View
Humidifier: included
CPAP Pressure: 11-17
CPAP Software: SleepyHead

Other Comments:

Sex: Male
Location: Ontario, Canada

Post: #39
RE: Oximetry - Do any of the pulse oximeters work with linux?
Oh boy, I did that so long ago I had to double check. Apparently debug mode is the standard build for Linux, as I don't recall changing the build file. Somewhere near your source code directory you should find a directory called build-SleepyHeadQT-Desktop-Debug - if you do, you have debug mode enabled. Then all you have to do is start SleepyHead from a shell, or edit your launch menu for SleepyHead to check off the 'Launch from Terminal' box that should be there. That should result in much output which you can save by doing a 'select-all' Ctrl-A and 'copy' Ctrl-C, and then 'paste' Ctrl-V into an empty edit window.
12-19-2015 05:04 PM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
rost Offline

Members

Posts: 5
Joined: Jul 2016

Machine: ResMed Airsense 10
Mask Type: Nasal mask
Mask Make & Model: F&P Eson
Humidifier: HumidAir
CPAP Pressure: 5-15
CPAP Software: SleepyHead

Other Comments:

Sex: Male
Location: Sweden

Post: #40
RE: Oximetry - Do any of the pulse oximeters work with linux?
I use this one with Linux to download recorded data from my cms50d+ (ver 4.6) which uses 115200 baud:

Code:
https:// github.com/airikka/spo2cms50dplus


Maybe it works with other models?
Does not support live data.
(This post was last modified: 07-14-2016 03:38 PM by rost.)
07-14-2016 03:28 PM
Find all posts by this user Post Reply Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Idea SleepyHead and Linux MartinT 3 100 11-29-2016 07:41 AM
Last Post: OpalRose
  SleepyHead on iMac with OS X - importing oximetry data Possum 9 952 11-04-2016 12:28 PM
Last Post: AlanE
  PLEASE PLEASE Help me! [Pulse Oximeter issues] Dagswe21 5 333 10-22-2016 07:42 AM
Last Post: AlanE
  did Linux corrupt my SD card? AirPlease 6 839 09-23-2016 02:06 AM
Last Post: zagam
  Will most any SD card reader work with ResScan 5.6? caffellatte 3 434 09-22-2016 09:47 AM
Last Post: caffellatte
  Can I still get Encore Viewer software to work? Windows 10... ValGal333 7 942 09-05-2016 05:17 AM
Last Post: AUDavidSydney
  SleepyHead and Linux Mint 17.3 (Ubuntu 14.04) necochino 4 267 08-21-2016 07:16 PM
Last Post: pholynyk

Forum Jump:

Who's Online (Complete List)