Has anyone had success using OTA with Arduino IDE 2.0 beta 12? I get a connection error when I select the network port, but no information that tells me what the error actually is. I am using OTA code that works in IDE 1.x. The 8266 is in STA mode and the OTA setup code shows the ip address that is in the port select pulldown, but the port will not connect.
@strickce's formal bug report to the IDE developers is here:
Thanks for bringing that to our attention!
I think there is an important comment in that issue:
if I stop the serial monitor and restart it, the error message goes away.
If I understand correctly, the problem is that the Serial Monitor is handling the network port selection incorrectly. It is normal (though perhaps not ideal UX?) that if you have Serial Monitor open and disconnect the serial port (e.g., unplug the Arduino board USB cable from your computer), then you get these repeated notifications about the failure to reconnect to the serial port. Like this:
Sorry I wasn't as clear as I wanted to be. I'll give you my setup, then go through the steps that lead to the problem.
I have a sketch that contains an asynchronous web server that I use to control some lighting. It turns out that the web server and the OTA code cannot run together. Therefore, I did what many others have done and use a flag in EEPROM to control how the program boots. If the flag is off, the web server code boots and the web page is served. There is an OTA button on the page that, when pushed, writes the OTA flag "on" in EEPROM and then causes a reboot of the 8266. This time, the boot reads the flag and causes the OTA code to run. When that code runs, it causes the IDE to recognize that there is a network port at the address of the 8266.
At this time, the serial monitor has shown the print statements from the OTA code and everything there looks normal.
Now I select the network port and the error happens. Im on a mac and see the yellow error banner and to the lower right of the serial monitor window, the two messages as in your reply. Then, if I go back and select the serial port again, the serial monitor does not change, even if I reload the sketch using the serial port. This block serial output from the running sketch until I stop the serial monitor and restart it. That is the only way I know of that I can stop the error messages from flashing.
After all of that, I must admit that this is not a very serious problem. I could just recycle the serial monitor when I get this kind of error.
btw, the subject line references an Arduino forum post I made about the connection problem itself. Based on what I hear from other users, I may open another issue about that. Or should I not, since you already know about it?
Arduino 2.0 RC1
I use the OTA sketch to test with a ESP8266 Lolin Wemos D1 mini pro. The port is showing in the show all ports section.
When I try to flash, the sketch compile without problems, the password is asked (if I don't have set a password too). I have then take 'admin' and re flashed the ESP with the com port. The Serial monitor gives the correct OTA string. After that another try with OTA, every time a goth an error.
Firewall disable don't have consequence.
One thing is a progress. Arduino 1.8 don't show the OTA port numbers on my win10 PC.
I have try with USB connected and with only 5V connected. Both same result.
I installed Arduino IDE 2.0.0-rc2-nightly.20211218 on my openSUSE Linux Leap 15.3 box today, and tried an OTA upload to ESP8266 Lolin Wemos D1 R2. I selected the board, then selected the port address.(I have 4 of these on my local network, and all four were listed). After the successful compile, I got this error --
Usage: espota.py [options]
espota.py: error: option -p: invalid integer value: '{upload.port.properties.port}'
Upload error: Failed uploading: uploading error: exit status 2
It appears that passing the IP address to the -p option has a problem.
This board was close by so I connected it to a USB port, re-configured the parameters, and it uploaded OK.
I was using IDE 1.18.13 to perform OTA uploads with no problem.
Thanks so much to the both of you for this report. I apologize for having been slow to respond. I put it on my "to do" list to investigate and submit a formal bug report to the Arduino IDE developers, but didn't get to it yet.
However, the Arduino community comes through even when I don't and there is now a report of it here:
(thanks @Juraj!)
Arduino 2.0.0 rc 3 nigthy 20220127 ; Mac OSX 11.6.2 ; ESP32 WEMOS D1MINI ESP32
I do not see the IP-adresse from the ESP32 as an serial connection for OTA upload.
Sometimes the Mac bulitin bluetooth port shows up, but not always.
With "/dev/cu.Bluetooth-Incomming-Port" it should be possible to connect to a HC-05 and program a Pro-Mini 3V3 .
With Arduino 1.8.19 OTA works fine to ESP32 or ESP8266
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.