Repository navigation
Platformio_publishing
This guide explains how to publish the AlteriomPainlessMesh library to the PlatformIO Library Registry.
- Visit https://platformio.org/ and create an account
- Verify your email address
- Log in to your PlatformIO account
-
Generate a new Personal Access Token
-
Copy the token and store it securely
-
Set up the token in your local environment:
# Set environment variable (Windows PowerShell) $env:PLATFORMIO_AUTH_TOKEN="YOUR_TOKEN_HERE" # Or for Command Prompt set PLATFORMIO_AUTH_TOKEN=YOUR_TOKEN_HERE # Or use login command pio account login
- Set up the token in your local environment:
pio account token --set YOUR_TOKEN_HERE
Ensure these files are properly configured:
{
"name": "AlteriomPainlessMesh",
"keywords": "ethernet, m2m, iot, mesh, alteriom, sensor, esp32, esp8266, json, time-sync, wireless, communication",
"description": "painlessMesh library with Alteriom extensions for sensor networks",
"repository": {
"type": "git",
"url": "https://github.com/Alteriom/painlessMesh"
},
"version": "1.6.1",
"frameworks": ["arduino"],
"platforms": ["espressif8266", "espressif32"],
"dependencies": [...],
"authors": [...],
"license": "LGPL-3.0",
"homepage": "https://github.com/Alteriom/painlessMesh",
"headers": "painlessMesh.h",
"examples": ["examples/basic/basic.ino", "examples/alteriom/alteriom_sensor_node.ino"],
"export": {
"include": "src"
}
}Should remain compatible for dual publishing:
name=AlteriomPainlessMesh
version=1.6.1
author=Coopdis,Scotty Franzyshen,Edwin van Leeuwen,Germán Martín,Maximilian Schwarz,Doanh Doanh,Alteriom
maintainer=Alteriom
sentence=A painless way to setup a mesh with ESP8266 and ESP32 devices with Alteriom extensions
paragraph=...
category=Communication
url=https://github.com/Alteriom/painlessMesh
architectures=esp8266,esp32
includes=AlteriomPainlessMesh.h
depends=ArduinoJson, TaskSchedulerThis method automatically publishes when you create a Git tag:
-
Ensure all files are committed and pushed:
git add . git commit -m "Prepare v1.6.1 for PlatformIO Library Registry" git push origin main
-
Create and push a Git tag:
git tag v1.6.1 git push origin v1.6.1
-
PlatformIO will automatically detect the new tag and import the library
- Monitor at: https://platformio.org/lib/show/LIBRARY_ID/AlteriomPainlessMesh
- It may take 5-15 minutes for the library to appear
If automatic detection doesn't work:
-
Create a tarball of your library:
# Create archive excluding unnecessary files tar --exclude='.git' --exclude='test' --exclude='bin' --exclude='.vscode' --exclude='node_modules' -czf AlteriomPainlessMesh-1.6.1.tar.gz .
-
Submit via PlatformIO Library Registry:
- Visit https://platformio.org/lib/register
- Upload the created tarball
- Fill in any additional metadata
# Ensure you're authenticated
pio account token --set YOUR_TOKEN_HERE
# Publish the library
pio pkg publish .# Search for your published library
pio pkg search "AlteriomPainlessMesh"
# View detailed information
pio pkg show alteriom/AlteriomPainlessMeshCreate a test project to verify the library can be installed:
mkdir test_project
cd test_project
pio project init --board esp32dev
# Add to platformio.ini:
# lib_deps = alteriom/AlteriomPainlessMesh@^1.6.1
pio pkg installFor future releases:
-
Update version numbers:
-
library.json→"version": "1.6.2" -
library.properties→version=1.6.2 -
package.json→"version": "1.6.2"
-
-
Commit changes:
git add . git commit -m "Bump version to 1.6.2" git push origin main
-
Create new tag:
git tag v1.6.2 git push origin v1.6.2
-
Verify update appears in registry
-
Library name conflicts:
- Use a unique name like "AlteriomPainlessMesh" instead of "painlessMesh"
- Check existing libraries:
pio pkg search "painless"
-
Authentication errors:
- Verify token:
pio account show - Regenerate token if needed
- Verify token:
-
Dependency resolution errors:
- Ensure all dependencies exist in PlatformIO Registry
- Check version constraints (use
^for flexible versions)
-
Git repository requirements:
- Repository must be publicly accessible
- Tags must follow semantic versioning (v1.6.1)
- library.json must be in repository root
# Check authentication status
pio account show
# List all your published packages
pio pkg search --owner="YOUR_USERNAME"
# View package statistics
pio pkg stats
# Update package metadata
pio pkg update-
Semantic Versioning:
- Use format: MAJOR.MINOR.PATCH (e.g., 1.6.1)
- Increment MAJOR for breaking changes
- Increment MINOR for new features
- Increment PATCH for bug fixes
-
Documentation:
- Include comprehensive README.md
- Provide working examples in examples/ directory
- Document all public APIs
-
Testing:
- Test library installation in clean environments
- Verify examples compile successfully
- Test on both ESP8266 and ESP32 platforms
-
Dependency Management:
- Specify minimum required versions
- Use version ranges (^1.6.0) for flexibility
- Platform-specific dependencies when needed
- Library Registry: https://platformio.org/lib
- Account Management: https://platformio.org/account
- Submit Library: https://platformio.org/lib/register
- Documentation: https://docs.platformio.org/en/latest/librarymanager/index.html
Note: After successful publication, users will be able to install your library using:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = alteriom/AlteriomPainlessMesh@^1.6.1