Getting Data From Falcon
-
Hi All,
I’m trying to develop a software that uses F-16 flight data. Is there a way to get data(Navigation, Radar, Pickle, Chaff, Flare) from Falcon BMS while flying.
Thank you,
-
What platform are you contemplating using it on (i.e., Ipad…Tablet…etc.)?
-
I was wondering about this myself. One good thing about DCS is the relative ease of exporting tons of cockpit data and switch states to be used with Arduinos, Raspberry Pis, etc to build cockpits (saw a great example using a RPi driving a cheap composite display as the Hog’s CDU screen). Is BMS able to do the same and if not, is there much chance of this being added, either officially or via a mod?
I haven’t seen many tablet apps for DCS, which is a shame as tablets are quite cheap and handy where you need a detailed display and touchscreen but if the data’s exportable from a sim, at least there’s the possibility of someone coding an app to use the data.
-
BMS has shared memory that’s accessible. There are a quite a few apps already out there (MFDe, CPD, a number of tablet and phone apps)
-
I have seen various MFD utils/extractors for BMS, not come across anything as far as I can recall for exporting instrument, switch and display data to arduinos or RPIs though. Maybe it’s possible but it seems more accessible in DCS and X-Plane with its datarefs. It’s not just whether the data can be extracted but how easy it is for the user to do so. Ideally I’d love to see a standard for this across all sims, so that the arduino code is generic and works for everything without reflashing, with a programme on the PC that translates between the arduino output and the sim. So switching between sims, you’d just select the X-plane profile and that would translate switch1 up->x-plane landing gear up, selecting the BMS profile would translate switch1up->BMS gear up, etc.
-
F4toPokeys reads F4s shared memory to export warning/caution light status to the Pokeys56 series units.
I think your standards idea is not likely to happen, as you need a standard first, and then you need everyone to adopt it… even if the world at large adopted a new standard for data extraction, you would see that on new games, but probably not in BMS within any realistic timeframe.
what instrument, switch or display data did you want to export to an RPi? If you want to run physical instruments off an RPi/Arduino, but dont want to do any of the work yourself, then you might as well buy one of the existing solutions like Aircore.
-
It’s good that we have F4toPokeys but Pokeys are quite a bit more expensive than Arduinos with network shields. I want to use UDP rather than USB as it’s less hassle and is what X-plane and DCS projects are using.
The standards idea doesn’t really require much, if any, work on the part of game devs. As long as they provide an export/import interface, then the windows utility can translate between the game and Arduino. Vlad has done some great work on the X-plane forums to make it simple for users to upload the appropriate code to the Arduino for whatever controls they have attached to it, then an X-plane plugin takes the data from the Arduino and translates it into datarefs for the sim. A windows utility would simply be doing the same, except for multiple sims. The user would just need to create a profile for each sim assigning each physical control to a specific sim function.
I’m not actually sure there’s anything in BMS that the RPi rather than Arduino would be better for, as its main advantage seems to be for driving a display. Perhaps it could be used for MFDs but that’s a lot more complicated than the text-based A-10 CDU, so I’m not sure it could process fast enough.
For gauges, etc, I’d just use a monitor at the moment as they don’t need to be touched and physical ones are a lot of work. What I would like to export is any textual data than can be displayed on 7-seg or OLED displays, any LED states (warning lights, caution panel). On the input side, it would be knobs, dials, switches. Whilst it might be sufficient for the windows utility to just send the keyboard keys that are mapped to BMS functions, it’s a lot easier if there’s static datarefs for each function available and the user doesn’t have to worry about mapping them to keyboard keys first.
-
text data from the DED and PFL you can read directly from the shared memory. LED states you can read directly from the shared memory.
While Im not as clear on this, I think the CPD app that Lightning wrote sends input back to falcon.
Its not really as needed tbh, as there exists already a widely recognised standard interface for inputs to software simulations - DirectInput. Just have your hardware connected to a virtual directX joystick (probably several if you are building a cockpit - Im expecting to need 3 or 4), so that keys and switches are directX buttons, and dials are incremental directX button presses or analogue axes as appropriate.
In the absence of someone writing a program with a GUI to do all the work for you… there is at least the capability to do what you are looking for.
How much do arduinos normally cost? Pokeys are pretty cheap… I bought 5 for about $25 australian each some time back.
If you need to drive a display, I reckon its cheaper to buy something designed to do that already - there exist plenty of plug in 7 inch screens that use a variety of connections, from USB to VGA to DVI to HDMI…
The standards idea requires developers of all sims to follow one standard - one that isnt built at this point. If you think that should be easy, maybe drop round to microsofts offices and suggest that this time around, they make their new browser follow standards.
Anyway, the point of all this is that there is no way to remove all the hassle involved without buying someone elses plug and play cockpit.
-
I obviously haven’t explained it very clearly but the standards idea does not require developers of all sims to follow one standard. I was posting from Tapatalk before, so let me see if I can explain a bit better now that I’m at my PC.
The code running on the Arduino doesn’t send any sim-specific commands, it simply sends Switch 1 Up, Momentary Button 1 pressed, Knob 2 turned clockwise, etc. So the code just needs to tell the Arduino what is connected to which pin.
Then the PC utility, listening on UDP, receives the data from the Arduino and sends output to the sim, depending on which profile is loaded. So if we’re running X-Plane, it would send X-Plane datarefs such as “radios/com1_standy_flip”, “lights/nav_lights_on”, “radios/stby_com1_fine_up”. If we’re running DCS, it would send whatever datarefs that recognises (defined in the export.lua I believe) and if we’re running BMS it would send whatever that understands, even keyboard keys or DX buttons using a virtualjoy device if it doesn’t provide a dataref interface like the other two sims.
The utility just needs to enable the user to map the incoming data from the Arduino (i.e. “Switch 1 Up”) to outgoing data for the sim. Obviously people will build different panels, so perhaps as a first step the user flicks a switch, which then shows the incoming data in the utility and allows the user to assign a label to it (i.e. Switch 1 Up) and repeat for each switch, button, encoder. Once all the physical switches are labelled (which only needs to be done once), then it’s just a matter of selecting the sim profile and selecting a dataref, key or DX button from a list to map that control to.
Clearly it’s preferable to have a dataref interface, as it means we don’t have to worry about keyboard mappings or mapping DX buttons to functions, so it makes it a lot easier and the datarefs should remain constant throughout updates. In X-Plane, they have introduced new datarefs over time but always retained the old ones to maintain backwards compatibility. So it would be great if such an interface could be added to BMS but the idea would still work if that doesn’t happen.
What we have at present is various sets of sim-specific Arduino code for DCS http://dcs-bios.a10c.de/docs/v0.2.5/userguide.html and X-Plane http://svglobe.com/arduino/xplib.html, so the Arduinos need to have different code uploaded whenever we want to switch between sims, which is obviously too much hassle. So it would be great if all those obviously talented people could work together (or failing that, someone else who sees the advantages of this idea) to produce some universal Arduino code and a PC interfacing utility instead. Then, if the datarefs the sim understands ever gets changed by the developers, it’s just a matter of updating the file of datarefs for each sim that the utility uses,
I can buy an Arduino Mega for about £15 and the Ethernet shield for £4, so £19 total. The Pokeys 57E (with built-in Ethernet shield) costs EUR 60 http://www.poscope.com/PoKeys57E which is about £44. Even if they cost the same though, the idea is to be able to use the same Arduinos for all sims, not different boards for each sim.
Obviously, I’m not thinking about building authentic panels for all the various aircraft. If I had the money and space sure, I’d love to have several different cockpits but I don’t, so I have to compromise in some respects. I may build several panels that can be swapped out and connected to the same Arduino, which will keep the cost down but that will depend on whether I can arrange things so that the same Arduino code will work for all the panels so that I don’t have to reprogram them each time. So for example, if I have a panel for a DCS aircraft with 20 switches and two encoders and a panel for BMS with the same number of controls or less, it should be possible to make them interchangeable by just grounding any unused pins at the panel end. It won’t matter whether the switch connected to the pin that sends “Switch 1 Up” on the DCS panel is at the top and at the bottom on the BMS panel, as the PC utility will be mapping the switch to the correct function for each sim. It’ll need a suitable connector on the back of each panel and a matching one on a box with the Arduino in, so that the panels can be connected to the Arduino by a robust lead (or maybe two, if there aren’t any leads available with enough pins).
Or I may just build more generic panels, which aren’t authentic but provide the controls I need in roughly the right location for several sims/aircraft. That’s the advantage of using a monitor for gauges rather than physical ones, as it’s a few clicks to change it when you swap sims. I did consider using cheap tablets for switch panels instead of physical controls but I really hate trying to adjust rotary knobs with touchscreens and want tactile and reliable physical controls for those and so I need to build panels. For things like MFDs where there’s just a display and buttons, tablets might be an option though and the KA-50 ABRIS could probably be done on a tablet, with physical encoders and buttons in a frame below it.
That’s for input, for outputting text data and LEDs the same idea should work. So as far as the Arduino is concerned the LED connected to pinX is LED1. Then the utility listens for data from the sim and when it receives “warning light 1 On” from DCS it has that mapped to LED1 On, so sends the command to the Arduino to light it up. Or an LED on a different panel in a different location (but still connected to the same pin and known to the Arduino as LED1) is told to light up by the utility when it’s in X-Plane mode and receives the dataref from X-Plane for “Landing gear locked”. I guess if BMS can’t provide export data on UDP, the utility should still be able to interrogate the shared memory to find out the status of the LEDs and tell the Arduino to light up the LEDs as appropriate but that’s sounds more complicated than if it provided simple export data.
As for the RPi, I guess even if it’s not got enough processing power itself to generate a graphical display, like a radar or moving map display/ABRIS, if that part of the cockpit can be captured and exported to the RPi as a video stream it could play it no problem, as it excels at video playback. That might be too stressful for the PC to manage whilst running BMS I guess though. Maybe it’s easier to just plug USB displays into the PC and draw the screens on those but I believe USB displays have their own issues with high resource use and so on, so I don’t know if that’s better or not.
Anyway, I hope I’ve done a better job of conveying the potential benefits of my idea and the relative lack of obstacles to implementing it.
-
there is no way to send data into BMS other then DX commands.
So you’ll need to have the Arduino show up as one or more Joystick devices.then it’s just a generic “joystick” where you can program from within the game.
you can also try and use some other software that will listen to the arduino commands and translate them to DX keystrokes. I however have no knowlage of such software.
getting data out of BMS is easy,
you just need to read the shared memory, Lightining has written a DLL for it. -
Thanks for an interesting thread.
Ive just started researching this very topic, with the intention of building a small switch box with key functions like AP, gear, arm, laser, jettison, config i/ii, park brake, and then perhaps a pair of rotary encoders for nav (precursor to a full cockpit, someday).
And as always with these things, scope begins to creep with the inclusion of a few warning lights as well - so now i too need to pull data from the shared memory.
Keyboard emulation using an Andruino Leo seems like the simplest way forward for my project (no need to pass inputs through the pc app to bms), but i can clearly see the value of the dovermans suggestions.
-
Hi
on getting input back into Falcon, buttons, axis, etc. I’ve successfully played with http://vjoystick.sourceforge.net/site - you can setup as many virtual joysticks as you want - a bit of a setup hassle especially with the dx bindings but possible to automate.
bad
-
I guess that’s one for the wishlist then, add an interface to accept dataref commands as well as DX commands. I wouldn’t have thought it would be that hard to do but I’m not the one who’d have to do it, so it’s easy to say!
I know there’s currently no software that will translate between the Arduino and various sims. That’s my idea/vision/dream that someone, or a group of people will see the benefits and create it.
-
The solution already excists.
POKEYS:uham:It has 55 inputs/outputs.
Can emulate a joystick with DX buttons.
Up to 20 rotary encoders irc.
You put switches in a matrix wich gives you even more switches to hook up.
It can send keystrokes.
It can read f4shared memory with F4topokeys, hook up some leds to make indexers or what ever you want.
Easy to program with the excelent pokeys GUI.
Its even programmable with C# if you are a wizzkid.Dont get me wrong arduino is great but IMHO not for simple key interfacing for BMS.
Uri_ba made the excelent dedduino wich put the DED and FFI on a oled screen and even has more options in it.I am using pokeys for a year now and its just a great little gizmo. Man it almost sounds like advertisement but its just my 2 cents.
-
I guess that’s one for the wishlist then, add an interface to accept dataref commands as well as DX commands. I wouldn’t have thought it would be that hard to do but I’m not the one who’d have to do it, so it’s easy to say!
I know there’s currently no software that will translate between the Arduino and various sims. That’s my idea/vision/dream that someone, or a group of people will see the benefits and create it.
Oooooor you could just program your switch panels to press DX buttons so that they work in all sims…
-
What platform are you contemplating using it on (i.e., Ipad…Tablet…etc.)?
I’m using Windows 7. I’m developing with C++ on visual studio.
Are there any documentation about Shared Memory,
Thank you all for valuable answers
-
I’m using Windows 7. I’m developing with C++ on visual studio.
Are there any documentation about Shared Memory,
Thank you all for valuable answers
For shared memory all you need is in the header file Flight Data.h located in \Falcon BMS 4.32\Docs\Other Documentation
If you need sample I can tell you all I know, I have made my own extractor.
-
The solution already excists.
POKEYS:uham:.Pokeys is OK but as already discussed, costs over twice an Arduino Mega with Network Shield. I’m not sure of the exact specs right now but I don’t think there’s anything that Pokeys can do that the Mega can’t, although maybe it makes it a bit more user-friendly to achieve.
I’d have to disagree that Arduino isn’t great for simple key interfacing though. I think the many people using it for just that with DCS and X-Plane shows that it works great.
-
Oooooor you could just program your switch panels to press DX buttons so that they work in all sims…
Sure I could but that throws the advantage of using datarefs with DCS and X-Plane (i.e. not having to map all the DX buttons to functions, which is even more painful in BMS than the other sims) out of the window, as well as the protocol advantages UDP has over USB. It seems to make far more sense to add a dataref-type interface to BMS.
Besides, that ignores the output side of things, which again seems better served by using UDP with a dataref-type interface.
-
Pokeys is OK but as already discussed, costs over twice an Arduino Mega with Network Shield. I’m not sure of the exact specs right now but I don’t think there’s anything that Pokeys can do that the Mega can’t, although maybe it makes it a bit more user-friendly to achieve.
I’d have to disagree that Arduino isn’t great for simple key interfacing though. I think the many people using it for just that with DCS and X-Plane shows that it works great.
If it can do everything a Pokeys can, then just use an Arduino…
Sure I could but that throws the advantage of using datarefs with DCS and X-Plane (i.e. not having to map all the DX buttons to functions, which is even more painful in BMS than the other sims) out of the window, as well as the protocol advantages UDP has over USB. It seems to make far more sense to add a dataref-type interface to BMS.
Besides, that ignores the output side of things, which again seems better served by using UDP with a dataref-type interface.
Of course, there you run into the issue of it not being possible to actually add a new system to BMS unless you join the team and code it. So I guess that is one advantage the existing system has.
I agree, mapping DX buttons to functions is incredibly hard in BMS, clicking a function and pressing the button associated is just so old school. I wish BMS would hurry up with that mind reading tech so I can just think what I want my controls to be, its much less painful.
Exactly how is there any difference between using an RJ45 connector or a USB connector? Im lost as to why you think output would be better served with a different interface.
You asked if its possible in BMS, you were told it is, then you complained its in a different protocol to DCS. Unless there is a massive advantage to be had in writing a new interface for falcon to mimic DCS’ interface, it would seem to be a large duplication of effort better spent on other areas (like releasing 4.33).