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

#1278 Use FQBN instead of Board for the monitor ID. #1279

Merged
merged 1 commit into from
Aug 3, 2022
Merged

Conversation

kittaakos
Copy link
Contributor

Motivation

To fix the upload functionality in IDE2 when the monitor is running.

Change description

Use fqbn (string | undefined) type instead of the Board | undefined for the monitor ID when notifying MonitorService before/after executing the upload command.

Other information

Closes #1278

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

Closes #1278

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos kittaakos changed the title Use FQBN instead of Board for the monitor ID. #1278 Use FQBN instead of Board for the monitor ID. Aug 3, 2022
@kittaakos kittaakos marked this pull request as ready for review August 3, 2022 07:18
@kittaakos
Copy link
Contributor Author

kittaakos commented Aug 3, 2022

Note that the proposed changes fix the upload when the monitor is running, however, I see such an error in the logs. I did some investigation, and the same error occurred with 2.0.0-rc8 and 2.0.0-rc9.

From the sources [c0c5556]:

monitor-service ERROR Error: 2 UNKNOWN: Port monitor error: command 'open' failed: no such file or directory
    at Object.callErrorFromStatus (/Users/a.kitta/dev/git/arduino-ide/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/Users/a.kitta/dev/git/arduino-ide/node_modules/@grpc/grpc-js/build/src/client.js:409:49)
    at Object.onReceiveStatus (/Users/a.kitta/dev/git/arduino-ide/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:328:181)
    at /Users/a.kitta/dev/git/arduino-ide/node_modules/@grpc/grpc-js/build/src/call-stream.js:187:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

rc-8:

root ERROR Error: 2 UNKNOWN: Port monitor error: command 'open' failed: no such file or directory
    at Object.callErrorFromStatus (/Users/a.kitta/Desktop/rc-8/Arduino IDE.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/Users/a.kitta/Desktop/rc-8/Arduino IDE.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/client.js:409:49)
    at Object.onReceiveStatus (/Users/a.kitta/Desktop/rc-8/Arduino IDE.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:328:181)
    at /Users/a.kitta/Desktop/rc-8/Arduino IDE.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:187:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
root INFO monitor to /dev/cu.usbmodem14301 using serial closed by server

rc-9:

daemon INFO {"command":"QUIT","level":"info","monitor":"serial-monitor","msg":"sending command","time":"2022-08-03T09:17:49+02:00"}

daemon INFO {"level":"error","monitor":"serial-monitor","msg":"stopped decode loop: EOF","time":"2022-08-03T09:17:49+02:00"}

daemon INFO {"level":"info","monitor":"serial-monitor","msg":"Killing monitor process","time":"2022-08-03T09:17:49+02:00"}

daemon INFO {"level":"info","monitor":"serial-monitor","msg":"Monitor process killed","time":"2022-08-03T09:17:49+02:00"}

monitor-service ERROR Error: 2 UNKNOWN: Port monitor error: command 'open' failed: no such file or directory
    at Object.callErrorFromStatus (/Users/a.kitta/Desktop/rc-9/Arduino IDE.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/Users/a.kitta/Desktop/rc-9/Arduino IDE.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/client.js:409:49)
    at Object.onReceiveStatus (/Users/a.kitta/Desktop/rc-9/Arduino IDE.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:328:181)
    at /Users/a.kitta/Desktop/rc-9/Arduino IDE.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:187:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
monitor-service INFO monitor to /dev/cu.usbmodem14301 using serial closed by server
daemon INFO {"level":"info","msg":"from discovery builtin:serial-discovery received message type: add, port: /dev/cu.usbmodem14301","time":"2022-08-03T09:17:50+02:00"}

@francescospissu
Copy link
Contributor

I tested it following the steps reported in #1278:

  1. Connect an Arduino board to your computer.
  2. Select the appropriate board and port in the Arduino IDE.
  3. Open Serial Monitor in the Arduino IDE.
  4. Select Sketch > Upload from the Arduino IDE menus.

Using 2.0.0-rc9.1 I cannot upload the sketch and I get this error:

No upload port found, using address:"COM6" label:"COM6" protocol:"serial" protocol_label:"Serial Port (USB)" as fallback
Failed uploading: uploading error: exit status 1No device found on COM6

With this fix I can upload the sketch on the board correctly.

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes #1278 for me. Thanks Akos!

Regarding the Port monitor error: command 'open' failed: no such file or directory error you mentioned, I am unfortunate in my fortune of not being able to reproduce it on my Windows and Linux machines.

Since you have it even with previous versions, I don't think it is of concern for this specific PR, but would be worth investigating eventually even if only for the sake of seeing whether a potentially confusing spurious error message could be prevented in some way.

@InstantMuffin InstantMuffin mentioned this pull request Aug 3, 2022
4 tasks
@kittaakos kittaakos merged commit d556ee9 into main Aug 3, 2022
@kittaakos kittaakos deleted the #1278 branch August 3, 2022 13:16
@per1234 per1234 mentioned this pull request Aug 3, 2022
3 tasks
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project topic: serial monitor Related to the Serial Monitor labels Aug 3, 2022
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 topic: serial monitor Related to the Serial Monitor type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upload fails when Serial Monitor is open
3 participants