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

[Feature]: Add disconnect/reconnect function in Arduino library to be able to manually control connection via board #14

Open
CodapopKSP opened this issue Jan 24, 2021 · 6 comments

Comments

@CodapopKSP
Copy link
Contributor

This could function as a 'soft' reset to handle times when the connection has problems. Most boards have the arduino located inside and potentially inaccessible, so pressing the reset button may not be an option.

A simple callable set of functions would be ideal, maybe "mysimpit.connect, mysimpit.disconnect".

@PBechon
Copy link
Collaborator

PBechon commented Jan 25, 2021

What should this do ? This will not reset the whole arduino as the reset button does. If you need an actual Arduino reset, you can use a dedicated button on your controller.

If you want you can unsubscribe all the channel and stop sending messages to KSP. It will remove all the traffic on the serial connection. What should the call to mysimpit.disconnect() do differently ?

On the other end, a call to mysimpit.init() is the function that open the connection. What would be the difference with mysimpit.connect() ?

@LRTNZ LRTNZ transferred this issue from Simpit-team/KerbalSimpitRevamped Jan 26, 2021
@CodapopKSP
Copy link
Contributor Author

Does unsubscribing from every channel also end the serial connection? In the case of my board, the arduino sometimes has to do other things that aren't part of simpit, and sometimes it needs the serial connection to do that. It would be nice to be able to script the start/stop in the arduino code so it can handle the switch between modes automatically.

@PBechon
Copy link
Collaborator

PBechon commented Jan 26, 2021

You can call Serial.end if you need to close the connection.

@CodapopKSP
Copy link
Contributor Author

That doesn't appear to allow the arduino to reconnect again, and a reset is neccesary either way.

@LRTNZ
Copy link
Collaborator

LRTNZ commented Oct 27, 2021

Do you still need this?

@LRTNZ
Copy link
Collaborator

LRTNZ commented Oct 27, 2021

In fact... give me an hour....

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

No branches or pull requests

3 participants