/spo2cms50dplus

Downloads recorded data from a CMS50D+ and stores it in SpO2 format

Primary LanguagePythonGNU General Public License v2.0GPL-2.0

spo2cms50d+ - Downloads recorded data from a CMS50D+ Pulse Oximeter (firmware version 4.6)

A Python script that downloads recorded data from CMS50D+ Pulse Oximeters and stores it in SpO2 format.
This script is only tested together with a CMS50D+ with firmware version 4.6.

There is a reason to believe that CMS50D+ with firmware version 4.6 differs in serial communication compared to older versions, as other applications seems to use other parameters and values when communicating.

Usage
=====

1. Plug in the USB cable
2. Start the CMS50D+ (mine says Ver4.6)
3. Press and hold the button to enter the menu
4. Don't press anything else, leave it in the menu (this way the device will not shut down automatically)
5. Run this spo2cms50d+ script (see example given below)
6. Exit the menu on the CMS50D+

Example:
./spo2cms50d+ /dev/ttyUSB0 ~/my_cms50dplus_file.SpO2

It is also possible to set the start time.
Run "./spo2cms50d+ --help" for more details.


Note:
The user executing the command must have read and write permissions to the device.
The recommended way to achieve this is to add the user to the group that is allowed to communicate with the device.
It is also possible to run this command as root. But it is highly unrecommended, as root, to execute any code just downloaded from the Internet without any code review!
How to add a user to the correct group is distribution specific, but here's one way that should work in most cases:

Suppose user "myuser" wants to access /dev/ttyUSB0

# Here we can tell that group "dialout" have read/write permissions to /dev/ttyUSB0:
$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Jul 20 09:47 /dev/ttyUSB0

# The following command will add user "myuser" in the "dialout" group. In this case, sudo is used to get administrative rights:
$ sudo adduser myuser dialout

# Note, the user has to logout from all his/her sessions to get the new group access.



Disclaimer
==========
Use at own risk!
I cannot be held responsible for any damages caused by this software.