Skip to content
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

No board selected (Please use the nightly IDE 2.x https://www.arduino.cc/en/software#nightly-builds) #10

Closed
majodi opened this issue Sep 19, 2023 · 8 comments
Labels
invalid This doesn't seem right

Comments

@majodi
Copy link

majodi commented Sep 19, 2023

I get "No board selected" in red.
Screenshot 2023-09-19 at 20 17 58

@per1234 per1234 added the bug Something isn't working label Sep 19, 2023
@birdoffire1549
Copy link

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

@dankeboy36
Copy link
Owner

dankeboy36 commented Sep 20, 2023

  • Open the Command Palette with Ctrl/⌘+Shift+P.
  • Type Preferences: Open Settings (UI) and press Enter.
  • Type arduinoAPI.log into the Search Settings <input>.
  • Tick the checkbox next to the preference value.
    arduinoAPI log
  • Open the Command Palette and type Show Output Channel... and press Enter.
  • You will see (at least) two channels: 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.
change_output_channel_in_ide2.mp4
  • Select the 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.
    Screen Shot 2023-09-20 at 15 51 39
  • Unset the board+port selection in the Arduino IDE: open the Command Palette and execute the Developer (Arduino): Clear the Board and Port Selection command. The Arduino IDE will forget your board and port selection in this sketch.
  • Make sure the Exception Decoder terminal is opened.
  • (Re)Select the board and port the usual way you do in the Arduino IDE.
  • Open the Arduino API output channel, copy the log output, and attach it to this issue.
  • Open the ESP Exception Decoder (Log) output channel, and share the log messages with me.
  • Open the Command Palette and execute the 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!

@birdoffire1549
Copy link

@dankeboy36, The unsetting the board and port option and then re-selecting it has fixed the issue for me.

@dankeboy36
Copy link
Owner

If somebody can reproduce it, please provide the logs. I will look into the defect. I will keep this issue open.

@per1234
Copy link
Collaborator

per1234 commented Sep 21, 2023

The fault occurs when the board was selected on IDE startup:

To reproduce

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Select a board from the Arduino IDE menus.
  3. Select File > Save As... from the Arduino IDE menus.
  4. Save the sketch to any convenient name and location.
    This step is performed in order to associate the board selection with a sketch that can be restored on IDE startup.
  5. Select File > Quit from the Arduino IDE menus.
  6. Start Arduino IDE.
    The saved sketches that were open during the previous session will be restored.
  7. Select the window of the sketch you saved during the previous steps.
  8. Run the "ESP Exception Decoder: Show Decoder Terminal" command.
    🐛 The Exception Decoder view shows the message "No board selected" even though a board is in fact selected.
  9. Select any other board from the Arduino IDE menus.
  10. Select the target board once more.
    🙂 The Exception Decoder now recognizes the board selection.

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 arduino/arduino-ide#2230 (comment)

@majodi
Copy link
Author

majodi commented Sep 21, 2023

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.

@kittaakos
Copy link

This must be fixed in the IDE2 code. The problem is the same as arduino/arduino-ide#2165 (review) and arduino/arduino-ide#2165 (review). 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());

kittaakos pushed a commit to arduino/arduino-ide that referenced this issue Sep 21, 2023
If it is set before the board+port settings are restored from the
`localStorage`, extensions will see no board+port.

Ref: #2165
Ref: dankeboy36/esp-exception-decoder#10
Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit to arduino/arduino-ide that referenced this issue Sep 21, 2023
If it is set before the board+port settings are restored from the
`localStorage`, extensions will see no board+port.

Ref: #2165
Ref: dankeboy36/esp-exception-decoder#10

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit to arduino/arduino-ide that referenced this issue Sep 26, 2023
If it is set before the board+port settings are restored from the
`localStorage`, extensions will see no board+port.

Ref: #2165
Ref: dankeboy36/esp-exception-decoder#10

Signed-off-by: Akos Kitta <[email protected]>
@dankeboy36
Copy link
Owner

Please use the Arduino IDE 2.x nightly build with the fix: https://www.arduino.cc/en/software#nightly-builds

@dankeboy36 dankeboy36 changed the title No board selected No board selected (Please use the nightly IDE 2.x https://www.arduino.cc/en/software#nightly-builds) Oct 2, 2023
@dankeboy36 dankeboy36 pinned this issue Oct 2, 2023
@dankeboy36 dankeboy36 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2024
@dankeboy36 dankeboy36 added invalid This doesn't seem right and removed bug Something isn't working labels Feb 8, 2024
@dankeboy36 dankeboy36 unpinned this issue Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

5 participants