Skip to content

Abhimanyu07/flash-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flash-Manager: Firmware Uploader Tool

This project provides tools to upload code to Arduino Nano and ESP32 boards, automatically injecting a random device ID into your code before upload. Both Python and Go CLI tools are available.

Getting Started

1. Install arduino-cli

macOS

brew install arduino-cli

Windows

  • Download the latest arduino-cli.exe from the releases page.
  • Add the folder containing arduino-cli.exe to your PATH.

Linux

curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
sudo mv bin/arduino-cli /usr/local/bin/

2. Set up Arduino CLI and Install Board Cores

arduino-cli config init
arduino-cli core update-index
# Install Arduino Nano core
arduino-cli core install arduino:avr
# Install ESP32 core
arduino-cli core install esp32:esp32

3. (Optional) Troubleshooting: Arduino Nano Old Bootloader

Many Arduino Nano boards (especially clones) require the "Old Bootloader". If you get upload errors like avrdude: stk500_getsync() not in sync, use this FQBN:

arduino:avr:nano:cpu=atmega328old

The tools are already set up to use the old bootloader for Nano uploads.


Python CLI Tool

Features

  • Replaces {{device_id}} in your source code with a random UUID
  • Uploads to Arduino Nano or ESP32 using arduino-cli

Requirements

  • Python 3.7+
  • arduino-cli installed and configured for your boards
  • Python dependencies: see requirements.txt

Installation

pip install -r requirements.txt

Usage

python main.py <source.ino> --board nano --port <serial_port>
python main.py <source.ino> --board esp32 --port <serial_port>
  • <source.ino>: Path to your Arduino/ESP32 sketch file
  • --board: Target board type (nano or esp32)
  • --port: Serial port (e.g., /dev/ttyUSB0, /dev/ttyACM0, or COM3)

Go CLI Tool

Features

  • Replaces {{device_id}} in your source code with a random UUID-like string (using Go's standard library, no external dependencies)
  • Uploads to Arduino Nano or ESP32 using arduino-cli

Requirements

  • Go 1.13+
  • arduino-cli installed and configured for your boards

Installation

No external Go dependencies are required. Just use the standard library.

Usage

go run main.go -source <source.ino> -board nano -port <serial_port>
go run main.go -source <source.ino> -board esp32 -port <serial_port>
  • <source.ino>: Path to your Arduino/ESP32 sketch file
  • -board: Target board type (nano or esp32)
  • -port: Serial port (e.g., /dev/ttyUSB0, /dev/ttyACM0, or COM3)

Notes

  • The Go tool generates a random UUID-like string for {{device_id}} using the standard library (crypto/rand).
  • No external Go modules are required.
  • The tool creates a temporary file for upload and cleans it up after.

Example

Suppose your code contains:

String id = "{{device_id}}";

When you run either tool, it will replace {{device_id}} with a random UUID and upload the code to your board.

Notes

  • Make sure arduino-cli is installed and your board cores are set up. See arduino-cli docs for details.
  • The tool creates a temporary file for upload and cleans it up after.

Future Scope

  • Custom variables in the code
  • Adding the dynamic data to database for post manufacturing support
  • Webhooks to linkup with e-commerce website and backend to update the status of device as per a device_id in the dashboard
  • Supporting firebase, supabase and on-prem database
  • Supporting other boards
  • UI

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors