Condor 2 Arduino - sourcefiles available

Interested in building your own home grown cockpit?

Moderators: Uros, OXO

Sam66
Posts: 18
Joined: Fri Jan 05, 2018 8:11 am

Condor 2 Arduino - sourcefiles available

Post by Sam66 » Sat Apr 04, 2020 1:32 pm

Hi all,

I decided to share my 'pivate' project to build a home simulator with Condor and Arduino.
You can find the sources here: https://github.com/Enrico66nl/Condor2Arduino

What this code does is:
- read the sent UDP-file from Condor into a string
- Get the needed variables from that string
- Convert them into Bytes (I first sent them as strings but my arduino drowned and it ran slow)
- send it through a COM to arduino
- Re-convert the bytes in the arduino into readable variables
- Send it to stepper motors, Servo's LCD's or whatever you want.


Please note: This code is 'as is'. No support from me. I am not a programmer, this is all teach-yourself-stuff.
I know I would have liked to see examples of coding so thats why I share it here.

Be safe #stay@home!
Eric

adcam
Posts: 2
Joined: Fri Apr 24, 2020 8:14 pm

Re: Condor 2 Arduino - sourcefiles available

Post by adcam » Sat Apr 25, 2020 8:27 pm

Thanks a lot

just a simple question : how do you connect the condor udp port to arduino ?

Adolfo

Sam66
Posts: 18
Joined: Fri Jan 05, 2018 8:11 am

Re: Condor 2 Arduino - sourcefiles available

Post by Sam66 » Sun May 03, 2020 11:25 am

Hi Adolfo,
My program is an interface between Condor and the Arduino.
It reads the UDP data from the port of your choice. It then converts that data and sends it to a Com-port. Also of your choice.

So to answer your question: I do not send Condor UDP data directly to an arduino.
Greetings,
Eric

Sam66
Posts: 18
Joined: Fri Jan 05, 2018 8:11 am

Re: Condor 2 Arduino - sourcefiles available

Post by Sam66 » Sun Nov 15, 2020 4:12 pm

I revisited my project as we are going to build a real simulator.
Changed some stuff:
- Speed is now sent as raw speed, not the converted speed (was kmph)
- Added extra decimal value to the vario's for more precision
- fixed some minor (potential) bugs
Last edited by Sam66 on Fri Nov 27, 2020 8:37 am, edited 1 time in total.

Sam66
Posts: 18
Joined: Fri Jan 05, 2018 8:11 am

Re: Condor 2 Arduino - sourcefiles available

Post by Sam66 » Fri Nov 20, 2020 1:06 pm

added the condor2arduino exe file.
greetings, Sam66
You do not have the required permissions to view the files attached to this post.

Sam66
Posts: 18
Joined: Fri Jan 05, 2018 8:11 am

Re: Condor 2 Arduino - sourcefiles available

Post by Sam66 » Sun Nov 22, 2020 11:07 am

and the arduino file
You do not have the required permissions to view the files attached to this post.

mrak
Posts: 8
Joined: Wed Sep 30, 2020 8:40 am

Re: Condor 2 Arduino - sourcefiles available

Post by mrak » Wed Nov 25, 2020 8:08 pm

Hello,

i have small problem with your program.
Is it working with Condor 2?
When i start Condor/free flight and then C2A Interface - port 55278 - connect i can see runnig data in frame. But when i try connect arduino (in the interface) the interface is freeze. After unplug arduino from pc the Interface is again runnig.
I have Arduino on COM3 same as in interface. Interval (ms) is default 30.

(sorry for my english :wink: )

mrak

Sam66
Posts: 18
Joined: Fri Jan 05, 2018 8:11 am

Re: Condor 2 Arduino - sourcefiles available

Post by Sam66 » Thu Nov 26, 2020 10:32 am

Hi Mrak,
I will let you know if I find something wrong. And yes, I use Condor v2
Update: I tested it and I cannot find a problem. I tested it with both 19200 and 9600 connection to an Arduino Mega on COM3.
with the sketch found in this thread. Also without a proper sketch the program keeps running. I am sorry Mrak, I have no clue what is wrong.
Has anyone else tried the program?

mrak
Posts: 8
Joined: Wed Sep 30, 2020 8:40 am

Re: Condor 2 Arduino - sourcefiles available

Post by mrak » Thu Nov 26, 2020 11:00 pm

I have clon of the Arduino Leonardo. Do you think that this can be the problem?

Sam66
Posts: 18
Joined: Fri Jan 05, 2018 8:11 am

Re: Condor 2 Arduino - sourcefiles available

Post by Sam66 » Fri Nov 27, 2020 9:51 am

Hi Mrak,
I do not think that it is the problem. Failed connections should not cause the main program to freeze.
I have updated my code so it catches error's, could you try this version please? (see attachment v2.1)
You do not have the required permissions to view the files attached to this post.

mrak
Posts: 8
Joined: Wed Sep 30, 2020 8:40 am

Re: Condor 2 Arduino - sourcefiles available

Post by mrak » Fri Nov 27, 2020 4:08 pm

Hi Sam66

the issue is still same.
Interface is runnig and reading data from Condor (without connected arduino).
Interface is freezing with connected arduino. I cant move or do anything with Interface, but after physically unplug the Interface is unfreeze and data continues.
You do not have the required permissions to view the files attached to this post.

Sam66
Posts: 18
Joined: Fri Jan 05, 2018 8:11 am

Re: Condor 2 Arduino - sourcefiles available

Post by Sam66 » Sat Nov 28, 2020 12:04 pm

Hi Mrak,
I am out of ideas. I have tested it, as well as others and we cannot reproduce your problem. Does your arduino work with other software who uses com-port? In the forum someone else has made a similar program as mine. https://github.com/kbobrowski/CondorUDP2COM
That did not really work for me but maybe it works for you?
I will continue to try and find a solution, but I am not a programmer. This is all self-tought-code
Last edited by Sam66 on Tue Dec 01, 2020 2:51 pm, edited 1 time in total.

Sam66
Posts: 18
Joined: Fri Jan 05, 2018 8:11 am

Re: Condor 2 Arduino - sourcefiles available

Post by Sam66 » Tue Dec 01, 2020 10:53 am

Mrak,
maybe the problem is the settings of the port I used:

SerialPort(name, baud, Parity.None, 8, StopBits.One);

so:
Name = name from the dropdownlist (COM3)
Baud = Value from dropdownlist
Parity = None,
Databits = 8
Stopbits = 1

mrak
Posts: 8
Joined: Wed Sep 30, 2020 8:40 am

Re: Condor 2 Arduino - sourcefiles available

Post by mrak » Wed Dec 02, 2020 10:07 pm

Hi Sam

this is settings of my port.

I think that i tried everything, but problem is still same.
You do not have the required permissions to view the files attached to this post.

mrak
Posts: 8
Joined: Wed Sep 30, 2020 8:40 am

Re: Condor 2 Arduino - sourcefiles available

Post by mrak » Fri Dec 18, 2020 8:54 pm

Hi Sam,

maybe i found solution for Arduino Leonardo - forum.arduino.cc

"The Leonardo, and probably the Micro, need to have Serial::DTREnable set to true, in the C# app. Other Arduino boards do not."

The reason should be that Leonardo have different type of USB chip. Please could you check settings of the Serial port in the C#? :wink:

https://forum.arduino.cc/index.php?topic=425982.0

Post Reply