Hey, with the help of some messages I found on forums, I bundled a batch file to automatically send the file when exporting.
This is not the best way to resolve this, but you already avoid additional programs.
1- The file must be in the same folder as the sketch (INO file).
2- In "Hostname" should be the same as your ESP-link, use the ping command to test the esp-link, if it is dripping, it must be online.
3- In "AVRDUDE" Need to indicate avrdude.exe folder (full path in my case, IDE in zip file)
Note 1: The commands are tab sensitive, if it does not work try downloading the file.
Note 2: The *ino.eightanaloginputs.hex file, that was generated in the export will be erased, to wait for the next export. Backup: file.hex.
Note 3: To stop using Ctrl+C and confirm. Or close it.
Note 4: Sending data through the serial port made by arduino will cause the esp-link to block, but you can access the esp-link through the browser and reset the arduino at the time of upload. If you need to send data constantly, it may be best to use a second esp-link on ports other than the one used in programming.
Attention: Careful! Can not connect the esp8266 directly to 5V, I used a resistor / zener diode. In a test, by connecting directly to the arduino reset, my esp8266 has been permanently damaged.
file.bat (will run at a command prompt)
rem Hostname of your esp-link, you can change it
SET Hostname="esp-link"
rem
rem Location of avrdude.exe, need avrdude.conf in this folder too
SET AVRDUDE="D:\Arduino185\hardware\tools\avr\bin\avrdude"
rem
@echo off
:loop
for %%a in (*ino.eightanaloginputs.hex) do (
@echo %%a
@echo Trying to upload ...
@echo Please wait...
copy /Y %%a file.hex
%AVRDUDE% -p atmega328p -c arduino -P net:esp-link:23 -b 57600 -D -U flash:w:file.hex:i
@echo Deleting hex file...
del %%a
)
timeout /t 5
goto loop
Result:
Blink.ino.eightanaloginputs.hex
Trying to upload ...
Please wait...
1 file (s) copied.
avrdude: ser_drain(): read error: Incorrect parameter. (Previous scketch was blocking the esp-link)
avrdude: ser_drain(): read error: Incorrect parameter.
avrdude: ser_drain(): read error: Incorrect parameter.
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "file.hex"
avrdude: writing flash (948 bytes):
Writing | ################################################## | 100% 0.39s
avrdude: 948 bytes of flash written
avrdude: verifying flash memory against file.hex:
avrdude: load data flash data from input file file.hex:
avrdude: input file file.hex contains 948 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 1.96s
avrdude: verifying ...
avrdude: 948 bytes of flash verified
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
avrdude done. Thank you.
Deleting hex file...
autoUpload.zip (499 Bytes)