This script assists in using a WiFi enabled SD card by EzShare in your CPAP/BiPap device. This is coded for use with most ResMed devices from version 9 and up. Feel free to fork it for use with Philips Respironics and other devices.
The program runs on Python 3, and requires dependencies to be installed. Python versions 3.9 to 3.12 have been tested.
Argument | Description |
---|---|
-h , --help |
show this help message and exit |
--path PATH |
set destination path, defaults to $HOME/Documents/CPAP_Data/SD_card |
--url URL |
set source URL, Defaults to http://192.168.4.1/dir?dir=A: |
--start_from START_FROM |
start from date in YYYYMMDD format, deaults to None; this will override day_count if set |
--day_count DAY_COUNT , -n DAY_COUNT |
number of days to sync, defaults to None; if both start_from and day_count are unset all files will be synced |
--show_progress |
show progress, defaults to True |
--verbose , -v |
verbose output, defaults to False |
--overwrite |
force overwriting existing files, defaults to False |
--keep_old |
do not overwrite even if newer version is available, defaults to False |
--ignore IGNORE |
case insensitive comma separated list (no spaces) of files to ignore, defaults to JOURNAL.JNL,ezshare.cfg,System Volume Information |
--ssid SSID |
set network SSID; WiFi connection will be attempted if set, defaults to ez Share |
--psk PSK |
set network pass phrase, defaults to 88888888 |
--retries RETRIES |
set number of retries for failed downloads, defaults to 5 |
--version |
show program's version number and exit |
ezshare_resmed --ssid ezshare --psk 88888888 --show_progress
- Windows:
C:\Users\<USERNAME>\Documents\CPAP_Data
- macOS:
/Users/<USERNAME>/Documents/CPAP_Data
- Linux:
/home/<USERNAME>/Documents/CPAP_Data
Configuration to set the default parameters is done with a config.ini
file.
[ezshare_resmed]
path = ~/Documents/CPAP_Data/SD_card
url = http://192.168.4.1/dir?dir=A:
start_from = 20230924
day_count = 5
show_progress = True
verbose = False
overwrite = False
keep_old = False
ignore = JOURNAL.JNL,ezshare.cfg,System Volume Information
ssid = ez Share
psk = 88888888
retries = 5
ezshare_resmed looks for config files in this order:
./ezshare_resmed.ini
- in the same directory as the script./config.ini
- in the same directory as the script~/.config/ezshare_resmed.ini
~/.config/ezshare_resmed/ezshare_resmed.ini
~/.config/ezshare_resmed/config.ini
- Install Python 3
- Download repository
- Run installer script
- Open command window
- Run:
cd CPAP-data-from-EZShare-SD
- Run:
install_ezshare.bat
- The program, ezshare_resmed, is installed in
%USERPROFILE%\.local\bin
which will be added to the user%PATH%
if it was not already, in which case a new command window will need to be opened - Run:
ezshare_resmed
- Open your Terminal application
- Run:
cd CPAP-data-from-EZShare-SD
- Run:
./install_ezshare.sh
- The program, ezshare_resmed, is installed in
$HOME/.local/bin
, if it is not already in the$PATH
run:
- bash:
echo 'export PATH="\$HOME/.local/bin:\$PATH"' >> ~/.bashrc && source ~/.bashrc
- zsh:
echo 'export PATH="\$HOME/.local/bin:\$PATH"' >> ~/.zshrc && source ~/.zshrc
- Run:
ezshare_resmed
A Quick Guide for Installing Python 3 on Common Operating Systems
-
Open a command window, Run:
winget install -e --id Python.Python.3.12
-
Once Python is installed, you should be able to open a command window, type
python
, hit ENTER, and see a Python prompt opened. Typequit()
to exit it. You should also be able to run the commandpip
and see its options. If both of these work, then you are ready to go.
- If you cannot run
python
orpip
from a command prompt, you may need to add the Python installation directory path to the Windows PATH variable- The easiest way to do this is to find the new shortcut for Python in your start menu, right-click on the shortcut, and find the folder path for the
python.exe
file- For Python3, this will likely be something like
C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python312
- For Python3, this will likely be something like
- Open your Advanced System Settings window, navigate to the "Advanced" tab, and click the "Environment Variables" button
- Create a new system variable:
- Variable name:
PYTHON_HOME
- Variable value: <your_python_installation_directory>
- Variable name:
- Now modify the PATH system variable by appending the text
;%PYTHON_HOME%\;%PYTHON_HOME%;%PYTHON_HOME%\Scripts\
to the end of it. - Close out your windows, open a command window and make sure you can run the commands
python
andpip
- The easiest way to do this is to find the new shortcut for Python in your start menu, right-click on the shortcut, and find the folder path for the
macOS comes with a native version of Python but it is not recommended to use the native Python in order to not alter the system environment. There are a couple of ways we can install Python3 but this script is only tested using Homebrew.
Homebrew is a MacOS Linux-like package manager. Walk through the below steps to install Homebrew and an updated Python interpreter along with it.
- Open your Terminal application and run:
xcode-select --install
. This will open a window. Click 'Get Xcode' and install it from the app store. - Install Homebrew. Run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- You can also find this command on the Homebrew website
- Install latest Python3 with
brew install python
- Once Python is installed, you should be able to open your Terminal application, type
python3
, hit ENTER, and see a Python 3.X.X prompt opened. Typequit()
to exit it. You should also be able to run the commandpip3
and see its options. If both of these work, then you are ready to go.
- Here are some additional resources on Installing Python 3 on Mac OS X
- Raspberry Pi OS may need Python and PIP
- Install them:
sudo apt install -y python3-pip
- Install them:
- Debian (Ubuntu) distributions may need Python and PIP
- Update the list of available APT repos with
sudo apt update
- Install Python and PIP:
sudo apt install -y python3-pip
- Update the list of available APT repos with
- RHEL (CentOS) distributions usually need PIP
- Install the EPEL package:
sudo yum install -y epel-release
- Install PIP:
sudo yum install -y python3-pip
- Install the EPEL package:
- Arch may need Python and PIP
- Refresh pacman database and update system:
sudo pacman -Syu
- Install PIP:
sudo pacman -S python python-pip
- Refresh pacman database and update system: