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

TCPSerial autoReconnect feature mix the ip and port previously entered with last TCP_host and TCP_port saved in Settings #3307

Closed
Godeffroy opened this issue Mar 8, 2024 · 1 comment

Comments

@Godeffroy
Copy link
Contributor

Issue details

I use the SerialOutput NMEA (NMEA) and the Moving Base (MB), each one with TCP Client but different ip and port
At first, i open NMEA connection, i select TCPClient, i enter IP and Port for NMEA and it connect successfully
Then i open and MB connection, i select TCPClient, enter IP and Port for MB and it connect successfully

When the SerialOutput NMEA is disconnected somehow, it use autoReconnect feature and the IP and Port saved in Settings (so the last one written in it, MB in my case) instead of the previous IP and port entered when connecting.

Could we instead save the ip and port localy, not in the Settings and use them to reconnect ?
Or can we save them in the Settings but with different names for different function ? e.g. MovingBase_Tcp_host, SerialOutputNMEA_TCP_host, etc ... ?

Version

Mission Planner 1.3.80

Platform

[ X ] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Sub

Logs

Connecting to NMEA :
image

Connecting to Moving Base :
image

Log in the console :
image

@Godeffroy
Copy link
Contributor Author

Another solution would be to use "ConfigRef" like in CommsUdpSerial.cs to save TCP_port and TCP_host in Settings with a name on it, and call it back when needed.

In CommsUdpSerial.cs ;

            dest = OnSettings("UDP_port" + ConfigRef, dest);

            if (inputboxreturn.Cancel == OnInputBoxShow("Listern Port",
                    "Enter Local port (ensure remote end is already sending)", ref dest)) return;
            Port = dest;

            OnSettings("UDP_port" + ConfigRef, Port, true);

Usage like this :

MainV2.comPort.MirrorStream = new UdpSerial()
{ ConfigRef = "SerialOutputPassUDP", Port = port.ToString() };

Godeffroy added a commit to Godeffroy/MissionPlanner that referenced this issue Mar 19, 2024
Add ConfigRef in TCPSerial to save port and host to Settings with custom name
After port is closed, we do not autoReconnect
Godeffroy added a commit to Godeffroy/MissionPlanner that referenced this issue Mar 19, 2024
Add ConfigRef in TCPSerial to save port and host to Settings with custom name
After port is closed, we do not autoReconnect
Godeffroy added a commit to Godeffroy/MissionPlanner that referenced this issue Mar 19, 2024
Add ConfigRef in TCPSerial to save port and host to Settings with custom name
After port is closed, we do not autoReconnect
Godeffroy added a commit to Godeffroy/MissionPlanner that referenced this issue Mar 19, 2024
Add ConfigRef in TCPSerial to save port and host to Settings with custom name
After port is closed, we do not autoReconnect
@meee1 meee1 closed this as completed in 2e282c1 Mar 20, 2024
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

1 participant