Closed RStaes closed 2 years ago
I guess it is a timeout in the upload tool. my_boards now has a version of the upload tool with timeout parameter and in avr platform.txt 30 seconds is set as timeout. get the files from my_boards repo or If you don't want to use an exe downloaded from internet, you can download the source code of arduinoOTA and build it with the Go language builder (which is simple to install)
Hey thanks! Where do i put this files? Now i have them in
C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\avr\tools.
The platform.txt contains this line:
C:\Users\User\AppData\Local\Arduino15\packages\Optiboot\hardware\avr/tools/arduinoOTA.exe -address 192.168.1.119 -port 65280 -t 30 -username arduino -password password -sketch C:\Users\User\AppData\Local\Temp\arduino_build_384939/Zoneverwarming3.ino.bin -upload /sketch -b
Note the / and the \ in the path. Is that right? I put this in the bottom of the platform.txt file with -t 30:
## Create output (bin file)
recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" -O binary {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
build.preferred_out_format=bin
## Save hex
recipe.output.tmp_file={build.project_name}.{build.preferred_out_format}
recipe.output.save_file={build.project_name}.{build.variant}.{build.preferred_out_format}
tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password password -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.with_bootloader.hex:i"
tools.arduinoOTA.cmd={runtime.hardware.path}/tools/arduinoOTA
tools.arduinoOTA.cmd.windows={runtime.hardware.path}/tools/arduinoOTA.exe
tools.arduinoOTA.program.params.verbose=
tools.arduinoOTA.program.params.quiet=
tools.arduinoOTA.program.pattern="{cmd}" -address {ip} -port 65280 -t 30 -username arduino -password password -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
The platform.txt file is located here:
C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.4
sorry, I modified only the 'programmer' definition, not the standard network_pattern.
in the past it was not possible to setup the network_command with keys other than the "runtime.tools." so I recommend you to use the fake programmer method
in tools.arduinoOTA.cmd={runtime.hardware.path}/tools/arduinoOTA
the runtime.hardware.path
points to my_boards folder
Still not working. I have the same error as before: I even tried with a 60 seconds en 180 seconds timeout.
Arduino: 1.8.13 (Windows 10), Board: "Arduino Mega 2560 (Optiboot)"
Sketch uses 41442 bytes (15%) of program storage space. Maximum is 261120 bytes.
Global variables use 3172 bytes (38%) of dynamic memory, leaving 5020 bytes for local variables. Maximum is 8192 bytes.
C:\Users\User\Documents\Arduino\hardware\my_boards-master/tools/arduinoOTA.exe -address 192.168.1.119 -port 65280 -t 60 -username arduino -password password -sketch C:\Users\User\AppData\Local\Temp\arduino_build_739379/Zoneverwarming3.ino.bin -upload /sketch -b
Connecting to board ... done
Uploading sketch ... done
Flashing sketch ... Error flashing the sketch
Error flashing the sketch
I'm missing something, but what?
turn on upload verbose mode in IDE Preferences
turn off the watchdog
you can Use ArduinoOTA.beforeApply to register a callback function. For example in setup ArduinoOTA.beforeApply(shutdown); and add the function to to sketch:
void shutdown() { wdt_disable(); }
Hero!! It was the watchdog!
And with ArduinoOTA.beforeApply I can disable the watchdog and still use it in my sketch. Thank you very much!!
And with ArduinoOTA.beforeApply I can disable the watchdog and still use it in my sketch. Thank you very much!!
with a small sketch a longer watchdog time may work. I use watchdog interrupt in my Regulator project to extended the watchdog time. I activate a reset in second interrupt so I have a 16 seconds watchdog
Hello,
i have this problem: I have an Arduino Mega 2560 and flashed the optiboot bootloader to it with an uno as programmer. All went fine. I uploaded my sketch, see code below, with use of the serial port. When upload is ready i can ping the Mega. Then, after a restart of Arduino IDE, i can't see the network port. But when i choose for programmer 'Arduino OTA 192.168.1.119' and click 'Upload using programmer' I get this error:
Can you help me out?
Sketch: