JAndrassy / ArduinoOTA

Arduino library to upload sketch over network to Arduino board with WiFi or Ethernet libraries
GNU Lesser General Public License v2.1
435 stars 89 forks source link

OTA upload succesfull, but old sketch remains, even when I JUST flashed the Optiboot bootloader #200

Open ChadMatsalla opened 1 year ago

ChadMatsalla commented 1 year ago

Discussed in https://github.com/JAndrassy/ArduinoOTA/discussions/151

Originally posted by **AttilaTtila** April 24, 2022 Hi Juraj, I have 2x Mega2560 (with builtin Wifi) boards and i'd really like to make OTA working for them! So i burned the Optiboot bootloader by MCUDude. Then i used your example sketch (SerialWiFiOTA) to test. Then i make minor change in the code and upload it via "Upload using programmer". All seems OK, "Sketch uploaded successfully" message appears, but after board resets, the old sketch started running again (or it just hangs completely). Any advise please? Thanks! Attila
JAndrassy commented 1 year ago

If you test OTA with the 'fake' programmer, close the Serial Monitor in IDE. With Serial Monitor open, IDE will reset the board after upload tool finishes. The board then doesn't finish to apply the update.

ChadMatsalla commented 1 year ago

What about when arduinoOTA is used? Definitely no serial connection is open to the board.

JAndrassy commented 1 year ago

if you use network port then no, Serial Monitor is not connected. but with ota programmer method the Serial Monitor could be connected.

are you on Windows or on Linux? I had problems on Linux with upload command in quotes.

insufficient powering could be a problem. doing wifi and writing to flash at the same time.