dataskipper-boat


Namedataskipper-boat JSON
Version 1.0.2 PyPI version JSON
download
home_pageNone
SummaryIEC61850/Modbus monitoring, control and data collection system
upload_time2025-09-16 16:38:21
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseProprietary
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # DataSkipper Boat

DataSkipper Boat is a Modbus monitoring application that reads data from Modbus devices, processes it, and sends measurements and alerts to various destinations.

## Features

- Supports both Modbus TCP and Modbus RTU (Serial)
- Reads registers from multiple Modbus devices
- Processes measurements and checks for threshold violations
- Generates alerts for threshold violations and significant changes
- Stores measurements and alerts locally
- Sends measurements and alerts to API endpoints
- Sends alerts to Discord (and optionally other notification channels)
- Handles connection failures and retries

## Installation

1. Clone the repository:

```bash
git clone https://github.com/yourusername/dataskipper-boat.git
cd dataskipper-boat
```

2. Install the dependencies:

```bash
pip install -r requirements.txt
```

## Configuration

The application uses YAML configuration files located in the `config` directory:

- `slave_config.yaml`: Configuration for Modbus connections and devices
- `communication.yaml`: Configuration for API endpoints, MQTT, and notification channels

### Environment Variables

- `CONFIG_DIR`: Path to the configuration directory (default: `~/config`)
- `DATA_DIR`: Path to the data directory (default: `~/data`)

## Usage

To run the application:

```bash
python main.py
```

To reset water counters:

```bash
python reset_water_counter.py
```

## Testing

The application includes unit tests and integration tests. See [tests/README.md](tests/README.md) for more information on running the tests.

### Modbus Server Simulator

A Modbus server simulator is included for testing and development. To run the simulator:

```bash
python run_modbus_simulator.py
```

By default, the simulator will start on `localhost:5020`. You can specify a different host and port using the `--host` and `--port` options:

```bash
python run_modbus_simulator.py --host 0.0.0.0 --port 502
```

## Project Structure

- `main.py`: Main application entry point
- `reset_water_counter.py`: Script to reset water counters
- `src/`: Source code
  - `interfaces/`: Interface definitions
  - `models/`: Data models
  - `services/`: Services for communication with external systems
  - `utils/`: Utility functions
- `config/`: Configuration files
- `tests/`: Unit and integration tests

## Development

### Adding a New Device

To add a new Modbus device:

1. Add a new client configuration to `config/slave_config.yaml`
2. Define the registers to read from the device
3. Configure thresholds and alerts as needed

### Adding a New Notification Channel

To add a new notification channel:

1. Create a new notifier class in `src/services/notifiers/`
2. Implement the `INotifier` interface
3. Add the new notifier to the list of notifiers in `main.py`

## Releasing a New Version

To release a new version of DataSkipper Boat:

1. **Update version in pyproject.toml**:
   ```bash
   # Edit pyproject.toml and increment the version number
   version = "1.0.1"  # or whatever the new version is
   ```

2. **Build and upload to PyPI**:
   ```bash
   # Build the package
   python -m build
   
   # Upload to PyPI (requires PyPI account and API token)
   python -m twine upload dist/*
   ```

3. **Update target machines**:
   ```bash
   # On each target machine, run:
   sudo -u dcu pip3 install --user --upgrade dataskipper-boat
   sudo supervisorctl restart dataskipper-boat-*:*
   ```

## Setting Up a New Machine

To set up DataSkipper Boat on a new machine:

### Prerequisites
- Python 3.8+ installed
- Supervisor installed (`sudo apt install supervisor`)
- PyPI access (internet connection)

### Setup Steps

1. **Install the application**:
   ```bash
   # Install as user dcu (not root) to get correct paths
   sudo -u dcu pip3 install --user dataskipper-boat
   ```

2. **Create user and directories**:
   ```bash
   # Create user if it doesn't exist
   sudo useradd -m -s /bin/bash dcu
   
   # Create directories for each instance
   sudo mkdir -p /home/dcu/config_lt_panel /home/dcu/data_lt_panel
   sudo mkdir -p /home/dcu/config_ht_panel /home/dcu/data_ht_panel
   sudo mkdir -p /home/dcu/config_relay_panel /home/dcu/data_relay_panel
   sudo chown -R dcu:dcu /home/dcu/
   ```

3. **Install supervisor config**:
   ```bash
   # Copy supervisor config to target machine
   scp dataskipper-boat.conf target-machine:/tmp/
   
   # On target machine, install supervisor config
   sudo cp /tmp/dataskipper-boat.conf /etc/supervisor/conf.d/
   
   # Reload supervisor
   sudo supervisorctl reread
   sudo supervisorctl update
   ```

4. **Copy your configuration files**:
   ```bash
   # Copy your YAML config files to each instance directory:
   cp your_configs/slave_config.yaml /home/dcu/config_lt_panel/
   cp your_configs/communication.yaml /home/dcu/config_lt_panel/
   
   cp your_configs/slave_config.yaml /home/dcu/config_ht_panel/
   cp your_configs/communication.yaml /home/dcu/config_ht_panel/
   
   cp your_configs/slave_config.yaml /home/dcu/config_relay_panel/
   cp your_configs/communication.yaml /home/dcu/config_relay_panel/
   ```

5. **Start the processes**:
   ```bash
   sudo supervisorctl start dataskipper-boat-lt:*
   sudo supervisorctl start dataskipper-boat-ht:*
   sudo supervisorctl start dataskipper-boat-relay:*
   ```

6. **Verify everything is working**:
   ```bash
   # Check status
   sudo supervisorctl status
   
   # Check logs
   sudo supervisorctl tail -f dataskipper-boat-lt stderr
   ```

### Useful Management Commands
- **View status**: `sudo supervisorctl status`
- **Check logs**: `sudo supervisorctl tail -f dataskipper-boat-lt stderr`
- **Restart instance**: `sudo supervisorctl restart dataskipper-boat-lt:*`
- **Update application**: `sudo -u dcu pip3 install --user --upgrade dataskipper-boat && sudo supervisorctl restart dataskipper-boat-*:*`

## License

This project is proprietary software owned by DataSailors. All rights reserved. Unauthorized copying, modification, distribution, or use of this software is strictly prohibited. 

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dataskipper-boat",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Ayush <ayush@datasailors.io>",
    "download_url": "https://files.pythonhosted.org/packages/76/fc/925d1552235716b84e1f40a19624e012e2f6801118524f28b7ed3d83f0a2/dataskipper_boat-1.0.2.tar.gz",
    "platform": null,
    "description": "# DataSkipper Boat\n\nDataSkipper Boat is a Modbus monitoring application that reads data from Modbus devices, processes it, and sends measurements and alerts to various destinations.\n\n## Features\n\n- Supports both Modbus TCP and Modbus RTU (Serial)\n- Reads registers from multiple Modbus devices\n- Processes measurements and checks for threshold violations\n- Generates alerts for threshold violations and significant changes\n- Stores measurements and alerts locally\n- Sends measurements and alerts to API endpoints\n- Sends alerts to Discord (and optionally other notification channels)\n- Handles connection failures and retries\n\n## Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/yourusername/dataskipper-boat.git\ncd dataskipper-boat\n```\n\n2. Install the dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\n## Configuration\n\nThe application uses YAML configuration files located in the `config` directory:\n\n- `slave_config.yaml`: Configuration for Modbus connections and devices\n- `communication.yaml`: Configuration for API endpoints, MQTT, and notification channels\n\n### Environment Variables\n\n- `CONFIG_DIR`: Path to the configuration directory (default: `~/config`)\n- `DATA_DIR`: Path to the data directory (default: `~/data`)\n\n## Usage\n\nTo run the application:\n\n```bash\npython main.py\n```\n\nTo reset water counters:\n\n```bash\npython reset_water_counter.py\n```\n\n## Testing\n\nThe application includes unit tests and integration tests. See [tests/README.md](tests/README.md) for more information on running the tests.\n\n### Modbus Server Simulator\n\nA Modbus server simulator is included for testing and development. To run the simulator:\n\n```bash\npython run_modbus_simulator.py\n```\n\nBy default, the simulator will start on `localhost:5020`. You can specify a different host and port using the `--host` and `--port` options:\n\n```bash\npython run_modbus_simulator.py --host 0.0.0.0 --port 502\n```\n\n## Project Structure\n\n- `main.py`: Main application entry point\n- `reset_water_counter.py`: Script to reset water counters\n- `src/`: Source code\n  - `interfaces/`: Interface definitions\n  - `models/`: Data models\n  - `services/`: Services for communication with external systems\n  - `utils/`: Utility functions\n- `config/`: Configuration files\n- `tests/`: Unit and integration tests\n\n## Development\n\n### Adding a New Device\n\nTo add a new Modbus device:\n\n1. Add a new client configuration to `config/slave_config.yaml`\n2. Define the registers to read from the device\n3. Configure thresholds and alerts as needed\n\n### Adding a New Notification Channel\n\nTo add a new notification channel:\n\n1. Create a new notifier class in `src/services/notifiers/`\n2. Implement the `INotifier` interface\n3. Add the new notifier to the list of notifiers in `main.py`\n\n## Releasing a New Version\n\nTo release a new version of DataSkipper Boat:\n\n1. **Update version in pyproject.toml**:\n   ```bash\n   # Edit pyproject.toml and increment the version number\n   version = \"1.0.1\"  # or whatever the new version is\n   ```\n\n2. **Build and upload to PyPI**:\n   ```bash\n   # Build the package\n   python -m build\n   \n   # Upload to PyPI (requires PyPI account and API token)\n   python -m twine upload dist/*\n   ```\n\n3. **Update target machines**:\n   ```bash\n   # On each target machine, run:\n   sudo -u dcu pip3 install --user --upgrade dataskipper-boat\n   sudo supervisorctl restart dataskipper-boat-*:*\n   ```\n\n## Setting Up a New Machine\n\nTo set up DataSkipper Boat on a new machine:\n\n### Prerequisites\n- Python 3.8+ installed\n- Supervisor installed (`sudo apt install supervisor`)\n- PyPI access (internet connection)\n\n### Setup Steps\n\n1. **Install the application**:\n   ```bash\n   # Install as user dcu (not root) to get correct paths\n   sudo -u dcu pip3 install --user dataskipper-boat\n   ```\n\n2. **Create user and directories**:\n   ```bash\n   # Create user if it doesn't exist\n   sudo useradd -m -s /bin/bash dcu\n   \n   # Create directories for each instance\n   sudo mkdir -p /home/dcu/config_lt_panel /home/dcu/data_lt_panel\n   sudo mkdir -p /home/dcu/config_ht_panel /home/dcu/data_ht_panel\n   sudo mkdir -p /home/dcu/config_relay_panel /home/dcu/data_relay_panel\n   sudo chown -R dcu:dcu /home/dcu/\n   ```\n\n3. **Install supervisor config**:\n   ```bash\n   # Copy supervisor config to target machine\n   scp dataskipper-boat.conf target-machine:/tmp/\n   \n   # On target machine, install supervisor config\n   sudo cp /tmp/dataskipper-boat.conf /etc/supervisor/conf.d/\n   \n   # Reload supervisor\n   sudo supervisorctl reread\n   sudo supervisorctl update\n   ```\n\n4. **Copy your configuration files**:\n   ```bash\n   # Copy your YAML config files to each instance directory:\n   cp your_configs/slave_config.yaml /home/dcu/config_lt_panel/\n   cp your_configs/communication.yaml /home/dcu/config_lt_panel/\n   \n   cp your_configs/slave_config.yaml /home/dcu/config_ht_panel/\n   cp your_configs/communication.yaml /home/dcu/config_ht_panel/\n   \n   cp your_configs/slave_config.yaml /home/dcu/config_relay_panel/\n   cp your_configs/communication.yaml /home/dcu/config_relay_panel/\n   ```\n\n5. **Start the processes**:\n   ```bash\n   sudo supervisorctl start dataskipper-boat-lt:*\n   sudo supervisorctl start dataskipper-boat-ht:*\n   sudo supervisorctl start dataskipper-boat-relay:*\n   ```\n\n6. **Verify everything is working**:\n   ```bash\n   # Check status\n   sudo supervisorctl status\n   \n   # Check logs\n   sudo supervisorctl tail -f dataskipper-boat-lt stderr\n   ```\n\n### Useful Management Commands\n- **View status**: `sudo supervisorctl status`\n- **Check logs**: `sudo supervisorctl tail -f dataskipper-boat-lt stderr`\n- **Restart instance**: `sudo supervisorctl restart dataskipper-boat-lt:*`\n- **Update application**: `sudo -u dcu pip3 install --user --upgrade dataskipper-boat && sudo supervisorctl restart dataskipper-boat-*:*`\n\n## License\n\nThis project is proprietary software owned by DataSailors. All rights reserved. Unauthorized copying, modification, distribution, or use of this software is strictly prohibited. \n",
    "bugtrack_url": null,
    "license": "Proprietary",
    "summary": "IEC61850/Modbus monitoring, control and data collection system",
    "version": "1.0.2",
    "project_urls": {
        "Bug Reports": "https://datasailors.io/contact-us.html",
        "Homepage": "https://datasailors.io",
        "Source": "https://datasailors.io"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "51cd33ef44e1e452f2dd6289b3e4d1e70acee9a3005edfbc47a352c53796821e",
                "md5": "998e08659c9ce789c7e56b6159150a2f",
                "sha256": "88649f9b1a9d947f0671eb8b387cabb5bea7f227a38af61b01de0c6fc393ffb0"
            },
            "downloads": -1,
            "filename": "dataskipper_boat-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "998e08659c9ce789c7e56b6159150a2f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 32808,
            "upload_time": "2025-09-16T16:38:18",
            "upload_time_iso_8601": "2025-09-16T16:38:18.845479Z",
            "url": "https://files.pythonhosted.org/packages/51/cd/33ef44e1e452f2dd6289b3e4d1e70acee9a3005edfbc47a352c53796821e/dataskipper_boat-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "76fc925d1552235716b84e1f40a19624e012e2f6801118524f28b7ed3d83f0a2",
                "md5": "0044fb5bce1b4eb6f4a040c9dba7872a",
                "sha256": "f4493c6e1a9d3599e425052769b9decbfa7ff0201486d5c4796cbf7fbd1e7fa8"
            },
            "downloads": -1,
            "filename": "dataskipper_boat-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "0044fb5bce1b4eb6f4a040c9dba7872a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 28232,
            "upload_time": "2025-09-16T16:38:21",
            "upload_time_iso_8601": "2025-09-16T16:38:21.341561Z",
            "url": "https://files.pythonhosted.org/packages/76/fc/925d1552235716b84e1f40a19624e012e2f6801118524f28b7ed3d83f0a2/dataskipper_boat-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-16 16:38:21",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "dataskipper-boat"
}
        
Elapsed time: 3.12519s