monotick-flash
v1.0.8
Published
Factory flasher CLI for Monotick ESP32 devices
Maintainers
Readme
monotick-flash
Factory flasher CLI for Monotick ESP32 devices - Single command factory production tool.
Quick Start
# Flash device with internal secret
npx monotick-flash --secret $INTERNAL_SECRET --port /dev/ttyUSB0
# Test mode (dry run)
npx monotick-flash --secret $INTERNAL_SECRET --port /dev/ttyUSB0 --dry-run
# Custom API endpoint
npx monotick-flash -s $SECRET -p /dev/ttyUSB0 --url https://your-api.comFeatures
- One-command flashing: Complete device flashing in a single command
- Automatic workflow:
next → flash → report3-step automation - Real-time logging: Live flash progress and detailed logs
- Error handling: Comprehensive error handling and recovery
- Dry run mode: Test mode without actual hardware flashing
- Cross-platform: Works on Linux, macOS, and Windows
Installation
No installation required! Use with npx for immediate execution:
npx monotick-flash --helpUsage
Basic Usage
# Flash next device in queue
npx monotick-flash --secret YOUR_SECRET --port /dev/ttyUSB0Options
-s, --secret <secret> Internal secret for API authentication (required)
-p, --port <port> Serial port for ESP32 device (required)
-u, --url <url> API base URL (default: https://monotick.im)
-b, --baud <rate> Baud rate for flashing (default: 115200)
-c, --chip <type> ESP32 chip type (default: esp32)
--dry-run Test mode - skip actual flashing
--verbose Verbose output
-h, --help Display help
-V, --version Display versionEnvironment Variables
export API_BASE_URL=https://monotick.im
export INTERNAL_SECRET=your_internal_secretExamples
# Basic factory usage
npx monotick-flash --secret $INTERNAL_SECRET --port /dev/ttyUSB0
# Development with local API
npx monotick-flash -s dev_secret -p /dev/ttyUSB0 --url http://localhost:5000
# Test mode with verbose output
npx monotick-flash -s $SECRET -p /dev/ttyUSB0 --dry-run --verbose
# Custom baud rate and chip type
npx monotick-flash -s $SECRET -p /dev/ttyUSB0 --baud 921600 --chip esp32s3Output
Successful Flash
🔧 Monotick Factory Flasher
✔ API connection successful
✔ Device assigned for flashing
📱 Device Information:
▶ Device ID: monotick_00000001
▶ Initial OTP: 123456
▶ Firmware URL: https://monotick.im/firmware/latest.bin
✔ Flash completed successfully
✔ Result reported successfully
✅ Flash completed successfully
Device monotick_00000001 is ready for deploymentNo Devices Available
🔧 Monotick Factory Flasher
✔ API connection successful
ℹ No devices in queue - all devices processedError Handling
🔧 Monotick Factory Flasher
✖ API connection failed - check secret and URLRequirements
- Node.js 18+
- Python 3.7+ with
esptoolpackage - Valid internal secret for API authentication
- ESP32 device connected via USB
Platform-Specific Setup
Windows:
# Install esptool using Python launcher
py -m pip install --user esptool
# Verify installation
py -m esptool --versionLinux/macOS:
# Install esptool
pip install esptool
# Verify installation
esptool.py --versionWindows Port Names
Use Windows COM port format:
npx monotick-flash --secret $env:INT_SEC --port COM9API Integration
The CLI integrates with the Monotick factory API:
- GET /api/factory/next: Get next device to flash
- POST /api/factory/flash-report: Report flash results
All API calls use x-internal-secret header for authentication.
Development
# Clone and setup
git clone https://github.com/your-org/monotick.git
cd monotick/monotick-flash
# Install dependencies
npm install
# Build
npm run build
# Test locally
npm run dev -- --helpLicense
MIT
Support
For issues and questions, please contact the Monotick factory team.
