OpenBuilds / OpenBuilds-CONTROL

OpenBuilds CONTROL: Download from https://software.openbuilds.com
https://software.openbuilds.com
GNU General Public License v3.0
173 stars 108 forks source link

Fix port flickering #367

Closed Windfisch closed 1 month ago

Windfisch commented 2 months ago

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 commented 2 months ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

Windfisch commented 1 month ago

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 commented 1 month ago

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

Changes:

Incorporated as a git commit

petervanderwalt commented 1 month ago

Thank you, merged into 1.0.381 or later