Skip to content

[grcp] Monitor does not emit applied_settings response after changing the baudrate #2965

@dankeboy36

Description

@dankeboy36

Describe the problem

Hello, I am using the CLI daemon with JS, and after updating the baudrate of the monitor, the client does not receive the corresponding response:

// Settings applied to the port, may be returned after a port is opened (to
// report the default settings) or after a new port_configuration is sent
// (to report the new settings applied).
MonitorPortConfiguration applied_settings = 3;

I had expected to see this response after changing the baudrate, but it never occurred. Is it a bug?

To reproduce

I have had a hard time mimicking this with buf curl, as the command does not pull the message stream, so it never starts. I tried this in a terminal:

buf \
  curl \
    --http2-prior-knowledge \
    --protocol grpc \
    --schema ./rpc \
    http://localhost:50051/cc.arduino.cli.commands.v1.ArduinoCoreService/Create
{
  "instance": {
    "id": 1
  }
}
buf \
  curl \
  --http2-prior-knowledge \
  --protocol grpc \
  --schema ./rpc \
  --data '{"instance": {"id": 1}}' \
  http://localhost:50051/cc.arduino.cli.commands.v1.ArduinoCoreService/Init
buf curl \
  --http2-prior-knowledge \
  --protocol grpc \
  --schema ./rpc \
  --data '{
    "message": {
      "openRequest": {
        "instance": { "id": 1 },
        "fqbn": "esp32:esp32:esp32da",
        "port": {
          "address": "/dev/cu.usbserial-0001",
          "protocol": "serial"
        },
        "portConfiguration": {
          "settings": [
            { "settingId": "baudrate", "value": "115200" }
          ]
        }
      }
    }
  }' \
  http://localhost:50051/cc.arduino.cli.commands.v1.ArduinoCoreService/Monitor

I can provide a public repo with a JS client to reproduce it if it helps, but perhaps the easiest way to verify is that the generated struct is not called from the codebase:

type MonitorResponse_AppliedSettings struct {
// Settings applied to the port, may be returned after a port is opened (to
// report the default settings) or after a new port_configuration is sent
// (to report the new settings applied).
AppliedSettings *MonitorPortConfiguration `protobuf:"bytes,3,opt,name=applied_settings,json=appliedSettings,proto3,oneof"`
}

Expected behavior

The client receives the applied settings response after updating the monitor config.

Pipedream: the applied settings response contains the applied settingIds and the new values.

Arduino CLI version

c41f5df

Operating system

macOS

Operating system version

15.5

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions