-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arduino Mega 2560 - OTA failed #6
Comments
tools.avrdude.upload.network_pattern is not set right. Do you try it with official AVR package? it will not work. Did you change the bootloader? |
many thanks for your quick response. |
yes. |
I will try it after 2 weeks time and let you know. I will close the issue for now and if I need more help I will get back to you. |
Hi all, What was the solution for this? I think I'm having the exact same problem. I already burn a new bootloader. ** |
you have old version of arduinoOTA upload tool. I see you have one copied in sketches folder's hardware subbofolder. delete it and/or install a new version of AVR boards package |
Hi,
* I removed the entire installation.
* I installed again everything (v1.8.112);
* I added ArduinoOTA from library management screen;
I already tried multiple approaches, so I would like to ask for your help in the next steps. I always have some difficulty with copy the platform.local.txt file step.
Thank you
…________________________________
De: Juraj Andrássy <[email protected]>
Enviado: 22 de abril de 2020 05:05
Para: jandrassy/ArduinoOTA <[email protected]>
Cc: VitorCSoares <[email protected]>; Comment <[email protected]>
Assunto: Re: [jandrassy/ArduinoOTA] Arduino Mega 2560 - OTA failed (#6)
you have old version of ArduinoOTA. I see you have one copied in sketches folder's hardware subbofolder. delete it and/or install a new version of AVR boards package
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#6 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AISW3EJUJOPTERNYFCLY25DRNZ3IFANCNFSM4HMJ6E3Q>.
|
ok. not very efficient way, but it did install the latest upload tool because it is part of the AVR boards package installed with the IDE. now the AVR boards package is in |
Yes, I copied my_boards to the hardware folder and I can select the board ( Optiboot ) in the IDE. I can upload the sketch to my Mega 2560 board through USB but still the same problem when using OTA. when introducing "password" |
the upload tool sometimes times-out even if the update is successful. you can add in WiFiOTA.cpp to
to see if the upload was successful. |
I got the solution. It was already presented by you multiple times. I did not understand your last comment about WiFiOTA.cpp |
Hi Jandrassy, After multiple success tests now I'm having the following problem: Connecting to board ... done Can you help me please? |
does it update the sketch? did you try to add the status print? |
No. The Sketch remains the same. Can you give a more detailed explanation of add the status Print? I did not get your point above in the previous message. |
I added the Status Code in the WiFiOTA.cpp. I'm getting "Unauthorized" as Status. The prompt to insert the password is not appearing now. Thank you |
try to set the password in the command in platform.local.txt |
Hi, It's saying Unauthorized, but the problem seems to be related to the Ethernet Switch I'm using. Maybe one of the switches is blocking some specific port needed. Thank you |
HI, I have read and followed previous comments:
But I still get this error Is their a way I can check if the Optiboot loader is burned correctly? What other checks can I do to know what the problem can be? |
platform.local.txt goes to 'official' AVR boards package in IDE installation folder or in Arduino15 folder platform.txt in my_boards is the same as platform.local.txt, but IDE doesn't read the OTA command here. (I use Exlipse Sloeber and it uses the OTA command from platform.txt from my_boards) |
I have moved platform.local.txt to Arduino15, restarted the ide and arduino but still the same error. Any other suggestions i can try? |
to Users/bart/Library/Arduino15/packages/arduino/hardware/avr? |
My mistake, in the correct folder as you specified it works, thnx! |
Hi @JAndrassy. I realized when I do the upload of the code using the programmer I get a success message although the code remains the same. Thank you |
Does that mean I need to burn a new bootloader again? If I understood correctly this copy_flash_pages function is not present in the bootload I loaded in the past. Sorry for the detailed question. |
sorry, the discussion in this issue is too long to read it again. how do you burn the bootloader? |
using your code extracted in May2020 |
you meant my_boards. then the bootloader should be OK. |
no Watchdog. Can you point me how to add it? |
@JAndrassy Can you please tell me how do I burn the bootloader? And another very important thing, can I go back to the original? |
@JAndrassy I see that the process is not so easy and since I have arduinos in production which is the ones I would like to load the bootloader to, I think it is not convenient for something to fail and run out of arduino. Thank you very much for your help, but I will keep it in mind. |
one more thing, I have an arduino mega that when loading the sketch appears timeout, that is a problem with the bootloader ?, and I have another that the usb port is not recognizable |
@JAndrassy I took a risk with a mega arduino that I thought was dead and done, I see that it is not difficult. I give you a challenge: load the sketch binary from the browser in arduino mega like this for esp32: https://lastminuteengineers.com/esp32-ota-web-updater-arduino-ide/amp/ can it be done in e arduino mega? |
see the Advanced examples. they show how to use InternalStorage to store and apply the update binary. |
@JAndrassy When changing the bootloader, is compatibility with any library lost or is everything the same? |
no other library cares about bootloader. bootloader is only there to write the application to flash memory. |
from the browser with the arduino mega I mean this: that's in an esp32, can it be done in arduino mega, upload the sketch from a url? |
ok, thanks |
where do you see a problem? |
My question is because with at least 2 esp32 it has happened to me that when selecting the port (the ip of the esp32) to upload the sketch it does not appear even though it is connected. In order for it to appear again, I must connect it with the usb cable, upload the sketch and there it appears. So that there is that problem, it does not assure me that I can update the sketch if I require it remotely and that is why I think it is much better and safe to do it from a url like the image, because having a connection with the arduino / esp32, if there will be access to upload the sketch binary do you understand me? |
I want to make a clarification, the esp32 that does not appear to me is connected to a wifi that is created in a raspberry as an access point in a subnet. The ip of the raspberry is 192.168.10.80 and the ip of the esp32 is 192.168.80.10, and that esp32 with the ip 192.168.80.10 does not appear in the list of ports |
hello @JAndrassy , I have burned the optiboot bootloader in the arduino mega, loaded my sketch and everything fine, what is the difference between ArduinoOTA.poll () and ArduinoOTA.handle ()? |
the WiFi101OTA library which I extended to ArduinoOTA had poll(). |
Hello @JAndrassy; So, I'm having some setup related issues, which popped up after I rebuilt my harddrive and reinstalled the Arduino IDE environment. I now have both, V1.8.13 and the newer V2.0.0.0 rc6. My arduino Mega 2560 has the optiboot loader burnt from before and I already installed your version of the AVR boards in a subdirectory of Documents/Arduino/hardware/my_boards-master (next to the standard my_boards). Programming via USB works well. The Network port shows up as well. When I try to upload files to the 2560, it asks for a password (I tried leaving it blank, "password" and "myoldpassword") and then I get the following message: Scanning through this thread from the beginning, I see various references to platform.tx and platform.local.txt. I scanned my disc for these files and they show up in your my_boards-master, as well as in the Program Files (x86) (these seem older though, platform.local being yours, platform being generic). Now, I vaguely remember having put my username and password in one of these files, but I cannot remember where that file was placed and searching for it in my Gdrive backup of the previous build produces nothing. So, here are a couple of questions for you, please: 1- in which file do I need to put my username and password in order to secure the upload process? 2- where do I need to place this/these files, in order for the upload to work via Network 3- do we really need to duplicate all these files in Program Files(x86) and in the Document paths? #3 reminds me of something: during the compile process, I do get a couple of references to duplicate libraries:
Thanks Juray! |
Forgot to say that I did copy platform.local.txt from the extras in the library to the my_boards-master/avr/ next to platform.txt |
my_boards it is not the right place |
OTA#arduinoota-tool-returns-failed-to-reset-the-board-upload-failed
Hi Juraj; Not quite sure what you mean by "my_boards it is not the right place". I'm guessing you don't mean the my_boards.png file... I currently have the following setup:
I also replaced "arduino" and "password" with my values in both platform and platform.local. And ArduinoOTA.begin() has the same values. Do you mean by your comment that I should replace the my_boards folder with the contents of my_boards-master? Cheers |
Follow up: After I looked closer into the preferences, I ended up placing platform.local into I also had to return the platform and platform.local to remove my custom username/password and return it to arduino/password. It now is WORKING with Arduino IDE 1.8.13! Thanks for that Juraj. It still is failing to upload with Arduino IDE 2.0.0. rc6 with the following error: Upload error: Failed uploading: uploading error: exit status 1 Follow-up questions: 1- I see hardware/avr folders in multiple locations: Under Documents/... and AppData/... and Programs(x86)... Is this because of multiple installs 1.8.13 and 2.0.0. rc6? 2- Can I delete some of these, or is it better to do an uninstall and potentially manually remove all things ARDUINO before attempting a new install? Thanks |
|
Thanks Juraj; I have things working for Arduino 1.8.13 now. It asks me for my password and properly uploads it to the Mega2560 via ethernet. (also via com3/USB) The Arduino 2.0.0 rc6 is still refusing to upload via Ethernet. It works via USB I tried to use the <> code brackets, but for some reason it didn't want to take them. error messages between __________ lines instead. Sorry. Ethernet Upload Error message: Compilation complete. avrdude: Version 6.3-20190619
avrdude: ser_open(): can't open device "192.168.10.249": The system cannot find the file specified. avrdude done. Thank you. Upload error: Failed uploading: uploading error: exit status 1 I'm using AVR ISP as programmer (same in Arduino 1.8.13, btw). Any ideas? Thanks Juraj! |
why does it upload with avrdude to IP? it is a wrong command. it should use arduinoOTA upload tool. |
Hi Juraj; Looking at the choice of programmers both in 1.8.13 and 2.0.0, I can see two: My LAN is on 192.168.10.XXX, with my desktop used for programming at x.109. I have no idea from where the IDE got these IP addresses for the Arduino OTA. Thanks |
IDE 2 always uses the arduino15 folder for platforms. did you copy platform.local.txt there? |
Yes I did. Here is the contents. This configuration file supports the general ArduinoOTA library https://github.com/jandrassy/ArduinoOTACreate 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" tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA arduinoOTA as programmer. add entries with {ip} into programmers.txttools.arduinoOTA.cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA I did find the x.1.104 etc in the programmers file in Documents/Arduino. When I changed it to 10.249 (Arduino IP address) and 10.190 (my desktop IP), the 1.8.13 shows the change, but not 2.0.0. Do I need to replace the programmers file in Arduino15 as well, or append the arduinoOTA elements? Thanks |
IDE 2.0 rc 5 had a different error with OTA upload. I check the rc 6 |
Ok, Thanks. In the meantime, I'm thinking of removing both 1.8.13 and 2.0.0 and deleting all references to Arduino from Program Files (x86), Arduino15 and Documents. Then starting from scratch. Does that make sense? I had the Arduino IDE Windows app installed at one point too. This had caused problems with ArduinoOTA in the beginning. You and I had a ton of back and forths until I finally dumped the Windows app. I'm guessing some of those extra files are a remnant of the App. |
so the IDE 2 has a different OTA configuration in platform.txt and boards.txt |
I tried to push a new firmware using the Arduino GUI on a Arduino Mega 2560 board. I had already flashed a code with your example, therefore I found a new network port on the GUI successfully.
During the OTA flashing a new window came up asking my password. I gave the correct password but then the password window came up again and again like I had given a wrong password.
It looks that for me the process cannot complete successfully.
In the Arduino GUI there was the following error message (in orange)
The text was updated successfully, but these errors were encountered: