Hi ![]()
I need help with the board list watch functionality via gRPC.
If I set the interrupt to true, my client does not receive list watch responses from the daemon, which is good, but the daemon still tracks the board changes. Is this correct? Am I using the preferred way to interrupt the watch?
Board list watch starts, Uno (replica) board is attached/removed/attached/.etc:
3 CALLED: /cc.arduino.cli.commands.v1.ArduinoCoreService/BoardListWatch STREAM_REQ STREAM_RESP
3 | REQ: {
3 | "instance": {
3 | "id": 1
3 | }
3 | }
{"level":"info","msg":"starting discovery builtin:mdns-discovery process","time":"2022-11-12T13:42:36+01:00"}
{"level":"info","msg":"starting discovery builtin:serial-discovery process","time":"2022-11-12T13:42:36+01:00"}
{"level":"info","msg":"started discovery builtin:serial-discovery process","time":"2022-11-12T13:42:36+01:00"}
{"level":"info","msg":"sending command HELLO 1 \"arduino-cli 0.28.0\" to discovery builtin:serial-discovery","time":"2022-11-12T13:42:36+01:00"}
{"level":"info","msg":"started discovery builtin:mdns-discovery process","time":"2022-11-12T13:42:36+01:00"}
{"level":"info","msg":"sending command HELLO 1 \"arduino-cli 0.28.0\" to discovery builtin:mdns-discovery","time":"2022-11-12T13:42:36+01:00"}
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: hello, message: OK, protocol version: 1","time":"2022-11-12T13:42:36+01:00"}
{"level":"info","msg":"sending command START_SYNC to discovery builtin:serial-discovery","time":"2022-11-12T13:42:36+01:00"}
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: start_sync, message: OK","time":"2022-11-12T13:42:36+01:00"}
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: add, port: /dev/cu.Bluetooth-Incoming-Port","time":"2022-11-12T13:42:36+01:00"}
{"level":"info","msg":"from discovery builtin:mdns-discovery received message type: hello, message: OK, protocol version: 1","time":"2022-11-12T13:42:36+01:00"}
{"level":"info","msg":"sending command START_SYNC to discovery builtin:mdns-discovery","time":"2022-11-12T13:42:36+01:00"}
{"level":"info","msg":"from discovery builtin:mdns-discovery received message type: start_sync, message: OK","time":"2022-11-12T13:42:36+01:00"}
3 | RESP: {
3 | "event_type": "add",
3 | "port": {
3 | "port": {
3 | "address": "/dev/cu.Bluetooth-Incoming-Port",
3 | "label": "/dev/cu.Bluetooth-Incoming-Port",
3 | "protocol": "serial",
3 | "protocol_label": "Serial Port"
3 | }
3 | }
3 | }
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: add, port: /dev/cu.usbmodem14101","time":"2022-11-12T13:42:42+01:00"}
3 | RESP: {
3 | "event_type": "add",
3 | "port": {
3 | "matching_boards": [
3 | {
3 | "name": "Arduino Uno",
3 | "fqbn": "arduino:avr:uno"
3 | }
3 | ],
3 | "port": {
3 | "address": "/dev/cu.usbmodem14101",
3 | "label": "/dev/cu.usbmodem14101",
3 | "protocol": "serial",
3 | "protocol_label": "Serial Port (USB)",
3 | "properties": {
3 | "pid": "0x0043",
3 | "serialNumber": "75830303934351618212",
3 | "vid": "0x2341"
3 | }
3 | }
3 | }
3 | }
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: remove, port: /dev/cu.usbmodem14101","time":"2022-11-12T13:42:44+01:00"}
3 | RESP: {
3 | "event_type": "remove",
3 | "port": {
3 | "port": {
3 | "address": "/dev/cu.usbmodem14101",
3 | "protocol": "serial"
3 | }
3 | }
3 | }
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: add, port: /dev/cu.usbmodem14101","time":"2022-11-12T13:42:44+01:00"}
3 | RESP: {
3 | "event_type": "add",
3 | "port": {
3 | "matching_boards": [
3 | {
3 | "name": "Arduino Uno",
3 | "fqbn": "arduino:avr:uno"
3 | }
3 | ],
3 | "port": {
3 | "address": "/dev/cu.usbmodem14101",
3 | "label": "/dev/cu.usbmodem14101",
3 | "protocol": "serial",
3 | "protocol_label": "Serial Port (USB)",
3 | "properties": {
3 | "pid": "0x0043",
3 | "serialNumber": "75830303934351618212",
3 | "vid": "0x2341"
3 | }
3 | }
3 | }
3 | }
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: remove, port: /dev/cu.usbmodem14101","time":"2022-11-12T13:42:46+01:00"}
3 | RESP: {
3 | "event_type": "remove",
3 | "port": {
3 | "port": {
3 | "address": "/dev/cu.usbmodem14101",
3 | "protocol": "serial"
3 | }
3 | }
3 | }
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: add, port: /dev/cu.usbmodem14101","time":"2022-11-12T13:42:47+01:00"}
3 | RESP: {
3 | "event_type": "add",
3 | "port": {
3 | "matching_boards": [
3 | {
3 | "name": "Arduino Uno",
3 | "fqbn": "arduino:avr:uno"
3 | }
3 | ],
3 | "port": {
3 | "address": "/dev/cu.usbmodem14101",
3 | "label": "/dev/cu.usbmodem14101",
3 | "protocol": "serial",
3 | "protocol_label": "Serial Port (USB)",
3 | "properties": {
3 | "pid": "0x0043",
3 | "serialNumber": "75830303934351618212",
3 | "vid": "0x2341"
3 | }
3 | }
3 | }
3 | }
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: remove, port: /dev/cu.usbmodem14101","time":"2022-11-12T13:42:49+01:00"}
3 | RESP: {
3 | "event_type": "remove",
3 | "port": {
3 | "port": {
3 | "address": "/dev/cu.usbmodem14101",
3 | "protocol": "serial"
3 | }
3 | }
3 | }
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: add, port: /dev/cu.usbmodem14101","time":"2022-11-12T13:42:54+01:00"}
3 | RESP: {
3 | "event_type": "add",
3 | "port": {
3 | "matching_boards": [
3 | {
3 | "name": "Arduino Uno",
3 | "fqbn": "arduino:avr:uno"
3 | }
3 | ],
3 | "port": {
3 | "address": "/dev/cu.usbmodem14101",
3 | "label": "/dev/cu.usbmodem14101",
3 | "protocol": "serial",
3 | "protocol_label": "Serial Port (USB)",
3 | "properties": {
3 | "pid": "0x0043",
3 | "serialNumber": "75830303934351618212",
3 | "vid": "0x2341"
3 | }
3 | }
3 | }
3 | }
3 | REQ: {
3 | "instance": {
3 | "id": 1
3 | },
3 | "interrupt": true
3 | }
My code sends an interrupt after 20 sec. It's correctly received.
and
:
{"level":"info","msg":"boards watcher interrupted by client","time":"2022-11-12T13:42:56+01:00"}
3 STREAM CLOSED
The daemon still logs if I plug in and remove the board:
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: remove, port: /dev/cu.usbmodem14101","time":"2022-11-12T13:43:00+01:00"}
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: add, port: /dev/cu.usbmodem14101","time":"2022-11-12T13:43:02+01:00"}
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: remove, port: /dev/cu.usbmodem14101","time":"2022-11-12T13:43:04+01:00"}
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: add, port: /dev/cu.usbmodem14101","time":"2022-11-12T13:43:07+01:00"}
{"level":"info","msg":"from discovery builtin:serial-discovery received message type: remove, port: /dev/cu.usbmodem14101","time":"2022-11-12T13:43:08+01:00"}
If I do not explicitly start the watch, the CLI daemon contains no discovery log items.
Thank you!