Closed majodi closed 5 months ago
I too have this same issue. Using Arduino IDE:
Version: 2.2.1 Date: 2023-08-31T14:26:39.874Z (2 weeks ago) CLI Version: 0.34.0
Preferences: Open Settings (UI)
and press Enter.arduinoAPI.log
into the Search Settings <input>
.Show Output Channel...
and press Enter.Arduino API
and ESP Exception Decoder (Log)
. If you select one of them, the default Output channel in the Arduino IDE changes, and you will see additional logs.Arduino API
output channel and click the Clear Output
toolbar in the Output view to clear the content. Do the same in the ESP Exception Decoder (Log)
channel.
Developer (Arduino): Clear the Board and Port Selection
command. The Arduino IDE will forget your board and port selection in this sketch.Arduino API
output channel, copy the log output, and attach it to this issue.ESP Exception Decoder (Log)
output channel, and share the log messages with me.Developer (Arduino): Dump the Board List
command. The IDE will print a JSON to the Output view and share that output with me.Thank you!
@dankeboy36, The unsetting the board and port option and then re-selecting it has fixed the issue for me.
If somebody can reproduce it, please provide the logs. I will look into the defect. I will keep this issue open.
The fault occurs when the board was selected on IDE startup:
No board selected
" even though a board is in fact selected.I am happy to provide logs, but I think you will be able to easily reproduce the fault now from the instructions I provided @dankeboy36 so they probably won't be needed.
I notice the fault occurs under the same conditions as https://github.com/arduino/arduino-ide/issues/2230#issuecomment-1728823010
Selecting another board and then the right board gave me "Sketch path is not set". Then after opening another sketch, close it and re-open the right sketch finally the exception decoder worked. So it seems that when the IDE is started with an existing project (sketch and board) it will not communicate the board/sketch to your code. I don't know (and don't have time to dive into it) if there is a way to force the IDE API to refresh and give you the current active board/sketch but that's what you need I guess.
This must be fixed in the IDE2 code. The problem is the same as https://github.com/arduino/arduino-ide/pull/2165#pullrequestreview-1568872036 and https://github.com/arduino/arduino-ide/pull/2165#pullrequestreview-1571165467. The Arduino state is set by IDE2 too early, and the board+port settings still need to be restored. Here is the overlooked TODO
in the PR 🤦 This should fix:
diff --git a/arduino-ide-extension/src/browser/contributions/update-arduino-state.ts b/arduino-ide-extension/src/browser/contributions/update-arduino-state.ts
index 35b4c2ab..4e575430 100644
--- a/arduino-ide-extension/src/browser/contributions/update-arduino-state.ts
+++ b/arduino-ide-extension/src/browser/contributions/update-arduino-state.ts
@@ -76,7 +76,9 @@ export class UpdateArduinoState extends SketchContribution {
}
override onReady(): void {
- this.updateBoardsConfig(this.boardsServiceProvider.boardsConfig); // TODO: verify!
+ this.boardsServiceProvider.ready.then(() => {
+ this.updateBoardsConfig(this.boardsServiceProvider.boardsConfig); // TODO: verify!
+ });
this.updateSketchPath(this.sketchServiceClient.tryGetCurrentSketch());
this.updateUserDirPath(this.configService.tryGetSketchDirUri());
this.updateDataDirPath(this.configService.tryGetDataDirUri());
Please use the Arduino IDE 2.x nightly build with the fix: https://www.arduino.cc/en/software#nightly-builds
I get "No board selected" in red.