A desktop application for monitoring and displaying data from O2Ring pulse oximeter devices. Built with Electron, React, and Python.
TestTypePython/
├── src/
│ ├── python/ # Python backend
│ │ ├── o2ring.py # Main Python script for O2Ring communication
│ │ └── o2r/ # O2Ring library
│ ├── electron/ # Electron main process
│ │ ├── main.ts # Main process code
│ │ ├── preload.ts # Preload script
│ │ └── tsconfig.json # TypeScript config
│ ├── App.tsx # React frontend
│ └── main.tsx # React entry point
- Real-time monitoring of O2Ring data
- Display of oxygen levels and heart rate
- Motion and battery level monitoring
- Raw data output display
- Easy start/stop monitoring controls
- Node.js and npm
- Python 3
- Electron
- TypeScript
- React
- Clone the repository:
git clone [repository-url]
cd TestTypePython- Install Node.js dependencies:
npm install- Install Python dependencies:
pip install -r requirements.txtStart the development server:
npm run devThis will:
- Start the Vite dev server
- Launch the Electron app
- Connect to the O2Ring device
Create production build:
npm run buildPackage the application:
npm run package- O2Ring device → Python script
- Python script → Electron main process
- Electron main process → React frontend
- Handles BLE (Bluetooth Low Energy) communication
- Device discovery and connection
- Data streaming and processing
- Device configuration
- Manages desktop application window
- Handles Python process spawning
- Implements IPC communication
- User interface for monitoring
- Real-time data display
- Raw output visualization
start-o2ring: Starts the Python processstop-o2ring: Stops the Python processo2ring-data: Streams data from Python to frontend
- Oxygen level (%)
- Heart rate (BPM)
- Heart rate strength
- Motion data
- Battery level
- Raw output
npm run testpython -m pytest-
Python process not starting
- Check Python path
- Verify dependencies
- Check permissions
-
BLE connection issues
- Verify device is in range
- Check Bluetooth permissions
- Restart the application
-
Data display issues
- Check IPC communication
- Verify data format
- Check React state management
- Implement proper error handling in Python script
- Use try-catch blocks in Electron main process
- Handle disconnections gracefully
- Use efficient data structures
- Implement proper cleanup on app exit
- Handle memory management carefully
- Keep sensitive data secure
- Validate all inputs
- Use proper error messages
- Data logging and export
- Advanced data visualization
- Multiple device support
- Custom alerts and notifications
- Offline data storage
- User preferences management
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
[Add your license information here]
[Add your contact information here]