How to make a bin file without compiling though Arduino IDE. For Nodemcu v3

Hello everybody!

I have 64 ESP boards where I want to upload code regularly. I have automated the process almost 100% the only thing I am missing is how to create the bin file from my ino without compiling through the arduino IDE and navigating to the /var folder to find the bin. I guess epstools build.py should do the job but even if I enable the verbose mode from arduino IDE i cannot find the exact command. Any ideas would be very appreciated thanks!

Maybe that is a question better suited to the ESP8266 forum ?

...R

You can use the Arduino CLI.

Pieter

SImply turn on verbose output, and look at the command line the IDE uses to upload the code. You can then move the .bin file wherever you like, and use the command line or a batch file to do the upload.

Regards,
Ray L.

Yes that far i am already. My question is if there is a way to generate the bin file without using the arduino IDE.

thej:
Yes that far i am already. My question is if there is a way to generate the bin file without using the arduino IDE.

The answer is exactly the same....

RayLivingston:
The answer is exactly the same....

Maybe you are right but I have turned on verbose mode and it doesn't output any command used to generate the bin file. If I am missing something please let me know :slight_smile:

There is not "a" command to output the bin file. The ENTIRE compile and link process must be run. The verbose output shows all of the MANY commands that are run to do that using the IDE. Trying to replicate that without the IDE is not a trivial task. Use the IDE to create the bin file, then copy it, and upload it to as many boards as you want. Or, get ready to spend a LOT of time trying to figure out everything that happens when you click "upload" in the IDE, so you can duplicate it without the IDE. It will take you days, if not weeks.

Regards,
Ray L.

RayLivingston:
There is not "a" command to output the bin file. The ENTIRE compile and link process must be run. The verbose output shows all of the MANY commands that are run to do that using the IDE. Trying to replicate that without the IDE is not a trivial task. Use the IDE to create the bin file, then copy it, and upload it to as many boards as you want. Or, get ready to spend a LOT of time trying to figure out everything that happens when you click "upload" in the IDE, so you can duplicate it without the IDE. It will take you days, if not weeks.

Regards,
Ray L.

First of all thank you very much for the feedback. The only problem is that the code is slightly different for each ESP so that means that I have to compile it manually 64 times instead of making 1 bin file and uploading to all the boards. I will look into what you said and how I can make it all manual. If there is an other way to do that I am all ears. The difference in the code is not major just changing the ESP identification value so when they connect to the MQTT server they have a unique names the rest of the code is the same.

thej:
Maybe you are right but I have turned on verbose mode and it doesn't output any command used to generate the bin file. If I am missing something please let me know :slight_smile:

Yes it does, it runs the Arduino builder. For example:

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\piete\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\piete\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\piete\Documents\Arduino\libraries -fqbn=esp8266:esp8266:generic:CpuFrequency=80,FlashFreq=40,FlashMode=dio,UploadSpeed=115200,FlashSize=512K64,ResetMethod=ck,Debug=Disabled,DebugLevel=None____ -ide-version=10802 -build-path C:\Users\piete\AppData\Local\Temp\arduino_build_669812 -warnings=none -build-cache C:\Users\piete\AppData\Local\Temp\arduino_cache_885350 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\piete\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2 -prefs=runtime.tools.mkspiffs.path=C:\Users\piete\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\0.1.2 -prefs=runtime.tools.esptool.path=C:\Users\piete\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.9 -verbose C:\Users\piete\Documents\GitHub\Projects\ESP8266\HTTP\HTTP-POST-char-array\HTTP-POST-char-array.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\piete\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\piete\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\piete\Documents\Arduino\libraries -fqbn=esp8266:esp8266:generic:CpuFrequency=80,FlashFreq=40,FlashMode=dio,UploadSpeed=115200,FlashSize=512K64,ResetMethod=ck,Debug=Disabled,DebugLevel=None____ -ide-version=10802 -build-path C:\Users\piete\AppData\Local\Temp\arduino_build_669812 -warnings=none -build-cache C:\Users\piete\AppData\Local\Temp\arduino_cache_885350 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\piete\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2 -prefs=runtime.tools.mkspiffs.path=C:\Users\piete\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\0.1.2 -prefs=runtime.tools.esptool.path=C:\Users\piete\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.9 -verbose C:\Users\piete\Documents\GitHub\Projects\ESP8266\HTTP\HTTP-POST-char-array\HTTP-POST-char-array.ino

RayLivingston:
Trying to replicate that without the IDE is not a trivial task. Use the IDE to create the bin file, then copy it, and upload it to as many boards as you want.

That's why I recommended to use the Arduino command line interface.

PieterP:
You can use the Arduino CLI.

thej:
The difference in the code is not major just changing the ESP identification value so when they connect to the MQTT server they have a unique names the rest of the code is the same.

Can't you negotiate an identification value at run-time? Or just use the MAC address as a unique value. No need to compile the same code multiple times.

PieterP:
Or just use the MAC address as a unique value. No need to compile the same code multiple times.

Yup, MAC address seems easiest: WiFi - Arduino Reference

Since I didn't find a solution in this thread, but it is currently the first result on google for "arduino command line build bin"
I want to add this link:

There's a solution that works for me.