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

Fix port flickering #367

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

Windfisch
Copy link
Contributor

Since a couple of versions, the port selection box under linux flickers between "/dev/ttyS0" and "/dev/ttyS0 undefined". Selecting a port is not possible, because on every flickering update (approx twice per second), the menu box is closed and the selection process is interrupted.

This merge request fixes this behavior by correcting the way how the list is filled in.

@Windfisch
Copy link
Contributor Author

Hi, this is my first MR in this project. I am currently evaluating the use of OpenBuilds-CONTROL in our makerspace and am happy to contribute a couple more fixes and (hopefully ;)) improvements. I do understand that your time in maintaining this software is limited and appreciate it, so please tell me if there's anything to cause you less effort in dealing with my MR(s) :)

@rschell
Copy link

rschell commented Sep 5, 2024

Slightly different issue with the port selection box updating, but the same commit works for me.

With 381 master, the log reveals constant updating of the ports until connect is selected (in my case /dev/ttyACM0 is the right one):
[18:08:43] [ 3D Viewer ] WebGL Support found! success: this application will work optimally on this device!
[18:08:43] [ websocket ] Bidirectional Websocket Interface Started Succesfully
[18:08:44] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:44] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:44] [ update ] Checking for Updates
[18:08:44] [ update ] You are already running OpenBuilds CONTROL 1.0.381
[18:08:45] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:45] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:46] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:46] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:47] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:47] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:48] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:48] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:49] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:49] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:50] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:50] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:51] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:51] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:52] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:52] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:53] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:53] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:54] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:54] [ usb ports ] Detected a change in available ports: [/dev/ttyACM0][/dev/ttyS1][/dev/ttyS2][/dev/ttyS3][/dev/ttyS0]
[18:08:54] [ connect ] PORT INFO: Port is now open: /dev/ttyACM0 - Attempting to detect Controller...
[18:08:54] [ connect ] Attempting to detect Controller (1): (Autoreset)
[18:08:54] [ ] ok
....

with the commit applied, I can select connect and I get a more normal startup:
[18:14:56] [ 3D Viewer ] WebGL Support found! success: this application will work optimally on this device!
[18:14:56] [ websocket ] Bidirectional Websocket Interface Started Succesfully
[18:14:57] [ update ] Checking for Updates
[18:14:57] [ update ] You are already running OpenBuilds CONTROL 1.0.381
[18:15:36] [ connect ] PORT INFO: Port is now open: /dev/ttyACM0 - Attempting to detect Controller...
[18:15:36] [ connect ] Attempting to detect Controller (1): (Autoreset)
[18:15:36] [ ] ok
[18:15:36] [ connect ] Attempting to detect Controller (2): (Ctrl+X)
[18:15:36] [ ] GrblHAL 1.1f ['$' or '$HELP' for help]
[18:15:38] [ connect ] Firmware Detected: grblHAL version 1.1f dated on /dev/ttyACM0

@rschell
Copy link

rschell commented Sep 8, 2024

Did a kernel upgrade recently and my /dev/ttyACM0 port didn't get detected. Now there there isn't a way to rescan the ports. Had to disconnect the usb connection and restart to Control software to rediscover to port.

@rschell
Copy link

rschell commented Sep 17, 2024

Slowing PortCheckInterval to 10 seconds helps, but still reports repeated port changes when none have occurred.

@Windfisch
Copy link
Contributor Author

This sounds like you're having problems with the "vanilla" OpenBuilds-CONTROL software, which are fixed using this PR's changes, is that correct?

@rschell
Copy link

rschell commented Sep 17, 2024

Yes, I noticed the flicking as well, but with different symptoms. There may be a better fix, try attached.

Changes:

  • Added a "return ports" to findPorts function
  • populated oldportslist with the return from the first call to findPorts()
  • replaced the duplicated code in findChangedPorts with a call to findPorts()
  • removed the second call to findPorts at the end of findChangedPorts, as it is now performed at the beginning of the routine.

Incorporated as a git commit

@petervanderwalt petervanderwalt mentioned this pull request Sep 30, 2024
@petervanderwalt petervanderwalt merged commit f108631 into OpenBuilds:master Sep 30, 2024
@petervanderwalt
Copy link
Contributor

Thank you, merged into 1.0.381 or later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants