Output NMEA to more than one COM port?

General discussions

Moderators: Uros, Tom, OXO

Post Reply
adsayer
Posts: 13
Joined: Tue Jan 28, 2020 6:27 pm

Output NMEA to more than one COM port?

Post by adsayer » Mon Jan 20, 2025 11:24 am

Hi all,

Just wondering if there is a method either within Condor or externally to output the NMEA data to two COM ports simultaneously?

For background, I'd like XCSoar on my phone to receive NMEA data (via VSP over WiFi) and my LX8080 via a wired RS232 link.
Both work individually.

Thanks

cbrunschen
Posts: 122
Joined: Mon Dec 09, 2019 2:48 pm
Location: London, UK
Contact:

Re: Output NMEA to more than one COM port?

Post by cbrunschen » Mon Jan 20, 2025 12:25 pm

Condor currently only outputs to a single com port.

However, there is software that can read input from one virtual com port and make it available on another or distribute further. For example there's the com0com project, which includes hub4com which does just that sort of re-distribution.

A signed version of com0com version 3.0.0 can be downloaded from here.

eRock
Posts: 95
Joined: Wed May 30, 2012 11:15 pm
Location: BlueMountains SYD AU

Re: Output NMEA to more than one COM port?

Post by eRock » Mon Jan 20, 2025 1:48 pm

I've tested hardware solution before..
https://www.condorsoaring.com/forums/vi ... 14&t=20020
Image

adsayer
Posts: 13
Joined: Tue Jan 28, 2020 6:27 pm

Re: Output NMEA to more than one COM port?

Post by adsayer » Mon Jan 20, 2025 3:57 pm

Thank you to the both of you for the suggestions!

Very helpful!

adsayer
Posts: 13
Joined: Tue Jan 28, 2020 6:27 pm

Re: Output NMEA to more than one COM port?

Post by adsayer » Thu Jan 23, 2025 9:03 pm

Just an update, for anyone else that requires an output to more than one COM port, here's what I did using cbrunschen's software recommendation (please note I'm an idiot and had to do a fair bit of trial and error, so there may be a more efficient way):

In my example I have the following:
  • A computer with Condor 3
  • A physical connection to an LX8080 - data is transferred via a 9-pin Serial (RS232) to the 5-pin Binder on the LX. You need to enter the password 55556 to get the LX into Sim Mode and accept RS232 data from the Binder connector. Set the Baud Rate to 4800
  • XCSoar on my Android phone - data will be transferred via the local WiFi (ethernet) , you need to find the IP address that the phone uses to connect to your WiFi, in my case this is 192.168.10.130
You need to download com0com and the hub4com (which contains tcp2com) software.

The computer will create a COM port for the actual physical output, but you will need to create a virtual COM port to connect to XCSoar on your phone, and another for Condor to transmit the data to. I assigned the following (although you can use whatever you like):
  • For Condor - COM 5
  • The connection to the LX - COM10 (self assigned by the computer as it's a physical port)
  • connection to the Android phone - COM 20
Creating the ports
Using com0com software I created a Virtual Pair of COM ports using the 'Add Pair' button. By default it will create a pair of COM ports called:
  • CNCA0
  • CNCB0
Rename CNCA0 to COM 5

Next a virtual serial port needs to be created to link to the Phone via WiFi. I recommend using HW Virtual Serial Port Software (which is per the recommendation in the Condor manual), however if you like to punish yourself you can use Hub4com instead (this might be useful if you want to run this from a Batch file). Hub4com doesn't have a GUI, so you need to use the Windows Command Prompt (Windows Key + R, then type "cmd" then press Enter)
Before you run the hub4com software, you need to direct Windows Command Prompt to the directory where Hub4com and com2tcp is located. In my case I just unzipped it to my Downloads folder, so to do that in my example the following is entered in Windows Command Prompt:
  • cd C:\Users\adams\Downloads\hub4com-2.1.0.0-386\hub4com-2.1.0.0-386
Then you enter the following to create the virtual serial port with the correct parameters:
  • com2tcp --baud4800 \\.\COM20 192.168.10.130 4353
--baud4800 sets the data transfer rate
\\.\COM20 sets the name of the port to 'COM20'
192.168.10.130 is the IP address of the phone on the WiFi/ethernet
4353 is the TCP port which is used by XCSoar (unless you've messed around with the settings in XCSoar)

Linking the COM ports together
Open a new command prompt (Windows Key + R, then type "cmd" then press Enter), then enter the following (again) to get to the correct directory:
  • cd C:\Users\adams\Downloads\hub4com-2.1.0.0-386\hub4com-2.1.0.0-386
then
  • hub4com --baud=4800 --octs=off --route=0:1 --route=0:2 \\.\CNCA0 \\.\COM10 \\.\COM20
--baud=4800 sets the data transfer rate
--octs=off is something to do with how the data is communicated (?!?!)
--route=0:1 and --route=0:2 sets the data flow direction. In this case from CNCA0 to COM10, and CNCA0 to COM20.
\\.\CNCA0 \\.\COM10 \\.\COM20 are the list of all the COM ports you want to link. CNCA0 is paired to COM5, COM10 is the physical connection, and COM20 is paired to the phone.

Go into Condor -> Setup -> Options. In the NMEA output window Check 'Enable' and Select 'COM5' from the drop down list.
Go fly!

Here's what happens.
Condor outputs to COM5, COM5 passes the data to it's pair CNCA0, hub4com splits the data and shares it to COM10 (the LX) and COM20 (the phone which XCSoar).


Side points: you can create multiple pairs in com0com, and create multiple virtual serial ports to connect to multiple external devices on ethernet or whatever. I have two spare phones with XCSoar installed, so I could actually have three XCSoars running simultaneously if I wanted.

Hope that helps. I will update the guide as I get more experience with it and/or as feedback comes in.

Thanks

EDIT: Updated 2025-01-27

Post Reply

Who is online

Users browsing this forum: No registered users