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

Intermittent failure to recognize ports #573

Closed
per1234 opened this issue Oct 23, 2021 · 10 comments · Fixed by #1545
Closed

Intermittent failure to recognize ports #573

per1234 opened this issue Oct 23, 2021 · 10 comments · Fixed by #1545
Assignees
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Oct 23, 2021

Describe the bug

From time to time, the IDE exhibits the follow symptoms when I open it:

  • No ports are shown under the IDE's board/port menu
  • The "Select Board" dialog (accessed via "Select Other Board & Port") shows "NO PORTS DISCOVERED"
  • The Tools > Port menu is missing

However there are multiple detectable Arduino boards and generic serial ports on my computer and other times when I start the IDE the ports are detected just as expected.

To Reproduce

  1. Start Arduino IDE
  2. Check if ports are listed. If so, then exit IDE and start again at step 1.

Command line looks like this when the issue occurs:

Click to expand
daemon INFO starting discovery builtin:serial-discovery process
daemon INFO starting discovery builtin:mdns-discovery process
daemon INFO started discovery builtin:serial-discovery process
daemon INFO sending command HELLO 1 "arduino-cli 0.19.1" to discovery builtin:serial-discovery
daemon INFO started discovery builtin:mdns-discovery process
daemon INFO sending command HELLO 1 "arduino-cli 0.19.1" to discovery builtin:mdns-discovery
daemon INFO from discovery builtin:serial-discovery received message type: hello, message: OK, protocol version: 1
daemon INFO from discovery builtin:mdns-discovery received message type: hello, message: OK, protocol version: 1
daemon INFO sending command START_SYNC to discovery builtin:serial-discovery
daemon INFO sending command START_SYNC to discovery builtin:mdns-discovery
daemon INFO from discovery builtin:mdns-discovery received message type: start_sync, message: OK
daemon INFO from discovery builtin:serial-discovery received message type: start_sync, message: OK
daemon INFO from discovery builtin:serial-discovery received message type: add, port: COM3
daemon INFO from discovery builtin:serial-discovery received message type: add, port: COM255
daemon INFO from discovery builtin:serial-discovery received message type: add, port: COM1
daemon INFO from discovery builtin:serial-discovery received message type: add, port: COM7
daemon INFO from discovery builtin:serial-discovery received message type: add, port: COM6
daemon INFO from discovery builtin:serial-discovery received message type: add, port: COM254
root WARN Frontend EditorNavigationContribution.onStart is slow, took: 6466.7 ms
root WARN Frontend WorkspaceService.onStart is slow, took: 175.1 ms
root INFO Changed application state from 'init' to 'started_contributions'.
root INFO Changed application state from 'started_contributions' to 'attached_shell'.
root INFO >>> Restoring the layout state...
root INFO [hosted-plugin: 6156] PLUGIN_HOST(6156) starting instance
root INFO [8115205c-c018-490d-b338-36be2ff33303] Sync of 5 plugins took: 512.1 ms
root ERROR Could not restore layout
root INFO Changed application state from 'attached_shell' to 'initialized_layout'.
root INFO [8115205c-c018-490d-b338-36be2ff33303][marus25.cortex-debug]: Loaded contributions.
root INFO [8115205c-c018-490d-b338-36be2ff33303][arduino.vscode-arduino-tools]: Loaded contributions.
root INFO [8115205c-c018-490d-b338-36be2ff33303][vscode.cpp]: Loaded contributions.
root INFO [8115205c-c018-490d-b338-36be2ff33303][vscode.json]: Loaded contributions.
root INFO [8115205c-c018-490d-b338-36be2ff33303][vscode.json-language-features]: Loaded contributions.
root INFO [8115205c-c018-490d-b338-36be2ff33303] Load contributions of 5 plugins took: 145.0 ms
root WARN Frontend EditorPreviewTreeDecorator.onDidInitializeLayout is slow, took: 146.0 ms
root WARN 'cpp' language is remapped from 'source.cpp.embedded.macro' to 'source.cpp' scope
root WARN a registered grammar configuration for 'cpp' language is overridden
root INFO [hosted-plugin: 6156] PLUGIN_HOST(6156): PluginManagerExtImpl/init()
root INFO [hosted-plugin: 6156] PLUGIN_HOST(6156): initializing([email protected] with C:\ide 2\arduino-ide_2.0.0-beta.11-snapshot.846c22c_Windows_64bit\resources\app\node_modules\@theia\plugin-ext-vscode\lib\node\plugin-vscode-init)
root INFO [hosted-plugin: 6156] Debugger contribution has been registered: cortex-debug
root INFO [hosted-plugin: 6156] PLUGIN_HOST(6156): initializing([email protected] with C:\ide 2\arduino-ide_2.0.0-beta.11-snapshot.846c22c_Windows_64bit\resources\app\node_modules\@theia\plugin-ext-vscode\lib\node\plugin-vscode-init)
root INFO [hosted-plugin: 6156] PLUGIN_HOST(6156): initializing([email protected] with C:\ide 2\arduino-ide_2.0.0-beta.11-snapshot.846c22c_Windows_64bit\resources\app\node_modules\@theia\plugin-ext-vscode\lib\node\plugin-vscode-init)
root INFO [hosted-plugin: 6156] PLUGIN_HOST(6156): initializing([email protected] with C:\ide 2\arduino-ide_2.0.0-beta.11-snapshot.846c22c_Windows_64bit\resources\app\node_modules\@theia\plugin-ext-vscode\lib\node\plugin-vscode-init)
root INFO [hosted-plugin: 6156] PLUGIN_HOST(6156): initializing([email protected] with C:\ide 2\arduino-ide_2.0.0-beta.11-snapshot.846c22c_Windows_64bit\resources\app\node_modules\@theia\plugin-ext-vscode\lib\node\plugin-vscode-init)
root INFO [hosted-plugin: 6156] PLUGIN_HOST(6156): PluginManagerExtImpl/loadPlugin(C:\ide 2\arduino-ide_2.0.0-beta.11-snapshot.846c22c_Windows_64bit\resources\app\plugins\vscode-builtin-json-language-features\extension\client\dist\jsonMain)
root INFO [hosted-plugin: 6156] PLUGIN_HOST(6156): PluginManagerExtImpl/loadPlugin(C:\ide 2\arduino-ide_2.0.0-beta.11-snapshot.846c22c_Windows_64bit\resources\app\plugins\vscode-arduino-tools\extension\dist\bundle)
root INFO Changed application state from 'initialized_layout' to 'ready'.
root INFO [8115205c-c018-490d-b338-36be2ff33303][marus25.cortex-debug]: Started plugin.
root INFO [8115205c-c018-490d-b338-36be2ff33303][arduino.vscode-arduino-tools]: Started plugin.
root INFO [8115205c-c018-490d-b338-36be2ff33303][vscode.cpp]: Started plugin.
root INFO [8115205c-c018-490d-b338-36be2ff33303][vscode.json]: Started plugin.
root INFO [8115205c-c018-490d-b338-36be2ff33303][vscode.json-language-features]: Started plugin.
root INFO [8115205c-c018-490d-b338-36be2ff33303] Start of 5 plugins took: 914.5 ms

(note that the ports were discovered even though not shown in the IDE)

Command line looks like this when the issue does not occur:

Click to expand
daemon INFO starting discovery builtin:serial-discovery process
daemon INFO starting discovery builtin:mdns-discovery process
daemon INFO started discovery builtin:serial-discovery process
daemon INFO sending command HELLO 1 "arduino-cli 0.19.1" to discovery builtin:serial-discovery
daemon INFO started discovery builtin:mdns-discovery process
daemon INFO sending command HELLO 1 "arduino-cli 0.19.1" to discovery builtin:mdns-discovery
daemon INFO from discovery builtin:serial-discovery received message type: hello, message: OK, protocol version: 1
daemon INFO from discovery builtin:mdns-discovery received message type: hello, message: OK, protocol version: 1
daemon INFO sending command START_SYNC to discovery builtin:serial-discovery
daemon INFO sending command START_SYNC to discovery builtin:mdns-discovery
daemon INFO from discovery builtin:mdns-discovery received message type: start_sync, message: OK
daemon INFO from discovery builtin:serial-discovery received message type: start_sync, message: OK
daemon INFO from discovery builtin:serial-discovery received message type: add, port: COM3
daemon INFO from discovery builtin:serial-discovery received message type: add, port: COM255
daemon INFO from discovery builtin:serial-discovery received message type: add, port: COM1
daemon INFO from discovery builtin:serial-discovery received message type: add, port: COM14
daemon INFO from discovery builtin:serial-discovery received message type: add, port: COM7
daemon INFO from discovery builtin:serial-discovery received message type: add, port: COM254
root WARN Frontend EditorNavigationContribution.onStart is slow, took: 5815.9 ms
root WARN Frontend WorkspaceService.onStart is slow, took: 180.9 ms
root INFO Changed application state from 'init' to 'started_contributions'.
root INFO Changed application state from 'started_contributions' to 'attached_shell'.
root INFO >>> Restoring the layout state...
root INFO [hosted-plugin: 12360] PLUGIN_HOST(12360) starting instance
root INFO Attached boards and available ports changed:
root INFO  - New port is available on COM255
root INFO ------------------------------------------
root INFO [3d74c3ec-e34f-45d3-9f3b-f98baa68c6de] Sync of 5 plugins took: 582.2 ms
root INFO Attached boards and available ports changed:
root INFO  - New port is available on COM1
root INFO ------------------------------------------
root ERROR Could not restore layout
root INFO Attached boards and available ports changed:
root INFO  - Attached board: Arduino MKR WiFi 1010 [arduino:samd:mkrwifi1010] on COM14
root INFO ------------------------------------------
root INFO Attached boards and available ports changed:
root INFO  - Attached board: Arduino Mega or Mega 2560 [arduino:avr:mega] on COM7
root INFO ------------------------------------------
root INFO Changed application state from 'attached_shell' to 'initialized_layout'.
root INFO [3d74c3ec-e34f-45d3-9f3b-f98baa68c6de][marus25.cortex-debug]: Loaded contributions.

Expected behavior

All connected ports and boards are always shown in the IDE.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: 2.0.0-beta.11-snapshot.846c22c
    Date: 2021-10-06T15:50:55.015Z
    CLI Version: 0.19.1 alpha [718bbbf2]

Additional context

Possibly related:

Unfortunately, the issue occurs intermittently (maybe once every 10 open/close cycles) and I have not been able to identify any pattern to its occurrence. I have not noticed any correlation with

I have never had this problem with the Java IDE, even when I check it at the same time IDE2 is failing.

image.png

Thanks to a tip from @RudolfAtHome, I learned that new ports are still discovered when the IDE is in this condition, including previously unrecognized ports after disconnecting and then reconnecting the board.

@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Oct 23, 2021
@per1234
Copy link
Contributor Author

per1234 commented Nov 30, 2021

This is fixed for me by builtin:[email protected], which is now in use by the nightly build of Arduino IDE 2.x.

These are the relevant changes:

@per1234 per1234 closed this as completed Nov 30, 2021
@per1234 per1234 added the conclusion: resolved Issue was resolved label Nov 30, 2021
@jegjessing
Copy link

I just downloaded version 2.0 RC7
I normally work with 1.8 but wanted to give 2.0 a try.

No matter what I select as board I still get no ports discovered. Since it works for 1.8 i suspect there is a bug in 2.0?

@per1234
Copy link
Contributor Author

per1234 commented Jun 15, 2022

Hi @jegjessing. Please try this:

  1. Select File > Quit from the Arduino IDE menus.
  2. Start the Arduino IDE.

Are the ports discovered after restarting the Arduino IDE? I have been noticing this problem lately, but it is always fixed for me after restarting the IDE.

@jegjessing
Copy link

jegjessing commented Jun 16, 2022 via email

@kittaakos
Copy link
Contributor

It often happens on my Windows notebook when one of the boards is the Portenta H7. I reopen the issue.

@kittaakos kittaakos reopened this Jun 16, 2022
@kittaakos kittaakos assigned kittaakos and unassigned fstasi and AlbyIanna Jun 16, 2022
@kittaakos kittaakos removed the conclusion: resolved Issue was resolved label Jun 16, 2022
@xxx
Copy link

xxx commented Jul 9, 2022

Seeing this exact behavior on Linux. Restarting does not help. I'm already in the dialout group, etc. The board is recognized by the system USB driver. It's just the IDE that doesn't see the port, at all.

@jayrabe
Copy link

jayrabe commented Sep 20, 2022

Is this still open? Any clues? I'm using IDE 2.0.0 and have also tried nightly build 20220920 and have the same problem: IDE starts, edits, works up to uploading, then gives "no upload port provided" error. No ports listed in IDE > Tools.
$ lsusb detects the board, but IDE "Select other board and port" dropdown says No ports discovered. Not fixed by restarting IDE, unplugging/reconnecting arduino, using different cords, etc.
Using Linux Mint 21

@jayrabe
Copy link

jayrabe commented Sep 20, 2022

Here's some more info that is above my paygrade to understand, except it seems that when I plug in a board, it is at first recognized by serial-discovery, but then immediately told to remove the port.

I start the 20220920 nightly build IDE with terminal command ./arduino-ide, with no arduino board plugged in.
I plug in a board, and these lines are added to the terminal:

-----
daemon INFO {"level":"info","msg":"from discovery builtin:serial-discovery received message type: add, port: /dev/ttyUSB0","time":"2022-09-20T12:36:36-07:00"}

daemon INFO {"level":"info","msg":"from discovery builtin:serial-discovery received message type: add, port: /dev/ttyUSB0","time":"2022-09-20T12:36:36-07:00"}

discovery-log INFO {"eventType":"add","port":{"matchingBoardsList":[],"port":{"address":"/dev/ttyUSB0","label":"/dev/ttyUSB0","protocol":"serial","protocolLabel":"Serial Port (USB)","propertiesMap":[["pid","0x7523"],["serialNumber",""],["vid","0x1a86"]]}},"error":""}
root INFO Attached boards and available ports changed:
root INFO  - New port is available on /dev/ttyUSB0 Serial Port (USB)
root INFO ------------------------------------------
daemon INFO {"level":"info","msg":"from discovery builtin:serial-discovery received message type: remove, port: /dev/ttyUSB0","time":"2022-09-20T12:36:37-07:00"}
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: remove, port: /dev/ttyUSB0","time":"2022-09-20T12:36:37-07:00"}

discovery-log INFO {"eventType":"remove","port":{"matchingBoardsList":[],"port":{"address":"/dev/ttyUSB0","label":"","protocol":"serial","protocolLabel":"","propertiesMap":[]}},"error":""}
root INFO Attached boards and available ports changed:
root INFO  - Port is no longer available on /dev/ttyUSB0 Serial Port (USB)
root INFO ------------------------------------------

-----

@per1234
Copy link
Contributor Author

per1234 commented Sep 21, 2022

Hi @jayrabe. I see you also posted about this problem over on the Arduino forum:

https://forum.arduino.cc/t/arduino-ide-2-0-not-showing-ports/858267/8

We can use that forum thread for the purposes of investigating and supporting your problem.

@jayrabe
Copy link

jayrabe commented Sep 21, 2022

Very good. Thanks.

kittaakos pushed a commit that referenced this issue Oct 7, 2022
If the board select dialog is listening on the backend's event,
the frontend might miss the event when it comes up, although boards
are connected and ports are discovered.

Closes #573

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Oct 17, 2022
If the board select dialog is listening on the backend's event,
the frontend might miss the event when it comes up, although boards
are connected and ports are discovered.

Closes #573

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Oct 17, 2022
If the board select dialog is listening on the backend's event,
the frontend might miss the event when it comes up, although boards
are connected and ports are discovered.

Closes #573

Signed-off-by: Akos Kitta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants