Skip to content

Commit 8a29bee

Browse files
committed
versioning, renovate setup and gpl v3 license.
1 parent c2201f2 commit 8a29bee

12 files changed

Lines changed: 455 additions & 7 deletions

File tree

.github/renovate.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:base",
5+
":dependencyDashboard"
6+
]
7+
}

.github/workflows/renovate.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Renovate
2+
3+
on:
4+
schedule:
5+
# Run every Monday at 6:00 AM UTC
6+
- cron: '0 6 * * 1'
7+
workflow_dispatch:
8+
9+
jobs:
10+
renovate:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Self-hosted Renovate
17+
uses: renovatebot/github-action@v40.1.11
18+
with:
19+
configurationFile: renovate.json
20+
token: ${{ secrets.RENOVATE_TOKEN }}

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.1.0] - 2024-01-XX
11+
12+
### Added
13+
- Initial release of Meshtastic MQTT CLI
14+
- Send messages to Meshtastic devices via MQTT
15+
- Configuration file support (YAML)
16+
- CLI argument overrides for all configuration options
17+
- Support for broadcast and direct messages
18+
- Separate channel name (for MQTT topic) and channel number (for message payload)
19+
- Message format compliance with Meshtastic protocol
20+
- Comprehensive test suite with unit, integration, and validation tests
21+
- GPL v3 license
22+
- Renovate configuration for automated dependency updates
23+
24+
### Features
25+
- MQTT connection to mqtt.meshtastic.org or custom brokers
26+
- Configurable node IDs, channels, and regions
27+
- Message validation and error handling
28+
- Verbose logging support
29+
- Default configuration file creation
30+
- Cross-platform support (Linux, macOS, Windows)
31+
32+
[Unreleased]: https://github.com/yourusername/meshtastic-mqtt-cli/compare/v0.1.0...HEAD
33+
[0.1.0]: https://github.com/yourusername/meshtastic-mqtt-cli/releases/tag/v0.1.0

LICENSE

Whitespace-only changes.

README.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Meshtastic MQTT CLI
22

3+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
4+
[![Python Version](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/)
5+
[![Version](https://img.shields.io/badge/version-0.1.0-green.svg)](https://github.com/yourusername/meshtastic-mqtt-cli/releases)
6+
37
A Python command-line tool for sending messages to Meshtastic devices via MQTT. This tool simplifies the process of sending messages through the Meshtastic MQTT network by handling JSON message construction and protocol compliance automatically.
48

59
## Features
@@ -66,6 +70,7 @@ meshtastic:
6670
from_id: "!12345678"
6771
to_id: "^all"
6872
channel: "LongFast"
73+
channel_number: 0
6974
region: "US"
7075
```
7176
@@ -77,7 +82,8 @@ meshtastic:
7782
- `mqtt.password`: MQTT password for authentication (required)
7883
- `meshtastic.from_id`: Your Meshtastic node ID, e.g., `!12345678` (required)
7984
- `meshtastic.to_id`: Recipient node ID or `^all` for broadcast (default: `^all`)
80-
- `meshtastic.channel`: Meshtastic channel name (default: `LongFast`)
85+
- `meshtastic.channel`: Meshtastic channel name for MQTT topic (default: `LongFast`)
86+
- `meshtastic.channel_number`: Channel index in message payload, 0-7 (default: 0)
8187
- `meshtastic.region`: Meshtastic region code, e.g., `US`, `EU` (default: `US`)
8288

8389
## Usage
@@ -106,12 +112,14 @@ All command-line arguments override values from the configuration file.
106112
**Meshtastic Arguments:**
107113
- `--from-id`: Sender node ID (e.g., `!12345678`)
108114
- `--to-id`: Recipient node ID (e.g., `^all` for broadcast)
109-
- `--channel`: Meshtastic channel name
115+
- `--channel`: Meshtastic channel name for MQTT topic
116+
- `--channel-number`: Channel index in message payload (0-7)
110117
- `--region`: Meshtastic region code
111118

112119
**Other Arguments:**
113120
- `--config`: Path to custom configuration file
114121
- `--verbose`, `-v`: Enable verbose (DEBUG level) logging
122+
- `--version`: Display version information
115123
- `--help`, `-h`: Display help information
116124

117125
### Usage Examples
@@ -242,13 +250,46 @@ The JSON payload structure follows the Meshtastic protocol specification.
242250
- Use the configuration file for storing credentials instead
243251
- The `.gitignore` file excludes configuration files to prevent accidental credential commits
244252

253+
## Development
254+
255+
### Running Tests
256+
257+
```bash
258+
# Run all tests
259+
python -m unittest discover tests -v
260+
261+
# Run specific test file
262+
python -m unittest tests.test_integration -v
263+
264+
# Run validation tests against actual Meshtastic broker
265+
python tests/manual_validation.py
266+
```
267+
268+
### Dependency Management
269+
270+
This project uses [Renovate](https://docs.renovatebot.com/) for automated dependency updates. Renovate will automatically create pull requests to update dependencies when new versions are available.
271+
245272
## License
246273

247-
[Add your license information here]
274+
This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
275+
276+
### GPL v3 Summary
277+
278+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
279+
280+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
248281

249282
## Contributing
250283

251-
[Add contribution guidelines here]
284+
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
285+
286+
1. Fork the repository
287+
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
288+
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
289+
4. Push to the branch (`git push origin feature/AmazingFeature`)
290+
5. Open a Pull Request
291+
292+
Please make sure to update tests as appropriate and follow the existing code style.
252293

253294
## Support
254295

VERSIONING.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# Versioning and Release Management
2+
3+
This document describes the versioning strategy and release process for Meshtastic MQTT CLI.
4+
5+
## Versioning Strategy
6+
7+
This project follows [Semantic Versioning 2.0.0](https://semver.org/):
8+
9+
- **MAJOR** version: Incompatible API changes
10+
- **MINOR** version: New functionality in a backwards compatible manner
11+
- **PATCH** version: Backwards compatible bug fixes
12+
13+
Current version: **0.1.0**
14+
15+
## Version Files
16+
17+
Version information is stored in:
18+
- `src/meshtastic_mqtt_cli/__version__.py` - Single source of truth
19+
- `src/meshtastic_mqtt_cli/__init__.py` - Exports version for package
20+
- `setup.py` - Reads version from `__version__.py`
21+
22+
## Checking Version
23+
24+
### From Command Line
25+
```bash
26+
meshtastic-send --version
27+
```
28+
29+
### From Python
30+
```python
31+
from meshtastic_mqtt_cli import __version__, __version_info__
32+
33+
print(__version__) # "0.1.0"
34+
print(__version_info__) # (0, 1, 0)
35+
```
36+
37+
## Bumping Version
38+
39+
Use the provided script to bump version numbers:
40+
41+
```bash
42+
# Bump patch version (0.1.0 -> 0.1.1)
43+
python scripts/bump_version.py patch
44+
45+
# Bump minor version (0.1.0 -> 0.2.0)
46+
python scripts/bump_version.py minor
47+
48+
# Bump major version (0.1.0 -> 1.0.0)
49+
python scripts/bump_version.py major
50+
51+
# Dry run to see what would change
52+
python scripts/bump_version.py patch --dry-run
53+
```
54+
55+
The script will:
56+
1. Update `src/meshtastic_mqtt_cli/__version__.py`
57+
2. Update `CHANGELOG.md` with new version and date
58+
3. Show next steps for committing and tagging
59+
60+
## Release Process
61+
62+
1. **Update CHANGELOG.md**
63+
- Document all changes under `[Unreleased]` section
64+
- Follow [Keep a Changelog](https://keepachangelog.com/) format
65+
66+
2. **Bump Version**
67+
```bash
68+
python scripts/bump_version.py [major|minor|patch]
69+
```
70+
71+
3. **Review Changes**
72+
```bash
73+
git diff
74+
```
75+
76+
4. **Run Tests**
77+
```bash
78+
python -m unittest discover tests -v
79+
```
80+
81+
5. **Commit Changes**
82+
```bash
83+
git commit -am "chore: bump version to X.Y.Z"
84+
```
85+
86+
6. **Create Git Tag**
87+
```bash
88+
git tag vX.Y.Z
89+
```
90+
91+
7. **Push to Repository**
92+
```bash
93+
git push && git push --tags
94+
```
95+
96+
8. **Create GitHub Release** (if using GitHub)
97+
- Go to repository releases
98+
- Create new release from tag
99+
- Copy changelog entries for this version
100+
- Publish release
101+
102+
## Dependency Management
103+
104+
### Renovate Bot
105+
106+
This project uses [Renovate](https://docs.renovatebot.com/) for automated dependency updates.
107+
108+
**Configuration:** `renovate.json`
109+
110+
**Features:**
111+
- Automatically creates PRs for dependency updates
112+
- Runs weekly on Mondays at 6:00 AM
113+
- Auto-merges minor and patch updates
114+
- Prioritizes security updates
115+
- Limits concurrent PRs to avoid spam
116+
117+
**Renovate Settings:**
118+
- Schedule: Before 6am on Monday
119+
- Auto-merge: Minor and patch updates
120+
- PR limit: 5 concurrent, 2 per hour
121+
- Semantic commits: Enabled
122+
- Vulnerability alerts: Enabled
123+
124+
### Manual Dependency Updates
125+
126+
To manually update dependencies:
127+
128+
```bash
129+
# Update all dependencies to latest versions
130+
pip install --upgrade -r requirements.txt
131+
132+
# Update specific package
133+
pip install --upgrade paho-mqtt
134+
135+
# Regenerate requirements.txt
136+
pip freeze > requirements.txt
137+
```
138+
139+
### Checking for Outdated Dependencies
140+
141+
```bash
142+
pip list --outdated
143+
```
144+
145+
## Version History
146+
147+
See [CHANGELOG.md](CHANGELOG.md) for detailed version history.
148+
149+
## License
150+
151+
This project is licensed under GPL v3 - see [LICENSE](LICENSE) file.

renovate.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:base"
5+
],
6+
"packageRules": [
7+
{
8+
"matchUpdateTypes": ["minor", "patch"],
9+
"automerge": true
10+
},
11+
{
12+
"matchDepTypes": ["devDependencies"],
13+
"automerge": true
14+
}
15+
],
16+
"python": {
17+
"enabled": true
18+
},
19+
"pip_requirements": {
20+
"fileMatch": ["^requirements\\.txt$"]
21+
},
22+
"schedule": [
23+
"before 6am on Monday"
24+
],
25+
"labels": ["dependencies"],
26+
"assignees": [],
27+
"reviewers": [],
28+
"prConcurrentLimit": 5,
29+
"prHourlyLimit": 2,
30+
"semanticCommits": "enabled",
31+
"commitMessagePrefix": "chore(deps):",
32+
"commitMessageAction": "update",
33+
"commitMessageTopic": "{{depName}}",
34+
"commitMessageExtra": "to {{newVersion}}",
35+
"vulnerabilityAlerts": {
36+
"enabled": true,
37+
"labels": ["security"],
38+
"assignees": []
39+
}
40+
}

0 commit comments

Comments
 (0)