pymc-core


Namepymc-core JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryA Python MeshCore library with SPI LoRa radio support
upload_time2025-09-07 21:12:44
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords mesh networking lora radio iot communication
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyMC_Core

[![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://rightup.github.io/pyMC_core/)
[![PyPI](https://img.shields.io/pypi/v/pymc-core)](https://pypi.org/project/pymc-core/)
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)

**pyMC_Core** is a Python reimplementation of [MeshCore](https://github.com/meshcore-dev/meshcore) — a lightweight, portable C++ library for multi-hop packet routing using LoRa radios. Designed for **Raspberry Pi** and similar hardware, pyMC_Core communicates with LoRa modules over **SPI**.

> pyMC_Core is under active development. It's compatible with the original MeshCore protocol, but not yet as optimized or elegant as its C++ counterpart.

## Documentation

**Complete documentation is available at **[https://rightup.github.io/pyMC_core/](https://rightup.github.io/pyMC_core/)**

### Quick Links
- [Node Usage Guide](https://rightup.github.io/pyMC_core/node/) - Guide for using MeshNode
- [Examples](https://rightup.github.io/pyMC_core/examples/) - Working code examples
- [API Reference](https://rightup.github.io/pyMC_core/api/) - Detailed API documentation

## Quick Start

### Installation

> **Important**: On modern Python installations (Ubuntu 22.04+, Debian 12+), you may encounter `externally-managed-environment` errors when installing packages system-wide. Create a virtual environment first:
>
> ```bash
> # Create virtual environment
> python3 -m venv pymc_env
>
> # Activate virtual environment
> # On Linux/Mac:
> source pymc_env/bin/activate
> # On Windows:
> pymc_env\Scripts\activate
> ```

```bash
# Install from PyPI
pip install pymc-core

# For hardware support (SX1262 radios)
pip install pymc-core[hardware]

# Install all dependencies
pip install pymc-core[all]
```

### Basic Usage

```python
import asyncio
from pymc_core import MeshNode, LocalIdentity
from pymc_core.hardware.sx1262_wrapper import SX1262Radio

async def main():
    # Create radio (Waveshare HAT example)
    radio = SX1262Radio(
        bus_id=0, cs_pin=21, reset_pin=18,
        busy_pin=20, irq_pin=16, txen_pin=6,
        frequency=869525000, tx_power=22
    )
    radio.begin()

    # Create mesh node
    identity = LocalIdentity()
    node = MeshNode(radio=radio, local_identity=identity)
    await node.start()

    print("Mesh node started!")

asyncio.run(main())
```

For examples, see the [documentation](https://rightup.github.io/pyMC_core/examples/).

## Hardware Support

### Supported Radios
- **Waveshare SX1262 LoRaWAN/GNSS HAT** - Popular Raspberry Pi LoRa module
- **HackerGadgets uConsole** - All-in-one extension board with LoRa support

### Requirements
- Raspberry Pi (or compatible SBC)
- SX1262 LoRa module
- SPI interface enabled
- Python 3.8+

## What is MeshCore?

MeshCore enables **long-range, decentralized communication** using **multi-hop packet routing**. Devices (nodes) forward packets through neighboring nodes to reach distant ones — no central infrastructure required.

It occupies a middle ground between:

| Project | Focus |
|---------|-------|
| [Meshtastic](https://meshtastic.org/) | Casual LoRa messaging |
| [Reticulum](https://reticulum.network/) | Full encrypted networking stack |

### Use Cases
- Off-grid and emergency communication
- Tactical or field mesh deployments
- IoT mesh networks
- Remote monitoring systems

## Architecture

```
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   Application   │    │   MeshNode      │    │   Hardware      │
│                 │    │                 │    │                 │
│ • Text Messages │◄──►│ • Packet Routing│◄──►│ • SX1262 Radio  │
│ • Advertisements│    │ • Identity Mgmt │    │ • SPI Interface │
│ • Telemetry     │    │ • Event Service │    │ • GPIO Control  │
│ • Group Channels│    │ • Repeater Mgmt │    │                 │
└─────────────────┘    └─────────────────┘    └─────────────────┘
```

## Security

- **Ed25519/X25519 cryptographic identities**
- **End-to-end encryption** for messages
- **CRC validation** for data integrity
- **Secure key exchange** protocols

## Project Structure

```
pyMC_Core/
├── src/pymc_core/          # Main package
│   ├── hardware/           # Radio hardware interfaces
│   ├── node/               # MeshNode implementation
│   ├── protocol/           # Packet protocols
│   └── events/             # Event handling
├── examples/               # Working examples
│   ├── common.py           # Shared utilities
│   ├── send_flood_advert.py
│   ├── send_direct_advert.py
│   └── ...
├── docs/                   # MkDocs documentation
│   ├── docs/               # Documentation source files
│   ├── mkdocs.yml          # MkDocs configuration
│   ├── requirements.txt    # Documentation dependencies
│   └── serve-docs.sh       # Local development script
├── .github/workflows/      # GitHub Actions
│   └── deploy-docs.yml     # Documentation deployment pipeline
└── tests/                  # Unit tests
```

## Contributing

Contributions are welcome! Please see our [contributing guide](https://rightup.github.io/pyMC_core/contributing/) for details.

### Development Setup

```bash
# Clone the repository
git clone https://github.com/rightup/pyMC_Core.git
cd pyMC_Core

# Install development dependencies
pip install -e .[dev]


```



## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Acknowledgments

- Original [MeshCore](https://github.com/meshcore-dev/meshcore) C++ implementation
- Waveshare and HackerGadgets for hardware support

## Support

- [Documentation](https://rightup.github.io/pyMC_core/)
- [Issues](https://github.com/rightup/pyMC_Core/issues)
- [Discussions](https://github.com/rightup/pyMC_Core/discussions)
- [Meshcore Discord](https://discord.com/channels/1343693475589263471/1343693475589263474)

---

*Built with ❤️ for mesh networking enthusiasts*</content>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pymc-core",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "mesh, networking, lora, radio, iot, communication",
    "author": null,
    "author_email": "Lloyd Newton <lloyd@rightup.co.uk>",
    "download_url": "https://files.pythonhosted.org/packages/ad/81/65cbad268dacfa7eb5d816b9e5947ab00bf484e2b6f86e4e56f35c79aeaf/pymc_core-1.0.0.tar.gz",
    "platform": null,
    "description": "# pyMC_Core\n\n[![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://rightup.github.io/pyMC_core/)\n[![PyPI](https://img.shields.io/pypi/v/pymc-core)](https://pypi.org/project/pymc-core/)\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n\n**pyMC_Core** is a Python reimplementation of [MeshCore](https://github.com/meshcore-dev/meshcore) \u2014 a lightweight, portable C++ library for multi-hop packet routing using LoRa radios. Designed for **Raspberry Pi** and similar hardware, pyMC_Core communicates with LoRa modules over **SPI**.\n\n> pyMC_Core is under active development. It's compatible with the original MeshCore protocol, but not yet as optimized or elegant as its C++ counterpart.\n\n## Documentation\n\n**Complete documentation is available at **[https://rightup.github.io/pyMC_core/](https://rightup.github.io/pyMC_core/)**\n\n### Quick Links\n- [Node Usage Guide](https://rightup.github.io/pyMC_core/node/) - Guide for using MeshNode\n- [Examples](https://rightup.github.io/pyMC_core/examples/) - Working code examples\n- [API Reference](https://rightup.github.io/pyMC_core/api/) - Detailed API documentation\n\n## Quick Start\n\n### Installation\n\n> **Important**: On modern Python installations (Ubuntu 22.04+, Debian 12+), you may encounter `externally-managed-environment` errors when installing packages system-wide. Create a virtual environment first:\n>\n> ```bash\n> # Create virtual environment\n> python3 -m venv pymc_env\n>\n> # Activate virtual environment\n> # On Linux/Mac:\n> source pymc_env/bin/activate\n> # On Windows:\n> pymc_env\\Scripts\\activate\n> ```\n\n```bash\n# Install from PyPI\npip install pymc-core\n\n# For hardware support (SX1262 radios)\npip install pymc-core[hardware]\n\n# Install all dependencies\npip install pymc-core[all]\n```\n\n### Basic Usage\n\n```python\nimport asyncio\nfrom pymc_core import MeshNode, LocalIdentity\nfrom pymc_core.hardware.sx1262_wrapper import SX1262Radio\n\nasync def main():\n    # Create radio (Waveshare HAT example)\n    radio = SX1262Radio(\n        bus_id=0, cs_pin=21, reset_pin=18,\n        busy_pin=20, irq_pin=16, txen_pin=6,\n        frequency=869525000, tx_power=22\n    )\n    radio.begin()\n\n    # Create mesh node\n    identity = LocalIdentity()\n    node = MeshNode(radio=radio, local_identity=identity)\n    await node.start()\n\n    print(\"Mesh node started!\")\n\nasyncio.run(main())\n```\n\nFor examples, see the [documentation](https://rightup.github.io/pyMC_core/examples/).\n\n## Hardware Support\n\n### Supported Radios\n- **Waveshare SX1262 LoRaWAN/GNSS HAT** - Popular Raspberry Pi LoRa module\n- **HackerGadgets uConsole** - All-in-one extension board with LoRa support\n\n### Requirements\n- Raspberry Pi (or compatible SBC)\n- SX1262 LoRa module\n- SPI interface enabled\n- Python 3.8+\n\n## What is MeshCore?\n\nMeshCore enables **long-range, decentralized communication** using **multi-hop packet routing**. Devices (nodes) forward packets through neighboring nodes to reach distant ones \u2014 no central infrastructure required.\n\nIt occupies a middle ground between:\n\n| Project | Focus |\n|---------|-------|\n| [Meshtastic](https://meshtastic.org/) | Casual LoRa messaging |\n| [Reticulum](https://reticulum.network/) | Full encrypted networking stack |\n\n### Use Cases\n- Off-grid and emergency communication\n- Tactical or field mesh deployments\n- IoT mesh networks\n- Remote monitoring systems\n\n## Architecture\n\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502   Application   \u2502    \u2502   MeshNode      \u2502    \u2502   Hardware      \u2502\n\u2502                 \u2502    \u2502                 \u2502    \u2502                 \u2502\n\u2502 \u2022 Text Messages \u2502\u25c4\u2500\u2500\u25ba\u2502 \u2022 Packet Routing\u2502\u25c4\u2500\u2500\u25ba\u2502 \u2022 SX1262 Radio  \u2502\n\u2502 \u2022 Advertisements\u2502    \u2502 \u2022 Identity Mgmt \u2502    \u2502 \u2022 SPI Interface \u2502\n\u2502 \u2022 Telemetry     \u2502    \u2502 \u2022 Event Service \u2502    \u2502 \u2022 GPIO Control  \u2502\n\u2502 \u2022 Group Channels\u2502    \u2502 \u2022 Repeater Mgmt \u2502    \u2502                 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n## Security\n\n- **Ed25519/X25519 cryptographic identities**\n- **End-to-end encryption** for messages\n- **CRC validation** for data integrity\n- **Secure key exchange** protocols\n\n## Project Structure\n\n```\npyMC_Core/\n\u251c\u2500\u2500 src/pymc_core/          # Main package\n\u2502   \u251c\u2500\u2500 hardware/           # Radio hardware interfaces\n\u2502   \u251c\u2500\u2500 node/               # MeshNode implementation\n\u2502   \u251c\u2500\u2500 protocol/           # Packet protocols\n\u2502   \u2514\u2500\u2500 events/             # Event handling\n\u251c\u2500\u2500 examples/               # Working examples\n\u2502   \u251c\u2500\u2500 common.py           # Shared utilities\n\u2502   \u251c\u2500\u2500 send_flood_advert.py\n\u2502   \u251c\u2500\u2500 send_direct_advert.py\n\u2502   \u2514\u2500\u2500 ...\n\u251c\u2500\u2500 docs/                   # MkDocs documentation\n\u2502   \u251c\u2500\u2500 docs/               # Documentation source files\n\u2502   \u251c\u2500\u2500 mkdocs.yml          # MkDocs configuration\n\u2502   \u251c\u2500\u2500 requirements.txt    # Documentation dependencies\n\u2502   \u2514\u2500\u2500 serve-docs.sh       # Local development script\n\u251c\u2500\u2500 .github/workflows/      # GitHub Actions\n\u2502   \u2514\u2500\u2500 deploy-docs.yml     # Documentation deployment pipeline\n\u2514\u2500\u2500 tests/                  # Unit tests\n```\n\n## Contributing\n\nContributions are welcome! Please see our [contributing guide](https://rightup.github.io/pyMC_core/contributing/) for details.\n\n### Development Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/rightup/pyMC_Core.git\ncd pyMC_Core\n\n# Install development dependencies\npip install -e .[dev]\n\n\n```\n\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Original [MeshCore](https://github.com/meshcore-dev/meshcore) C++ implementation\n- Waveshare and HackerGadgets for hardware support\n\n## Support\n\n- [Documentation](https://rightup.github.io/pyMC_core/)\n- [Issues](https://github.com/rightup/pyMC_Core/issues)\n- [Discussions](https://github.com/rightup/pyMC_Core/discussions)\n- [Meshcore Discord](https://discord.com/channels/1343693475589263471/1343693475589263474)\n\n---\n\n*Built with \u2764\ufe0f for mesh networking enthusiasts*</content>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python MeshCore library with SPI LoRa radio support",
    "version": "1.0.0",
    "project_urls": {
        "Documentation": "https://rightup.github.io/rightup/pyMC_core",
        "Homepage": "https://github.com/rightup/pyMC_core",
        "Issues": "https://github.com/rightup/pyMC_core/issues",
        "Repository": "https://github.com/rightup/pyMC_core.git"
    },
    "split_keywords": [
        "mesh",
        " networking",
        " lora",
        " radio",
        " iot",
        " communication"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "66bf4ed1e9ad633eb6b97b87e8d92f788411a219ead4cb1b65e53c93058d7513",
                "md5": "7cb1b5b227a932edfb1c8a70392a0c8a",
                "sha256": "7256ecf23844d0770e0b5fcc6af11209dfff2f2ca4c755b15640e80244b419fd"
            },
            "downloads": -1,
            "filename": "pymc_core-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7cb1b5b227a932edfb1c8a70392a0c8a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 100709,
            "upload_time": "2025-09-07T21:12:43",
            "upload_time_iso_8601": "2025-09-07T21:12:43.236640Z",
            "url": "https://files.pythonhosted.org/packages/66/bf/4ed1e9ad633eb6b97b87e8d92f788411a219ead4cb1b65e53c93058d7513/pymc_core-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ad8165cbad268dacfa7eb5d816b9e5947ab00bf484e2b6f86e4e56f35c79aeaf",
                "md5": "4db94bad08ff32207d11170595e8774e",
                "sha256": "3959e16444920d5c7d99f6e87c25dd415680350431c48fa8e9980058e2a716e6"
            },
            "downloads": -1,
            "filename": "pymc_core-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4db94bad08ff32207d11170595e8774e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 102248,
            "upload_time": "2025-09-07T21:12:44",
            "upload_time_iso_8601": "2025-09-07T21:12:44.502591Z",
            "url": "https://files.pythonhosted.org/packages/ad/81/65cbad268dacfa7eb5d816b9e5947ab00bf484e2b6f86e4e56f35c79aeaf/pymc_core-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-07 21:12:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rightup",
    "github_project": "pyMC_core",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pymc-core"
}
        
Elapsed time: 2.66669s