Apnea Board Forum - CPAP | Sleep Apnea
[CPAP] Realtime CPAP Metrics Possible? - 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: Main Apnea Board Forum (https://www.apneaboard.com/forums/Forum-Main-Apnea-Board-Forum)
+--- Thread: [CPAP] Realtime CPAP Metrics Possible? (/Thread-CPAP-Realtime-CPAP-Metrics-Possible)

Pages: 1 2


Realtime CPAP Metrics Possible? - shikkic - 01-16-2019

Hi all!

TLDR:
I'm currently experimenting with the idea of parsing and streaming CPAP machine metrics (AHI, Flow Rate...etc) in real time as a personal project. The possibility of doing so lends itself to a number of interesting, maybe even useful, applications. I have however hit a huge wall. My original method of using a wireless SD card to access data in the CPAP as it was being written to disk turned out to be unreliable. There must be an internal buffer of some kind, because the new session metrics file was not being flush to disk while it was running, in fact I only ever saw it happen once the CPAP machine was stopped. So I thought I would seek the advice of people here. Is there some kind of cable I can buy to fit the proprietary hardware slot that normally a modem would fit into and maybe pull metrics that way? (Btw all my work is open sourced, so nothing proprietary!).

Anything helps, thanks!

My machine: Philips Respironics REMstar Auto A-Flex (System one), pictures included in post.



The longer version
My name is Dan, a Software Engineer that has recently started taking an interest in having more ownership over my sleep apnea, namely at the software/hardware level. I've was diagnosed with sleep apnea probably 12 years ago. A big turning point for me was finding SleepyHead and realizing just how much information and personal sleep data was being withheld from me. I've read over the source code for SleepyHead and learned a ton from it, I even ported a custom data parser specifically for my machine type. However I felt like there was a next step missing. I wanted my sleep data in real time, there is a lot you could do with that information. What if you had custom machine learning algorithms that took in all of you historical sleep data and could identify predictors for when you'll have an apnea event? You could then use the streaming metrics to adjust certain therapy characteristics (or real world stimulus) in real time for better patient outcome. My current goal is a lot smaller then that though, I actually just want to use it for a creative fun artsy project to raise awareness for sleep apnea. If you haven't already read the TLDR above I've basically hit a wall and have almost given up. However I recently read a VICE article (can't link, new member) about SleepyHead and Mark Watkins that has really fired me up again. There has to be a way to retrieve these metrics in real time. It's done during sleep studies and my hope is that there is a cable for my machine that allows direct access to some internal memory or buffer where I can consume these metrics as the machine processes them. If you know anything please let me know!


RE: Realtime CPAP Metrics Possible? - Sleeprider - 01-16-2019

If you want a better outcome and improved therapy algorithm, ditch the old PRS1 60 Series Auto and get a Resmed Airsense 10 Autoset that actually does what you are describing. Using real-time data on flow limitation and volume to increase pressure to prevent apnea and hypopnea events and a bilevel exhale pressure relief that actually targets hypopnea and flow limits. None of this is in the Philips wheelhouse. If you want better therapy, it's out there. You don't have to reinvent it.

Live data feeds are available on machines designed for titration, and as far as I know, they are not very different from the ones used in daily therapy. Of course, it's kind of hard to read data and make adjustment on the fly while you're sleeping. Seriously, if you want to take control of your therapy, your machine can produce very detailed data on Sleepyhead that can be used to optimize settings, however, my answer was really in the previous paragraph. The Philips machines are relatively unresponsive to event precursors and don't prevent them like a Resmed.


RE: Realtime CPAP Metrics Possible? - shikkic - 01-16-2019

Hey Sleeprider, thanks for the helpful information. It's been years since I've had an upgrade of my machine, so it's good to know they advanced quite a bit.

I think I'll probably look into upgrading machines as a means for improving my own outcome, and not reinvent the wheel. However I still think there is personal value to me in still trying to answer the question of it's possible. I'd like to do a kind of computational art project with it as well.


RE: Realtime CPAP Metrics Possible? - Sleeprider - 01-17-2019

If you have a talent with hex data and you're interested in tearing apart machine data to help build the next version of Sleepyhead, you'd be welcome to join that effort as well. Nothing seems to be happening on the development front right now, but when JediMark awakens again, it could get busy. I strongly recommend you try out a new machine and retire your 60 series to backup duty. As you already know I have a strong bias for the Resmed technology and algorithms, but I think I come by that for some justifiable reasons.


RE: Realtime CPAP Metrics Possible? - Fats Drywaller - 01-17-2019

It sounds like an excellent project, and good luck and happy hacking!

Sleeprider's recommendations are spot on (unsurprisingly).  Yes, the Resmed Air10 series is the way to go, definitely.  The basic CPAP/APAP is the "Airsense 10 Autoset" (only get an Autoset, not an Elite or CPAP or Airstart model; see the "Machine Choices" wiki article), and the higher tiers of bi-level and ASV are in the Aircurve 10 series rather than Airsense.

There's no recourse available via the wireless facilities that have been provided.  The Air10 series has a built-in cellular modem (it can be disconnected internally; Resmed hasn't provided an on/off switch either hardwarily or softwarily), but that never transmits anything in real-time.  The firmware uses it to spew only compliance data (not full sleep data) once per day, an hour after the end of the sleep session, to a Resmed server.  The same goes for the optional, plug-in cellular modem for Resmed's previous generation, the S9 series.  I assume the same is true of the Philips Respironics machines, except that the Dreamstation (successor to the REMstar series) has an optional 802.11 module as an alternative to the optional cellular module, and I don't know what that's capable of.  But I seriously doubt that it can be used for anything deep.  Reports here over the last couple of years have said that it's used by the PR firmware only to do the usual upload of minimal compliance data to a Philips server, no different from the cellular modem.

For the at-home machines rather than the sleep-lab ones, the SD-card slot, via a Flash Air card, is it.  If it can't be done with that, then it's time for an open-source APAP hardware-and-firmware design (for various reasons, not just real-time data) ... a huge project.  But necessary, in the long run.  At the moment, the CPAP manufacturers have a lock on everything.


RE: Realtime CPAP Metrics Possible? - Fats Drywaller - 01-17-2019

Of course, one way of looking at it is that starting from the consumer-electronics (or patient-electronics) devices is the wrong approach. Why not equip your own home sleep lab instead?

https://www.resmed.com/uk/dam/documents/products/titration/s9-vpap-tx/product-brochure/1016080r1_s9-vpap-tx_product-brochure_glo_eng.pdf

https://www.resmed.com/epn/en/healthcare-professional/products/devices/s9-vpap-tx.html

https://www.resmed.com/epn/en/healthcare-professional/products/devices/tx-link.html

That's just the beginning of what you'll need ...


RE: Realtime CPAP Metrics Possible? - Crimson Nape - 01-17-2019

shikkic,
FYI: You can download the #SleepyHead source code that includes the parser files for different CPAP's data, as well as Contec 50 series oximeter
data. . . if you get real industrious. Big Grin


RE: Realtime CPAP Metrics Possible? - ardenum - 01-17-2019

Sounds awesome, I'd personally love a knob to turn left or right that would immediately change the pressure setting instead of going through the hassle of entering the clinicians menu each time i want to switch from full face to nasal, sometime i need to change it during the night and id love just to set the correct pressure on the fly.


RE: Realtime CPAP Metrics Possible? - Fats Drywaller - 01-17-2019

(01-16-2019, 10:13 PM)shikkic Wrote: ... I recently read a VICE article (can't link, new member) about SleepyHead and Mark Watkins that has really fired me up again.

Discussion thread about the article, November 2018:
http://www.apneaboard.com/forums/Thread-FYI-Article-on-Sleepyhead-showed-up-on-Apple-News


RE: Realtime CPAP Metrics Possible? - Fats Drywaller - 01-17-2019

(01-17-2019, 10:46 AM)Crimson Nape Wrote: FYI: You can download the [url=http://OSCAR Official Download Page ----> CLICK HERE ./]SleepyHead[/url] source code that includes the parser files for different CPAP's data, as well as Contec 50 series oximeter data.  .  . if you get real industrious.  Big Grin

(01-16-2019, 10:13 PM)shikkic Wrote: ... I've read over the source code for SleepyHead and learned a ton from it, I even ported a custom data parser specifically for my machine type.