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

WiFi provisioning and serial fixes #590

Merged
merged 21 commits into from
Mar 31, 2023
Merged

WiFi provisioning and serial fixes #590

merged 21 commits into from
Mar 31, 2023

Conversation

Eirenliel
Copy link
Member

@Eirenliel Eirenliel commented Feb 15, 2023

This PR does:

  • Logs serial to console so it can be checked on any screen via debug window
  • Add more explicit reporting of serial events and errors to console for debugging
  • Tires to reuse serial port if it was already open but some new code tries to re-open it with triggering all required events
  • Adds pause before opening serial port in case it was closed and opened too fast which may cause it be unresponsive
  • WiFi provisioning re-tries opening serial port if it wasn't open

Some stuff is a bit broken:

  • When wifi provisioning GUI is open, it starts flooding with requests to open serial more and more and more and faster (not relevant since the port is reused, but the GUI code needs to be investigated)
  • Looks like WiFi popup doesn't close the serial port after it's opened or something like tha t(not relevant since the port is reused, but the GUI code needs to be investigated)
  • I broke Serial console
  • Needs code cleanup

@ButterscotchV ButterscotchV added Area: Hardware Protocol Related to communication with hardware/software trackers Type: Enhancement Adds or improves a feature Area: Server Related to the server labels Feb 15, 2023
@Eirenliel Eirenliel changed the title Provisioning fix attempt WiFi provisioning and serial fixes Feb 16, 2023
@ImUrX ImUrX marked this pull request as ready for review March 15, 2023 15:56
@ImUrX
Copy link
Member

ImUrX commented Mar 15, 2023

this all works now btw lmao

Copy link
Member

@Erimelowo Erimelowo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GUI constantly crashes (and reloads) whenever I click a button in the serial console (maybe due to the fact that I don't have a tracker connected... missing null check?)

server/src/main/java/dev/slimevr/serial/SerialHandler.java Outdated Show resolved Hide resolved
server/src/main/java/dev/slimevr/serial/SerialHandler.java Outdated Show resolved Hide resolved
server/src/main/java/dev/slimevr/serial/SerialHandler.java Outdated Show resolved Hide resolved
server/src/main/java/dev/slimevr/serial/SerialHandler.java Outdated Show resolved Hide resolved
server/src/main/java/dev/slimevr/serial/SerialHandler.java Outdated Show resolved Hide resolved
server/src/main/java/dev/slimevr/serial/SerialHandler.java Outdated Show resolved Hide resolved
server/src/main/java/dev/slimevr/serial/SerialHandler.java Outdated Show resolved Hide resolved
server/src/main/java/dev/slimevr/serial/SerialHandler.java Outdated Show resolved Hide resolved
Copy link
Member

@Erimelowo Erimelowo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dismissing since it also crashes in 0.6.3, so the crashing is unrelated to the PR

@Erimelowo Erimelowo dismissed their stale review March 28, 2023 03:31

dismissing since it also crashes in 0.6.3, so the crashing is unrelated to the PR

Copy link
Member

@Erimelowo Erimelowo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested successfully by Zrock and dq

server/src/main/java/dev/slimevr/serial/SerialHandler.java Outdated Show resolved Hide resolved
server/src/main/java/dev/slimevr/serial/SerialHandler.java Outdated Show resolved Hide resolved
LogManager.severe("Using serial ports is not supported on this platform", e);
LogManager
.severe("[SerialHandler] Using serial ports is not supported on this platform", e);
throw new RuntimeException("Serial unsupported");
Copy link
Member

@ButterscotchV ButterscotchV Mar 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we getting rid of the original exception? I don't think it's even safe to do this anyways, as it crashes the server when it's unsupported. If this is being caught somewhere else, can I be pointed to it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's executed in the TimerTask, I think it will just crash and stop the timer? I might be wrong, I didn't check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the following tasks scheduled in the timer wont run because background thread is dead

@Eirenliel Eirenliel merged commit c27b66f into main Mar 31, 2023
@Eirenliel Eirenliel deleted the provisioning-fix branch March 31, 2023 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Hardware Protocol Related to communication with hardware/software trackers Area: Server Related to the server Type: Enhancement Adds or improves a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants