Closed RStaes closed 2 years ago
what Optiboot did you flash? can you please show me the upload command line? what OS do you use?
I’m using The latent from your “my hardware” folder.
https://github.com/jandrassy/my_boards/blob/master/avr/bootloaders/optiboot8/optiboot_atmega2560.hex
I use Arduino IDE on Windows 10.
"C:\\Users\\Robin\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\\Users\\Robin\\AppData\\Local\\Temp\\arduino_build_944869/Zoneverwarming4.ino.elf"
Sketch uses 37640 bytes (14%) of program storage space. Maximum is 261120 bytes.
Global variables use 3015 bytes (36%) of dynamic memory, leaving 5177 bytes for local variables. Maximum is 8192 bytes.
C:\Users\Robin\Documents\Arduino\hardware\my_boards-master/tools/arduinoOTA.exe -address 192.168.1.119 -port 65280 -t 61 -username arduino -password password -sketch C:\Users\Robin\AppData\Local\Temp\arduino_build_944869/Zoneverwarming4.ino.bin -upload /sketch -b
turn off the watchdog for a test
I did, same result.
I had a problem with OTA caused by Linux shell some weeks ago, so I tested the OTA upload to Mega and after I solved the command line problem the upload worked without problems. Others sometime report problems and we solve them and it works. Usual problems are those mentioned in troubleshooting section, watchdog and self reset problems on some derivative Mega.
Ok, but it worked before...
The error is not in the sketch I think. When i upload this sketch with USB it runs. Then when I change text in serialprint and upload the sketch with programmer it is still not working. I think something is wrong with the programmer.
#include <SPI.h>
#include <Ethernet.h>
#include <ArduinoOTA.h>
//#define Serial SerialUSB
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
void setup() {
//Initialize serial:
Serial.begin(9600);
while (!Serial);
// start the Ethernet connection:
Serial.println("Initialize Ethernet with DHCP:");
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
} else {
Serial.print(" DHCP assigned IP ");
Serial.println(Ethernet.localIP());
}
// start the OTEthernet library with internal (flash) based storage
ArduinoOTA.begin(Ethernet.localIP(), "arduino", "password", InternalStorage);
}
void loop() {
// check for updates
ArduinoOTA.poll();
// add your normal loop code below ...
}
can you try the upload over network port?
How can I do that? Under Tools>Port there is no network port.
with Ethernet library it should be possible to get the network port. try every trick you find with google. I usually try to restart Arduino IDE, restart the network interface, restart the OS (computer). But maybe you need to install Bonjour into Windows.
I'm sorry to bother you again...
Ok, now when I upload the sketch to the network port after compiling a window pops up where I have to enter a password. I guess it is "password" since that's the one in the sketch. Now I get this error:
{network_cmd} -address 192.168.1.120 -port 65280 -username arduino -password password -sketch C:\Users\Robin\AppData\Local\Temp\arduino_build_844495/Zoneverwarming_boven.ino.bin -upload /sketch -b
java.io.IOException: Cannot run program "{network_cmd}": CreateProcess error=2, Het systeem kan het opgegeven bestand niet vinden
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:26)
at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
at cc.arduino.packages.uploaders.GenericNetworkUploader.uploadUsingPreferences(GenericNetworkUploader.java:99)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
at processing.app.SketchController.upload(SketchController.java:732)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$UploadHandler.run(Editor.java:2055)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: CreateProcess error=2, Het systeem kan het opgegeven bestand niet vinden
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 8 more
On google I can not find something that causes this error.
there is a bug in Arduino AVR core 1.8.4 with OTA settings. as you see {network_cmd} is not replaced. use 1.8.3 or do this fix: https://github.com/arduino/ArduinoCore-avr/commit/525be9e725744c29f8c3b3fa4c216ce4f768e035
and AVR core 1.8.5 is already on its way to Boards Manager. maybe in a few days, maybe in a few hours.
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. When i use 'Upload using programmer' I get no error and the message below is telling me all went fine. But when the Mega restart it just runs the old sketch.
What am I doing wrong?
Sketch: