2.0 on Mac Saving sketch:
"Save As." Works as expected except renaming file makes an identical sketch but the chosen board and chosen serial port is not saved with the sketch. (I think this always worked on 1.x versions)
I got curious about what you reported and was checking it. IDE 2.0 RC9.1 appears to treat SaveAs like a new file, with no board specified. However, once you set a board, it remembers that, and when you reopen your project it will be automatically set to that board.
IDK if that is a good or bad thing, because someone doing a SaveAs might be wanting to make some mods for a different board type, for which not having it preset would be desirable.
The board/port must be saved somewhere other than the project itself, because nothing in the folder changes once you set it.
Hi @andrewashe . The Arduino IDE developers are tracking this issue here:
opened 06:56AM - 02 Dec 21 UTC
topic: code
type: imperfection
### Describe the problem
🐛 After doing a "**File > Save As...**" operation, t… he board selection changes back to whichever one happened to be selected when the sketch was opened.
### To reproduce
1. Select **File > New** from the Arduino IDE menus.
1. Take note of which board is selected.
1. Select a different board.
1. Select **File > Save As...** from the Arduino IDE menus.
1. Save the sketch.
🐛 The selected board is now the one that was selected when the window was first opened (which could even be "No board selected"), not the one that was selected immediately before performing the "**Save As...** operation.
I think this could be very confusing to the user who doesn't notice the change and then wonders why compilation or uploads no longer work (or even the bricking of their board in certain cases).
### Expected behavior
Board selection is preserved through "**Save As...** operations.
### Arduino IDE version
#### Initial report
2.0.0-rc1-snapshot.f0d9894
#### Last checked with
2.0.0-rc9.2-snapshot-989300f
### Operating system
Windows
### Operating system version
10
### Additional context
Reported at https://forum.arduino.cc/t/file-menu-save-as-fails-to-save-chosen-board/1022454
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://github.com/arduino/arduino-ide#nightly-builds)
- [X] My report contains all necessary details
There is a related proposal here about using a more reliable approach to board and port selection similar to how Arduino IDE 1.x does it:
opened 08:20AM - 12 Aug 22 UTC
closed 12:42PM - 18 Aug 23 UTC
type: enhancement
conclusion: resolved
topic: code
### Describe the request
Emulate the tried and true reliable behavior of Ardu… ino IDE 1.x regarding board and port selection.
- Always use the board the user selected.
- Always use the custom board options the user selected.
- Always use the port the user selected. **\***
🙂 Users will not be subjected to confusion or frustration caused by the IDE automatically selecting an incorrect board and port
🙂 Removal of this highly complex system will make the Arduino IDE 2.x code base easier to maintain and develop
**\*** There is one exception to this rule: when uploading to a board that has native USB capabilities, the CDC serial port of the board enumerates at the start and end of the upload. Most often, the port will have the same name at the end of the upload as at the start, but it is possible that the operating system will assign it a different name, and that final port should be selected in the IDE after the completion of the upload. Arduino CLI already handles the port switch at the start of the upload, so it should also be responsible for determining the port name at the completion of the upload and providing Arduino IDE with that information (https://github.com/arduino/arduino-cli/issues/2245).
### Describe the current behavior
Arduino IDE 2.x attempts to automatically select the appropriate board and port for the user.
The concept is certainly commendable, and when it works correctly it is convenient. However, when it does not work correctly, it can cause confusion to less experienced users who won't notice that the automatic board or port selection is incorrect, or frustration to users who do notice and must fight the automated system to attain the correct selection.
Examples of problems:
- https://github.com/arduino/arduino-ide/issues/2143
- https://github.com/arduino/arduino-ide/issues/1648
- https://github.com/arduino/arduino-ide/issues/1366
- https://github.com/arduino/arduino-ide/issues/710
- https://github.com/arduino/arduino-ide/issues/657
- https://github.com/arduino/arduino-ide/issues/287
- https://github.com/arduino/arduino-ide/issues/82
- https://github.com/arduino/arduino-ide/issues/43
- https://forum.arduino.cc/t/arduino-ide-2-esp32-s3-forgets-port/1129591
- https://forum.arduino.cc/t/what-is-2-2-dfu-arduino-ide-2-1-1/1151632/4
- https://forum.arduino.cc/t/serial-monitor-connection-breaks-on-each-upload/1151650
- https://forum.arduino.cc/t/nano-esp32-ide2-keeps-using-dfu-port-which-doesnt-work/1154858
This is not a matter of a regression of a system that worked at one time, but rather an highly complex system that never worked correctly from the start of the 3 year development of the code base. So there is no reason to think it can be fixed as a simple bug.
### Arduino IDE version
2.0.0-rc9.2
### Operating system
All
### Issue checklist
- [X] I searched for previous requests in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the feature was still missing when using the latest [nightly build](https://github.com/arduino/arduino-ide#nightly-builds)
- [X] My request contains all necessary details
It isn't that it is not preset, it is that it reverts to whichever board you had selected when you started the IDE that session. That might be "No board selected", but it could also be any other random board associated with the sketch the IDE opens with.
I believe it is somewhere under this "user data" folder because the board and port association is lost if I delete it. The IDE then has "no board selected" when the sketch is opened:
Windows
%APPDATA%\arduino-ide\
(e.g., C:\Users\<user name>\AppData\Roaming\arduino-ide\
)
Linux
~/.config/arduino-ide/
macOS
~/Library/Application Support/arduino-ide/
system
Closed
February 12, 2023, 9:58pm
4
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.