Adding Prompt to IDE "Upload" function

I may be the only person who wishes for this particular enhancement but I think it warrants
mentioning anyway.
I have several microprocessors situated on my homestead that monitor different outbuildings and are accessible through the local LAN. Some of these installations are using processors that are not easily removable unfortunately, hindsight being 20-20.
I use a little Dell Latitude 2100 running Windows 10 with IDE 1.8.19 to field load microprocessors with occassional software updates. I know OTA is out there but I have never went down that rabbit hole yet.
To say the DELL notebook computer is a tad slow is an understatement. It has been on the market for over a decade. It can take nearly 20-30 minutes to compile an INO file of any size beyond a simple BLINK routine on an ESP.
The issue for me is that when I am preparing to upload a processor in the field I have to stand there with all attentiveness and wait for the compile to end and the upload to begin. With an ESP32 a button press is necessary to link the IDE & the ESP. If you miss the 10-15 second window to trigger the link the whole process must be restarted. :disappointed_relieved:
I was wondering about two things:

  1. Could an "Upload Prompt" be a Preferences addition that allows the user to specify whether they want to use a "time to upload" prompt upon compile completion? It would be an option.
  2. Or could there be a way to generate the compiled code on another machine and then simply transfer that code over to your field PC IDE and upload that directly?
    I do not envision these additions necessarily being a major software write so implementing it might not be a major time investment.
    At the least it is "food for thought" ....

Hi @edthewino

You can definitely do this:

Compiling


ā“˜ You don't need an ESP32 board connected to your "another machine" computer for this part.


  1. Open the sketch on the "another machine".
  2. Select File > Preferences... from the Arduino IDE menus.
    The "Preferences" dialog will open.
  3. Uncheck the box next to "Show verbose output during: ā˜‘ compilation" in the "Preferences" dialog.
  4. Check the box next to "Show verbose output during: ā˜ upload".
  5. Click the OK button.
  6. Select the appropriate board from the Tools > Board menu.
  7. Select Sketch > Upload from the Arduino IDE menus.
  8. Wait for the upload operation to finish or fail.
  9. Find the upload command in the black output panel at the bottom of the Arduino IDE.
    It will look something like this:
    "C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.5.1/esptool.exe" --chip esp32 --port "COM51" --baud 921600  --before default_reset --after hard_reset write_flash  -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 "C:\Users\per\AppData\Local\Temp\arduino\sketches\AEBC25540F203B528A4CED7B891951B0/sketch_sep6a.ino.bootloader.bin" 0x8000 "C:\Users\per\AppData\Local\Temp\arduino\sketches\AEBC25540F203B528A4CED7B891951B0/sketch_sep6a.ino.partitions.bin" 0xe000 "C:\Users\per\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/partitions/boot_app0.bin" 0x10000 "C:\Users\per\AppData\Local\Temp\arduino\sketches\AEBC25540F203B528A4CED7B891951B0/sketch_sep6a.ino.bin" 
    
  10. Copy the .bin files from the paths shown in the upload command to the "field PC".
    :exclamation: If looking for it with your file manager or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "ā˜ Hidden items".
  11. Select the entire upload command in the output panel of Arduino IDE.
  12. Press Ctrl+C.
    This will copy the command to the clipboard.
  13. Open any text editor.
  14. Press Ctrl+V.
    This will paste the copied command into the editor.
  15. If you have a different username on the "field PC", modify the username component of the path to esptool.exe.
    In my example command, the path is like this:
    "C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.5.1/esptool.exe"
    
  16. Modify the paths of the .bin files in the command to their location on the "field PC".
  17. Save the file in the text editor.
  18. Move the saved text file to the "field PC".

Uploading

  1. Open the text file containing the upload command on the "field PC" in any text editor.
  2. Modify the port in the --port flag of the command to the port of the ESP32 board you want to upload to.
  3. Select the full command in the text editor.
  4. Press Ctrl+C.
  5. Click the Windows "Start" button.
    The Windows "Start" menu will open.
  6. Type terminal in the search field of the "Start" menu.
  7. Select "Terminal" from the search results.
    A "Windows PowerShell" window will open.
  8. Type & at the PowerShell prompt.
  9. Press Ctrl+V.
    This will paste the copied command into the PowerShell prompt.
  10. Press the Enter key.

The compiled .bin files should now be uploaded to the ESP32 board. You can repeat the above "Uploading" procedure for each of the other boards you want to upload to.

2 Likes

This is not the case with any of the ESP32s that I use. Which ESP32 boards are you using ?

As to your second question, the IDE allows you to export the compiled binary file which could then be uploaded to a board or board without the need to recompile the code. This is not a process that I am familiar with but I am sure that it is possible

ESP-WROOM-32

Which ESP32s do not require a button push?

Interesting. I need to try this. This definitely qualifies as a "workaround." :+1: :+1: :+1:

Appreciate the suggestion....

Whichever ESP32 is on my ESP32 dev boards labelled on their cans as ESP32-WRCOM-32
or the one labelled ESP-32S
or the one labelled ESP32-WRCOOM-32D

Do those have any buttons like a reboot?

Here is a pic of the WROOM model with the two pushbuttons on either side of the USB port.

The first one has a BOOT and EN button and the other two have a RST button but they are not needed in order to upload code.

Aimply click the Upload button in the IDE and the code is compiled and uploaded with no further intervention

I rarely have such luck ...lol

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.