Jump to content

[MOD] DCS-to-GPS


Holton181

Recommended Posts

I am wondering if this info could be used to export to a Virtual Airlines websites using one of the live acars solutions.

 

 

 

I have been toying with the idea of using a VA website software with my units site and it would be amazing to have live tracking.

I have no idea. Never come across either Virtual Airlines websites or acars. But I might look into it whenever I get my computer together again. It's currently in a box, just arrived to our new home. According to my family it has low priority...

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

  • 1 month later...
I had the issue with DCS to GPS not working because of Simple Radio (SRS). I use ForeFlight. DCS to GPS would connect for about 3 seconds, and then disconnect as others have described. I then moved the DCS to GPS lines in Export.lua to before the SRS lines and DCS to GPS now works great, and so far SRS seems to be fine as well.

 

 

So, I finally installed SRS myself just to verify your findings, and sure thing it works!

Added the info in OP and download page, crediting you :thumbup:

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

I am wondering if this info could be used to export to a Virtual Airlines websites using one of the live acars solutions.

 

I have been toying with the idea of using a VA website software with my units site and it would be amazing to have live tracking.

 

 

I have done some investigations on this, and I'm now familiar with what Virtual Airlines and live acars are at least. What I have not found are any protocol description, i.e. how to build the messages to be sent. If you have any NOOB friendly information pleas feel free to share.

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

  • 2 weeks later...
I have done some investigations on this, and I'm now familiar with what Virtual Airlines and live acars are at least. What I have not found are any protocol description, i.e. how to build the messages to be sent. If you have any NOOB friendly information pleas feel free to share.

 

 

 

Most VA software is built using software called FSUIPC (FSX and p3d) and XUIPC (xplane). That interfaces with the flight sim on on a high level. It uses win32 api to make a standard (hidden) window that it post messages to. Most live ACARS system will post messages to the window to ask for information. Sadly I am not able to find a lua solution that works with win32 api. It would be pretty simple to take the information from a dcs lua hook and then feed that into a windows to kinda spoof a fake UIPC window but sadly I never did learn Visual Basic or C# so I am unable to do it myself.

Link to comment
Share on other sites

  • 4 weeks later...
Love this Script!

 

Great job Holton181!

 

 

 

 

WOW! I'm speechless!

Thanks for this video!

I've could not have done it better myself! (literally, I can't...)

 

 

Do I have your permission to put it in the first post and the download page?

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

Most VA software is built using software called FSUIPC (FSX and p3d) and XUIPC (xplane). That interfaces with the flight sim on on a high level. It uses win32 api to make a standard (hidden) window that it post messages to. Most live ACARS system will post messages to the window to ask for information. Sadly I am not able to find a lua solution that works with win32 api. It would be pretty simple to take the information from a dcs lua hook and then feed that into a windows to kinda spoof a fake UIPC window but sadly I never did learn Visual Basic or C# so I am unable to do it myself.

 

 

Sorry for late reply. I know of both FSUIPC and XUIPC, but like you I don't do Visual Basic or C# and have generally very little knowledge about these things. But lets hope there is someone knowledgeable guy around who could help us with this.

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

Holton, i got this working with OzRunways (Australian made EFB), I had to do some adjustments to the AHRS packetsend, seems your packets don't seem to match 100% with what was expected. I've dropped the code changes I had to do below. other then setting broadcast to true (though might not be required), if you want to add it to the code base as another option or something, I was lucky I've made the connector for the LM fs to this EFB so I knew what it wanted.

 

if AHRS_UDP == 1 then
	if AHRSt == 1 then
		AHRSt = 0
		my_send_AHRS_GPS = socket.protect(function()
-- had to change this line because some specific look for XGPS as the packet header OZRunways is one of them.
			local json = string.format("XGPS ,%.5f,%.5f,%.1f,%.2f,%.1f", Long,Lat,Alt,TC,Speed_ms)
			socket.try(AHRS:sendto(json, host_AHRS, port_AHRS))
		end) -- my_send
		my_send_AHRS_GPS()
	end
	AHRSt = AHRSt + ANEt
	
	my_send_AHRS_ATT = socket.protect(function()
-- As above, XATT because it's what is expected but also had to pad the full ATT packet out and give it the extra data it wanted,
-- in the case of Oz Runways this is Heading, VX, VY, VZ but we send it pitch, bank as well because it's already there.. 
--I just can't find what the values i'm missing are but then when i worked on the connector for another sim - ozrwys we ignored these as well anyway.
		local json = string.format("XATT ,%.1f,%.1f,%.1f,0.0000,0.0,%.1f,%.1f,%.1f,0.00,1.00,0.00", Heading,Pitch,Bank,VX,VY,VZ)
		socket.try(AHRS:sendto(json, host_AHRS, port_AHRS))
	end) -- my_send
	my_send_AHRS_ATT()
end

 

and images of it working, did have to restart ozrunways after the sim started to get it to talk but that's just a quirk of OzRunways some times.

JPEG_20191112_073725.thumb.jpg.66aed280f1a602bd6738108c9fd48604.jpg

20191112_072050.thumb.jpg.a9d165031751ff373b115801e08cdea5.jpg


Edited by robgraham

i7 13700k, 64gb DDR5, Warthog HOTAS, HP Reverb G2 VR, win 11, RTX 3070

TGW Dedicated Server Admin, Australian PVE/PVP gameplay. (taskgroupwarrior.info/2020)

Link to comment
Share on other sites

Holton, i got this working with OzRunways (Australian made EFB), I had to do some adjustments to the AHRS packetsend, seems your packets don't seem to match 100% with what was expected. I've dropped the code changes I had to do below. other then setting broadcast to true (though might not be required), if you want to add it to the code base as another option or something, I was lucky I've made the connector for the LM fs to this EFB so I knew what it wanted.

Hi robgraham,

Glad you got it working!

On my way to bed now, but will have a look at the code later on, might add it as an alternative. Thank you very much!

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

  • 2 weeks later...
...

Hi robgraham,

 

Would you mind trying out version 1.4 Beta I have attached to this post?

Use the standard AHRS method. I have enhanced the XATT sentence to containing all 12 values, what I believe is the full length of it. The header is still "XATTDCS" and I am pretty sure it should work, but if this version doesn't, pleas try removing only "CS" leaving the header as "XATTD". The reason for this is that OzRunways natively supports X-Plane AHRS sentences, and that header is "XATTK" (no clue why X-Plane has "K").

 

I have been in contact with a guy at OzRunways and gotten som help from him, and also done some testing with X-Plane (sending AHRS sentences over UDP) together with Wireshark (network analyzer), and successfully recreated the full structure of XATT (since I could not find any documentation about it):

 

XATTDCS,TrueHeading,Pitch,Roll,P,Q,-R,VZ,VY,-VX,G_side,G_normal,G_axial

 

Angular velocities P,Q,R in rad/s

P -> Bank, right positive

Q -> Pitch, nose up positive

R -> Yaw, left positive -- X-Plane right positive

 

Speed in 3D Space VX,VY,VZ in m/s

VX -> North south, north positive -- X-Plane east west

VY -> Up down, up positive

VZ -> East west, east positive -- X-Plane north south, south positive

 

G-load

G_side -> "centrifugal force", positive when turning right

G_normal -> "G-force" in loop, pitch up positive

G_axial -> "Acceleration" in car, speeding up positive

 

Some values had either shifted naming (VX and VZ) or opposite sign or both in DCS compared to X-Plane, and since X-Plane has native support for AHRS communication I adopted the DCS sentence to correspond to X-Plane. I hope I got it all right.

 

(I'm an Android guy so can't test it myself)

DCS_NMEA 1.4 Beta.zip


Edited by Holton181

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

Holton will give is a shot soon, sorry fires and really shitty weather here in Australia atm which is playing hell on me doing a lot (coupled with illness etc) will see if i can't test it tonight while i fly (if i get to)

 

-Rob.

i7 13700k, 64gb DDR5, Warthog HOTAS, HP Reverb G2 VR, win 11, RTX 3070

TGW Dedicated Server Admin, Australian PVE/PVP gameplay. (taskgroupwarrior.info/2020)

Link to comment
Share on other sites

Holton will give is a shot soon, sorry fires and really shitty weather here in Australia atm which is playing hell on me doing a lot (coupled with illness etc) will see if i can't test it tonight while i fly (if i get to)

 

-Rob.

Ah, really sorry to hear!

Don't worry about testing, let real life settle to more comfortable levels.

Have heard about your problems with fires but didn't think of it when sitting comfortably in the sofa and attending the forums. Hope you and your close ones are safe, and that your illness will soon go away.

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

  • 5 months later...

New Version 1.4

 

New version!!!

1.4

 

* Enhanced the XATT sentence after some tips regarding OzRunways. Hopefully XATT is now fully implemented with 12 values

* Possibility to send data to several Serial Ports (COM ports) at the same time

 

 

See first post.

 

 

/H

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

  • 4 months later...

Sorry to bother everyone this morning, iv just followed the video on YT trying to connect my Ipad using foreflight. When i load up DCS how do i connect the game to the Ipad app? When i made a very quick mission then sat in the cockpit launched the app and nothing happened. Is there a better App to use?

 

Any help would be hugely appreciated i think this script is amazing. :thumbup:

 

Thanks in advance.

Link to comment
Share on other sites

Sorry to bother everyone this morning, iv just followed the video on YT trying to connect my Ipad using foreflight. When i load up DCS how do i connect the game to the Ipad app? When i made a very quick mission then sat in the cockpit launched the app and nothing happened. Is there a better App to use?

 

Any help would be hugely appreciated i think this script is amazing. :thumbup:

 

Thanks in advance.

 

Hi Stickley92,

 

Are your Ipad on the same network as your DCS computer?

 

In the video he only mention to copy one single line from the Export.lua that comes with this MOD, but you must make sure the first line is also present before that line: userprofile = os.getenv ("userprofile"):gsub("","/")

Could it be this?

 

I found some instructions how to connect ForeFlight to a simulator and after starting DCSW folow this:

Enable FlightSimGPS in ForeFlight: Tap More > Devices. DCSW should appear in the list. Tap on the DCSW "square" and slide the Enabled switch to ON.
(at least I think it should be 'DCSW')

 

 

Hope it helps!

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

Sorry to bother everyone this morning, iv just followed the video on YT trying to connect my Ipad using foreflight. When i load up DCS how do i connect the game to the Ipad app? When i made a very quick mission then sat in the cockpit launched the app and nothing happened. Is there a better App to use?

 

Any help would be hugely appreciated i think this script is amazing. :thumbup:

 

Thanks in advance.

 

Also make sure your DCS_NMEA.lua has the correct output settings to include AHRS_UDP to 1, and host_AHRS to be your iPad's IP address. Otherwise it doesn't know where to send the data.

Link to comment
Share on other sites

Thank you for your replies I will be attempting again to sort this out later. Do you have to have the pro version of forefligh or does the free version work?

 

Also when you mention this:

make sure the first line is also present before that line: userprofile = os.getenv ("userprofile"):gsub("","/")

 

Do I just need to copy and paste this exactly in the first line, would I need to change anything for example the user profile?

 

Sorry for the questions I'm not great at reading computer language haha.

 

Thanks again in advance.

Link to comment
Share on other sites

Also when you mention this:

make sure the first line is also present before that line: userprofile = os.getenv ("userprofile"):gsub("","/")

 

Do I just need to copy and paste this exactly in the first line, would I need to change anything for example the user profile?

This first line has to be before the second (the one mentioned in the video), that's all, no need to be the first line in the file but it could be good to have it there in case you add more addons/MODs utilizing it. No need for the two lines to be adjacent either, other code can be in between.

The reason why he didn't copy the first line in the video is because he already had it present from another addon.

IMPORTANT! copy the line from the file, not from here! I noticed the code was altered when posting it here due to how this forum is technically working "under the hood".

 

FYI

The first line simply grabs the folder path to the current windows user folder, i.e. C:\Users\[your username].

The second line append the rest of the path to the file 'DCS_NMEA.lua' to the path above and run the file.

This way the code gets "anonymousified" and no need to edit anything except copy/paste and uncomment the right line.

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

So far i have tried everything suggested and still get nothing coming up under devices on the app. The last thing i can think of is opening up the ports on my router but after that im not sure.

 

I have opened up the ports for the router and will be testing it shortly but i am unsure what i need to do in the firewall to open the ports there.


Edited by Stickley92
Link to comment
Share on other sites

userprofile = os.getenv ("userprofile"):gsub("","/")

-- dofile(userprofile .. "/Saved Games/DCS.openbeta/Scripts/DCS_NMEA.lua")

 

and

 

 

----------------------------------------------------------------------------------------------------------------------------------------------

-- CONFIGURATION

----------------------------------------------------------------------------------------------------------------------------------------------

 

-- This "CONFIGURATION" is the only section you need to edit!

 

-- What output do You want? 0 = disabled, 1 = enabled, can be several

AHRS_UDP = 1 -- AHRS sentences via UDP (ForFlight, SkyDemon, WingX Pro, FltPlan Go, etc. Enable X-Plane as data provider)

NMEA_UDP = 1 -- NMEA sentences via UDP

NMEA_Serial = 0 -- NMEA sentences via Serial port, you can configure a virtual Bluetooth serial port and connect to a Bluetooth devise,

-- or use GPSGate Splitter (formerly Client) to send the data to Google Earth (might exist other ways to do that too)

-- INPORTANT!!!

-- If Bluetooth Virtual Port (in NMEA_Serial) is used, be aware that DCS will freeze as long as the used device isn't listening to the port. As soon as it listen, DCS will un-freeze.

-- I do not know if this freezing behavior exist when a physical serial port is used, since I do not have one to test with.

-- This freezing behavior DOES NOT exist if one uses utilities like GPSGate Splitter (formerly Client) as a middle hand (create virtual port as input, output to the Bluetooth port).

-- Remember to comment out the "dofile" line related to this MOD in Export.lua or set NMEA_Serial = 0 in this file if you are not going to use it to avoid freezing.

 

 

-- Where to connect?

host_AHRS = "used ipads ip" -- Only needed if AHRS_UDP = 1, replace IP with device IP. If you like to use several devices on your network, replace the last section of one IP address to 255, like "192.168.1.255"

port_AHRS = 49002 -- Only needed if AHRS_UDP = 1, leave the port as 49002.

host_udp = "Used ipads ip" -- Only needed if NMEA_UDP = 1, replace IP with device IP. If you like to use several devices on your network, replace the last section of one IP address to 255, like "192.168.1.255"

port_udp = 4353 -- Only needed if NMEA_UDP = 1, select preferred port, use the same port in your GPS device.

sPort_Nr = {6} -- Only needed if NMEA_Serial = 1, replace the number with the serial port(s) You want to use, if several delimited with ',' like {3,6,10}.

-- INPORTANT!!!

-- Make sure the ports port_udp and port_AHRS are correctly opened in any firewall and router. You might need to open it as UDP exclusively and not as TCP/UDP.

 

 

-- How often do You want information to be sent, Nr of times per second? from 1 to 10 (ForFlight requirement)

-- Doesn't affect AHRS position updates, need to be ones per second (ForFlight requirement), but does affect AHRS Attitude and all NMEA updates

ActivityNextEventFrequency = 5

 

 

-- STOP!!! Go no further! ;)

 

----------------------------------------------------------------------------------------------------------------------------------------------

-- END OF CONFIGURATION

----------------------------------------------------------------------------------------------------------------------------------------------

 

Have i done anything wrong in the set up?

Link to comment
Share on other sites

Have i done anything wrong in the set up?

Just got up from bed and not at my computer for a while, but at a first glance it looks okay (as long as the IP to your device is right, cant verify that). The NMEA_UDP part isn't needed if you intend to only connect to ForeFlight with AHRS, but it doesn't hurt to have it activated either. I have no ports opened so I'm not sure if it is necessary to open up any ports, but then again I'm no network savvy, might differ from network to network.

How does your Export.lua look like?

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...