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

Agent does not properly update 'IsOpen' Port State #936

Closed
3 tasks done
montymxb opened this issue Apr 12, 2024 · 2 comments · Fixed by #939
Closed
3 tasks done

Agent does not properly update 'IsOpen' Port State #936

montymxb opened this issue Apr 12, 2024 · 2 comments · Fixed by #939
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@montymxb
Copy link

montymxb commented Apr 12, 2024

Describe the problem

The current version of the agent does not appear to update the IsOpen state of serial ports. This is set to false by default on adding a new port, but does not appear to be updated when a port is opened, or closed.

This is evident with the latest arduino-create-agent-js-client, which checks this value to determine whether or not to actively close the serial port before attempting to upload a new program via serial. Since this is always false, opening the monitor first effectively prevents the client from uploading anything, as it just skips the close step.

The check is handled inside the method that handles closing the monitor, so invoking it directly also has no effect. The user either has to close all ports forcibly, or directly issue a command to the agent.

To reproduce

  1. Download the latest agent
  2. Connect a board (probably flashed with a program that opens up the serial)
  3. Open the 'Debug Console' in the drop-down for the agent
  4. Run list & observe the 'IsOpen' property is false
  5. Open the serial port using the appropriate args: ex. open /dev/MyDeviceXYZ 9600 timed
  6. List again, and observe IsOpen is still false

Expected behavior

As far as I understand (based on the behavior of the JS sdk) opening the serial port to a board should mark the IsOpen property as true, and closing it should mark it as false.

I presume such updates could be performed in https://github.com/arduino/arduino-create-agent/blob/main/serialport.go#L270, and https://github.com/arduino/arduino-create-agent/blob/main/serialport.go#L349, using the current serialPorts.

Arduino Create Agent version

1.4

Operating system

macOS

Operating system version

14.4

Browser

Chrome, Firefox

Browser version

respecitvely 123.0.6312.124, 124.0.2

Additional context

arm64 setup

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details
@montymxb montymxb added the type: imperfection Perceived defect in any part of project label Apr 12, 2024
@cmaglie cmaglie linked a pull request Apr 16, 2024 that will close this issue
2 tasks
@cmaglie cmaglie added the conclusion: resolved Issue was resolved label Apr 16, 2024
@per1234 per1234 added the topic: code Related to content of the project itself label Apr 17, 2024
@montymxb
Copy link
Author

Hi all, thanks for resolving this quickly. @Xayton @cmaglie any news on when we can expect a patch release to be made available for this?

@Xayton
Copy link
Contributor

Xayton commented Apr 30, 2024

Hello @montymxb, we plan to integrate an additional fix, related to the recent "board discovery" changes, and then release the 1.4.1 version. This is expected before the end of the current week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved 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.

4 participants