Post Reply 
Oximetry - Do any of the pulse oximeters work with linux?
Author Message
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: #21
RE: Oximetry - Do any of the pulse oximeters work with linux?
(09-21-2015 06:19 PM)archangle Wrote:  SleepyHead also runs pretty well under Wine. I'm not sure whether it will be able to access the oximeter, though. Accessing hardware is a little more difficult than simply running the program.

I did ask almost that exact question of a wine evangelist / expert, and he said that emulating serial RS-232 interfaces over USB was in fact the one exception to the poor hardware interface support in wine. So I think it's worth trying. I'm not sure I have wine setup correctly on my debian system or I'd try it myself now. I understand wine can't run off a dual booted Windows system partition anymore; requiring a separate Windows install. Has anyone tried this or have the necessary oximeter, wine setup, and SleepyHead on Linux to run this test?
12-03-2015 12:53 PM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
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: #22
RE: Oximetry - Do any of the pulse oximeters work with linux?
(12-03-2015 12:38 PM)GregLawson Wrote:  If I manually enterred the cpap session start time the SPO2 and pulse graphs were aligned closely.
I think the short term solution to the time-alignment problem (see start page of SH oxymetry wizard) is to use the SH oximeter import wizard button to "Record attached to computer overnight (provides plethysomogram)". Anyone tried this and tried to assess the correlation of CPAP apneas with SPO2 desaturations and possibly pulse accelerations? If not 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.
  4. Export aligned data to a csv file.
  5. Import data into my favorite statistical analysis program (open source R anyone?)
  6. Somehow statistically correlate CPAP apnea scoring with SPO2 desaturation scoring.
  7. Hopefully feel relatively confident that SPO2 desaturation is the unambiguous metric of success for CPAP treatment.
12-04-2015 08:51 AM
Find all posts by this user Post Reply Quote this message in a reply
Crimson Nape Offline

Monitors

Posts: 1,332
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: #23
RE: Oximetry - Do any of the pulse oximeters work with linux?
GregLawson,
FYI:
  1. CMS-50D+ oximeters don't have on-board clock and any recorded data must be synced manually with any CPAP's session data.
  2. The CMS-50"F" and "I" models have an on-board clock.
  3. The Philips-Respironics system's clock is set at the factory to UTC and doesn't allow for drift or time zone change on the system.
  4. Resmed CPAP systems have on-board clocks and allow for the setting to the current time.
  5. However with all clocks, drift can and does occur. Sleepyhead allows the user to use either the recorded time on the oximeter (if available) or the user can choose to align the data with a CPAP session.
  6. Sleepyhead has the ability to correct any clock drift and/or time zone in the File->Preferences->CPAP->CPAP Clock Drift option.


I hope you may find this information useful.

Statistics prove that people who have more birthdays live longer.
12-04-2015 11:45 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: #24
RE: Oximetry - Do any of the pulse oximeters work with linux?
OK, I think I know part of the problem. The driver in my kernel, cp210x.c does not have ioctl, or gpio in it. The file in question is found in /usr/src/linux-source-4.2.0/linux-source-4.2.0.tar.bz2
linux-source-4.2.0/drivers/usb/serial/cp210x.c

The driver file hosted on the Silicon Labs website does. However the driver at SiLabs is for an earlier kernel. Although it does not seem to be written up very well, or even in one place, I gleaned that they expect you (me) to combine the gpio functions of their file into the one provided by your (my) distribution. This is, shall we say, slightly out of my expertise.

So it seems one needs to merge the gpio of the SiLabs version into the "current driver" of one's kernel. For the life of me, I don't understand why this was not included in the kernel. Maybe a security issue?

I'd be a bit more gung ho about this, if the SiLabs cp210x.c file compiled on my system. There seems to be a build failure. I'm not a good C programmer, so this is slowing me down. If I could figure this out, maybe I can get the CMS50F to work on my system.
12-04-2015 09:34 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: #25
RE: Oximetry - Do any of the pulse oximeters work with linux?
(12-04-2015 09:34 PM)happydreams Wrote:  So it seems one needs to merge the gpio of the SiLabs version into the "current driver" of one's kernel. For the life of me, I don't understand why this was not included in the kernel. Maybe a security issue?

I'd be a bit more gung ho about this, if the SiLabs cp210x.c file compiled on my system. There seems to be a build failure.
Yikes. Your news is annoying enough that I'll try denial to see if it goes away. If it won't go away, we'll have to dig into it as you suggest. So I'll pursue some of the parallel paths mentioned in previous posts to try and disprove that the problem is in the driver.
I might try something like setting up a square wave into one of my cheap Chinese serial to USB (hopefully one presents itself as a cp210x clone). If I sound like a mad scientist, don't worry: I've successfully done something like this before: square waves into a Bus Pirate (cheapy serial bus analyzer). If the predicted characters can be read from /dev/ttyUSB0, its strong evidence the cp210x driver is working "good enough"; if not then I'll have to dig into the driver as you suggest.
(12-04-2015 09:34 PM)happydreams Wrote:  This is, shall we say, slightly out of my expertise.
Outside my expertise also (notice my reluctance to dive right in). But diving into stuff outside my expertise is how I learn new stuff and maybe stave off cognitive decline (or is that why I'm currently obsessed with oximeters and CPAP?). But since I'm already jumping into dozens of new things, the dread 'analysis paralysis' is closer to my real fear. Hopefully we can find an efficient path to resolving the oximeter for Linux issue.
(12-04-2015 09:34 PM)happydreams Wrote:  I'm not a good C programmer, so this is slowing me down.
Its been forty years since I would call myself much of a C programmer, ten years since I've been much of a C++ programmer, and a few days since I've been much of a Ruby programmer. But since majoring in programming language design at UCLA, I've learned to deny the importance of programming languages as a barrier to problem solving. (Note I've been in denial twice in a single post, I must have a defective brain.)
12-05-2015 08:54 AM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
pholynyk Online

Advisory Members

Posts: 307
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: #26
RE: Oximetry - Do any of the pulse oximeters work with linux?
I pulled the data sheets for the SilconLabs chips last night. It turns out that the CP2101, 02, 03, and 04 all return the same USB vid and pid, even though only the 2103 and 2104 have the GPIO pins in addition to the usual serial control lines. Only the Product Description String is unambiguous. So one of the first questions to ask is which chip is used, and has it changed? So we need people using Linux who have CMS50 devices to try 'sudo lsusb -v -d10C4:' and then report the resulting iProduct string. Then we can decide if we need a custom driver and/or modifications to the Sleepyhead code. Since I will shortly (I hope) have a CMS50F, I will be able to undertake whichever is necessary. I expect I have the necessary skills, having recently retired after programming embedded systems in C for most of the past thirty years.
12-05-2015 10:20 AM
Find all posts by this user Post Reply Quote this message in a reply
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: #27
RE: Oximetry - Do any of the pulse oximeters work with linux?
Here you go... For a CMS50F V3.8 firmware.

$ sudo lsusb -v -d10C4:

Bus 001 Device 006: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x10c4 Cygnal Integrated Products, Inc.
idProduct 0xea60 CP210x UART Bridge / myAVR mySmartUSB light
bcdDevice 1.00
iManufacturer 1 Silicon Labs
iProduct 2 CP2102 USB to UART Bridge Controller
iSerial 3 0001
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 2 CP2102 USB to UART Bridge Controller
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered)

Cheers
12-05-2015 02:10 PM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
pholynyk Online

Advisory Members

Posts: 307
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: #28
RE: Oximetry - Do any of the pulse oximeters work with linux?
Thank you, HappyDreams. At least the newest CMS50F uses the CP2102 which doesn't have the GPIO pins. So the regular Linux driver should be adequate; no need to merge the Silicon Labs driver code with the kernel driver code. One hopes. Early times still.
12-05-2015 04:19 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: #29
RE: Oximetry - Do any of the pulse oximeters work with linux?
(12-05-2015 10:20 AM)pholynyk Wrote:  So we need people using Linux who have CMS50 devices to try 'sudo lsusb -v -d10C4:' and then report the resulting iProduct string.
Have mercy on thread readers and use
$ sudo lsusb -v -d10C4:|grep iProduct
iProduct 2 CP2102 USB to UART Bridge Controller
for my Veridian 11-50DP. So my denial of needing GPIO might be working.
(12-05-2015 10:20 AM)pholynyk Wrote:  I pulled the data sheets for the SilconLabs chips last night.
Can you post a link to the data sheets? Others: when you find a nugget of information (especially when Google doesn't return much useful), please post since this Internet thingy is too darned big to find much without links.

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-05-2015 04:57 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: #30
RE: Oximetry - Do any of the pulse oximeters work with linux?
(12-05-2015 04:19 PM)pholynyk Wrote:  Thank you, HappyDreams. At least the newest CMS50F uses the CP2102 which doesn't have the GPIO pins. So the regular Linux driver should be adequate; no need to merge the Silicon Labs driver code with the kernel driver code. One hopes. Early times still.
I hope so. I had both source files up in meld, and I'd hesitate to make the changes. There are quite a few differences and I'm not a kernel hacker. I wouldn't know if something was safe to change.

However, if the regular driver is ok, then why doesn't it work? Maybe I just don't understand how to read out the data from the device. I plugged it into my usb port, turned the device on, and went to the menu. I then ran SH. I got to the Ox Wizard and basically clicked go. It that how it is supposed to work? Or do I have to do something else with the cms50f? I mean this could very well be operator error, but there doesn't seem to be very clear instructions - at least for me.

BTW, you should have received the CMS50F by now. It only took 2 days for mine to show up - from the same vendor as you ordered from. I was amazed at how fast I received it.
12-05-2015 05:14 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 116 11-29-2016 07:41 AM
Last Post: OpalRose
  SleepyHead on iMac with OS X - importing oximetry data Possum 9 969 11-04-2016 12:28 PM
Last Post: AlanE
  PLEASE PLEASE Help me! [Pulse Oximeter issues] Dagswe21 5 337 10-22-2016 07:42 AM
Last Post: AlanE
  did Linux corrupt my SD card? AirPlease 6 844 09-23-2016 02:06 AM
Last Post: zagam
  Will most any SD card reader work with ResScan 5.6? caffellatte 3 441 09-22-2016 09:47 AM
Last Post: caffellatte
  Can I still get Encore Viewer software to work? Windows 10... ValGal333 7 961 09-05-2016 05:17 AM
Last Post: AUDavidSydney
  SleepyHead and Linux Mint 17.3 (Ubuntu 14.04) necochino 4 275 08-21-2016 07:16 PM
Last Post: pholynyk

Forum Jump:

Who's Online (Complete List)