Skip to content

Latest commit

 

History

History
83 lines (63 loc) · 1.74 KB

README.md

File metadata and controls

83 lines (63 loc) · 1.74 KB

TPMS Tools

Tools for encoding and transmitting TPMS (Tire Pressure Monitoring System) signals.

Setup

This project uses uv for dependency management. Make sure you have uv installed:

curl -LsSf https://astral.sh/uv/install.sh | sh

Development Setup

  1. Clone the repository:
git clone https://github.com/yagoliz/tpms_tools.git
cd tpms_tools
  1. Create and activate a virtual environment using uv:
uv venv
source .venv/bin/activate 
  1. Install dependencies including development tools:
uv pip install -e ".[dev]"

Usage

Generate a WAV-file that can then be transmitted:

python3 scripts/wavfile.py renault --sensor-id 0x123456 --pressure 220 --temperature 25

Development

Format code:

black src/ tests/
ruff check src/ tests/ --fix

Run tests:

pytest

Project Structure

tpms_tools/
├── src/
│   └── tpms_tools/      # Main package
│       ├── encoders/    # Modulation and encoders
│       │   └── devices/ # TPMS transmitter devices
│       ├── modulation/  # Signal modulation
│       └── transmission/# SDR transmission (not developed atm)
├── tests/              # Test suite
└── pyproject.toml      # Project configuration

Adding a New TPMS Protocol

  1. Create a new encoder in src/tpms_tools/encoders/devices
  2. Subclass TPMSEncoder
  3. Implement the required methods
  4. The CLI will automatically detect your new encoder

Example:

from tpms_tools.encoders.base import TPMSEncoder

class MyTPMSEncoder(TPMSEncoder):
    @property
    def protocol_name(self) -> str:
        return "MyProtocol"
    
    # Implement other required methods