I am attempting to update OTA to an ESP8266 (NodeMCU 1.0). This worked fine in version 1.8.2 before upgrade. Now I am getting the error "The system cannot find the file specified." I checked that my port is set to the network address properly:
Here is the full error output:
Executable segment sizes:
IROM : 302224 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 29368 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1344 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 1636 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 27056 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 334572 bytes (32%) of program storage space. Maximum is 1044464 bytes.
Global variables use 30036 bytes (36%) of dynamic memory, leaving 51884 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.8
Serial port 192.168.1.226
Traceback (most recent call last):
File "C:\Users\Josh\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/upload.py", line 65, in <module>
esptool.main(cmdline)
File "C:/Users/Josh/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\esptool.py", line 2889, in main
esp = chip_class(each_port, initial_baud, args.trace)
File "C:/Users/Josh/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\esptool.py", line 237, in __init__
self._port = serial.serial_for_url(port)
File "C:/Users/Josh/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial\serial\__init__.py", line 88, in serial_for_url
instance.open()
File "C:/Users/Josh/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial\serial\serialwin32.py", line 62, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port '192.168.1.226': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)
Failed uploading: uploading error: exit status 1
In order to gather more information that might help us to troubleshoot your problem, I'm going to ask you to post the full output from the upload when in verbose mode.
NOTE: These instructions will not solve the problem. They are only intended to possibly gather some more information about the problem, which might provide a clue that leads to a solution.
Please do this:
Select File > Preferences from the Arduino IDE menus.
Uncheck the checkbox next to Show verbose output during: ☑ compilation
Check the checkbox next to Show verbose output during: ☐ upload.
Click the OK button.
Attempt an upload, as you did before.
Wait for the upload to fail.
You will see a "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the COPY ERROR MESSAGES button on that notification.
Open a forum reply here by clicking the Reply button.
Click the </> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press Ctrl+V.
This will paste the error output from the upload into the code block.
Move the cursor outside of the code tags before you add any additional text to your reply.
Thanks for the reply. I have done as you've asked, but it does not look like it changed much. Either way, here's the output:
Executable segment sizes:
IROM : 302224 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 29368 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1344 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 1636 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 27056 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 334572 bytes (32%) of program storage space. Maximum is 1044464 bytes.
Global variables use 30036 bytes (36%) of dynamic memory, leaving 51884 bytes for local variables. Maximum is 81920 bytes.
"C:\Users\Josh\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3" "C:\Users\Josh\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/upload.py" --chip esp8266 --port "192.168.1.226" --baud "115200" "" --before default_reset --after hard_reset write_flash 0x0 "C:\Users\Josh\AppData\Local\Temp\arduino-sketch-CFCE7305B901734FF557B3A09C7E760C/esp32_gps_ntp_server.ino.bin"
esptool.py v2.8
Serial port 192.168.1.226
Traceback (most recent call last):
File "C:\Users\Josh\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/upload.py", line 65, in <module>
esptool.main(cmdline)
File "C:/Users/Josh/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\esptool.py", line 2889, in main
esp = chip_class(each_port, initial_baud, args.trace)
File "C:/Users/Josh/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\esptool.py", line 237, in __init__
self._port = serial.serial_for_url(port)
File "C:/Users/Josh/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial\serial\__init__.py", line 88, in serial_for_url
instance.open()
File "C:/Users/Josh/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial\serial\serialwin32.py", line 62, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port '192.168.1.226': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)
Failed uploading: uploading error: exit status 1
That provided me with the information I was looking for.
I am able to reproduce the problem when using the version 2.7.4 of the ESP8266 Arduino boards platform like you are. However, when I use the latest version 3.0.2, OTA uploads work perfectly.
So, unless you have a specific reason you can't update, I will recommend you to update to the latest version of the platform. I'll provide instructions:
Select File > Preferences from the Arduino IDE menus.
Enter the following URL into the "Additional Boards Manager URLs" field (if it is not already present):
This is not that arduino related but may help.. maybe
I got the same error "Could not open port - The system cannot find the file specified" quite recently in visual studio while coding a C# program which communicates with arduinos over the serial port.
I found out it was caused by me having changed the COM port number manually using the device manager. After a reboot I didn't get this anymore but could reproduce it if I manually changed the COM port number again. This is in windows 10 by the way. Could be a bug in how windows handles serial ports.
I have to say that I'm such a newbie that I'm not familiar with using a serial port over the network . But maybe it's related. At least the error message is exactly the same.
Arduino IDE 1.x and 2.x use separate preference stores so you must manually transfer any custom preferences you need such as "Additional Boards Manager URLs" from Arduino IDE 1.x to 2.x.
There is a plan to add a feature in a future release that will allow the IDE to notify the user of any missing URLs:
Unfortunately that didn't get finished before the 2.0.0 release, so for now we will have to spread this knowledge through the Arduino IDE 2.x user community. The IDE still recognizes the boards platforms fine without the index, but the URL is required to get notifications of available updates so it becomes more of a problem as time goes on.
We did discuss it. Most of the settings (e.g., "Interface scale", "Language") are evident just from using the IDE. The only exceptions are "Sketchbook location" and "Additional Boards Manager URLs". Since "Sketchbook location" uses the same default as Arduino IDE 1.x, it is likely most users won't be affected. That leaves "Additional Boards Manager URLs". The plan to make the IDE notify the user about the missing URLs was the result of that discussion.
The work to implement and maintain that feature has ongoing benefits beyond just the migration period because we have seen that users will sometimes not realize that the URLs are needed after the installation is finished and replace the old URL with a new one instead of adding to the list. In Arduino IDE 1.x, the removal of the URL resulted in the previous platform disappearing from the Tools > Board menu, so at least the user had a signal that something went wrong with the platform even if they didn't correlate that with the preference change they made. But with the new resilient system used by Arduino IDE 2.x, there is no indication of an effect of the missing URL other than the missing updates.