Getting Data From Falcon
-
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).
-
If it can do everything a Pokeys can, then just use an Arduino…
Well yes, that’s rather the point, I intend to!
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.
As I’m sure you know, mapping in BMS generally requires the user to edit the key file, or at least that’s what I’ve been told. It’s up to you if you’d rather be sarcastic than constructive but sarky comments about “mind reading tech” being the only possible improvement to BMS’ control mapping are hardly useful.
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.
I would’ve hoped you’d know that the connector isn’t the only difference between a LAN/UDP connection and a USB connection. People much smarter than I have determined that USB has high overhead which can cause issues when there’s a lot of real-time input/export data being transmitted, which isn’t a problem when using UDP. There’s also issues with Windows deciding to re-assign new IDs to USB devices when they’re re-connected, certainly when plugged in to different ports, which can mess up a whole lot of work, which also isn’t an issue with UDP.
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).
Well there is one big advantage in having static datarefs, in that it eliminates the need to map DX buttons to functions (whether in the GUI if it’s actually possible to do everything needed there, or in the key file). As for whether shared memory is inferior to exporting data via datarefs over UDP, I’m not qualified to add anything to the opinions of those who choose the latter for X-Plane and DCS. Maybe my idea of a utility to translate between Arduinos and various sims can be made to work with shared memory as well as datarefs but clearly that requires an extra step of getting the data out of the shared memory into a format that the utility can use, whereas datarefs can just be parsed as is, so I imagine it would be less work for whomever wanted to try creating such a utility.
-
Well, I look forward to seeing the fruits of this labor of thine.
I will say Ive not any problems with USB for my cockpit panels. You just leave them in the same ports - bit of tape around the cable with the port number written on it.