Skip to content

The monitor sometimes fails to reconnect to my Nano 33 BLE board after an upload #1966

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

Open
3 tasks done
kittaakos opened this issue Mar 17, 2023 · 0 comments
Open
3 tasks done
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

Comments

@kittaakos
Copy link
Contributor

kittaakos commented Mar 17, 2023

Describe the problem

The monitor sometimes fails to reconnect to my Nano 33 BLE board after an upload.

To reproduce

  • You have a Nano 33 BLE board,
  • Create two new sketches with the following content,
  • Both have this content:
unsigned long previousMillis;

void setup() {
  Serial.begin(9600);
}

void loop() {
  if (Serial.available() > 0) {
    while (Serial.available() > 0) {
      Serial.write(Serial.read());
      delay(10);
    }
  } else if (millis() - previousMillis >= 1000) {
    previousMillis = millis();
    Serial.println("hello");
  }
}
  • Save the sketches,
  • Connect to the Nano 33 BLE board from one of the sketches, upload the sketch, and open the monitor to verify it works.
  • Connect to the Nano 33 BLE board from the other sketch, and open the monitor. Both monitor works.
  • Start uploading the sketch to the board while the monitor runs.
  • If you do it enough times, it fails (on my mac, it takes 4-5 uploads, and I could randomly reproduce IDE remains in uploading state after completion of upload to network port #1356 too)
no_monitor_reconnect_after_upload_nano33ble.mp4

Expected behavior

The monitor can reconnect.

Arduino IDE version

2.0.4

Operating system

macOS

Operating system version

12.6.3

Additional context

Even if both monitors can reconnect after the upload, there is an unhandled error in the logs:

2023-03-20T07:35:59.690Z daemon INFO ERRO[0031] stopped decode loop: EOF                      monitor=serial-monitor

2023-03-20T07:35:59.690Z daemon INFO INFO[0031] Monitor process killed                        monitor=serial-monitor

2023-03-20T07:35:59.691Z monitor-service ERROR Error: 2 UNKNOWN: Port monitor error: command 'open' failed: no such file or directory
    at Object.callErrorFromStatus (/Applications/Arduino IDE 2.0.4.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
    at Object.onReceiveStatus (/Applications/Arduino IDE 2.0.4.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/client.js:413:49)
    at Object.onReceiveStatus (/Applications/Arduino IDE 2.0.4.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:328:181)
    at /Applications/Arduino IDE 2.0.4.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)
for call at
    at ServiceClientImpl.makeBidiStreamRequest (/Applications/Arduino IDE 2.0.4.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/client.js:398:30)
    at ServiceClientImpl.monitor (/Applications/Arduino IDE 2.0.4.app/Contents/Resources/app/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
    at MonitorService.createDuplex (/Applications/Arduino IDE 2.0.4.app/Contents/Resources/app/node_modules/arduino-ide-extension/lib/node/monitor-service.js:155:34)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async startPolling (/Applications/Arduino IDE 2.0.4.app/Contents/Resources/app/node_modules/arduino-ide-extension/lib/node/monitor-service.js:226:39)
2023-03-20T07:35:59.691Z monitor-service INFO monitor to /dev/cu.usbmodem14301 using serial closed by server
2023-03-20T07:36:00.481Z daemon INFO INFO[0032] from discovery builtin:serial-discovery received message type: add, port: /dev/cu.usbmodem14301

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@kittaakos kittaakos 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 Mar 17, 2023
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

No branches or pull requests

1 participant