ino2bin is a command-line Python tool that automates compiling Arduino .ino sketches into .bin firmware files, specifically tailored for ESP8266/ESP32 boards. It leverages the official Arduino CLI for compilation, ensuring a smooth and reproducible workflow for developers and makers.
- 🔍 Automatic checks: Validates sketch and folder structure for Arduino CLI compatibility.
- ⚡ Fast compilation: Converts
.inofiles to.binfiles ready for flashing. - 📂 Custom output directory: Saves compiled binaries in a user-defined or default build folder.
- 🛑 Clear error messages: Informs you of missing files, folder mismatches, or compilation failures.
- Python 3.6+
- Arduino CLI (tested with v0.30+)
- ESP8266/ESP32 board package installed via Arduino CLI
-
Install Arduino CLI[OPTIONAL INSTALLATION ALREADY INCLUDED IN THE SCRIPT]
Follow the official instructions for your OS. -
Install ESP8266/ESP32 board support[OPTIONAL INSTALLATION ALREADY INCLUDED IN THE SCRIPT]
Example for ESP8266:arduino-cli core update-index arduino-cli core install esp8266:esp8266 -
Clone or download this script
git clone https://github.com/xbee9/ino2bin.git cd ino2bin chmod +x installer.sh ./installer.sh -
Do in a single step
git clone https://github.com/xbee9/ino2bin.git && cd ino2bin && chmod +x installer.sh && ./installer.sh
python3 ino_to_bin.py path/to/sketch.ino-
Make sure your
.inofile is inside a folder with the same name as the sketch.
Example:MyProject/ MyProject.ino -
The compiled
.binwill be saved in thebuild/directory by default.
- Checks if the
.inofile exists. - Verifies that the
.inofile is in a folder matching its name (Arduino CLI requirement). - Compiles the sketch using Arduino CLI.
- Places the resulting
.binfile in thebuild/directory. - Prints the path to the binary or any error encountered.
python3 ino_to_bin.py Blink/Blink.inoOutput:
[+] Compiling Blink.ino to .bin...
[+] Success: Binary located at:
/your/path/build/Blink.ino.bin
This tool is ideal for developers seeking a lightweight and automated solution to compile Arduino sketches into firmware binaries without relying on the full Arduino IDE.
- Arduino CLI
- Python 3.6 or higher
- ESP8266/ESP32 board packages (install via Arduino CLI)
- File not found: Ensure the path to your
.inois correct. - Folder mismatch: Move your
.inointo a folder with the same name. - Compilation failed: Check the error message for missing libraries or syntax errors.
- .bin not found: Confirm you are targeting a board that produces a
.bin(like ESP8266/ESP32).
Happy hacking! 🤖✨ Made With :)