x-plane 10 datarefs support

Status
Not open for further replies.

raflyer

Well-known member
Hi Paul,
Was anything ever done about Teensy not seeing 3rd party datarefs? I am using an add-on plane and Teensy does not give any feedback in the com window when i try to access this dataref for example, FJS/732/Inst/HSI_GS_FLAG for example? I tried unplugging and replugging after the aircraft loaded. Nothing but a blank display in the Teensy com window.

Rob
 
Shame as I would have bought about 30 -40 of these had they worked properly and built a sweet Sim. Guess i'll to buy the Uno's now.
 
@raflyer: If I'm reading this right - without code to see - or OS info as Windows? I can only guess you are saying you are dumping serial output to Monitor to see values you are looking for and not getting the feedback you are looking for?

If that is the case then refer this post to modify setup and see if the output comes out: https://forum.pjrc.com/threads/28136-Program-won-t-run-on-powerup-without-pressing-reset?p=68446&viewfull=1#post68446

Hope this applies and helps - the Teensy boots so much faster and the USB takes a bit to show up on Windows.
 
When you say "Teensy does not give any feedback in the com window when i try to access this dataref for example, FJS/732/Inst/HSI_GS_FLAG for example", perhaps you could be more specific about EXACTLY what is appearing in the Show Communications window in X-Plane? Or maybe you could take a screenshot?

For example, if you reprogram Teensy, it is showing red lines that the Teensy went offline and came back online?

Are you getting the "Teensy request data FJS/732/Inst/HSI_GS_FLAG does not exist" message? This is an important point, because the problem you're seeing might be related to something with Teensy or the Teensycontrols plugin if you're not getting any communication. But it's also equally possible everything about Teensy and the plugin is working perfectly, and X-Plane simply is returning NULL when the plugin calls XPLMFindDataRef().

You can get better help if you write more specific questions that give good info. But simply reposting inadequate questions isn't going to help. Even if you switch to Arduino Uno, you're still not going to get any useful answers to forum questions that don't give much detail about the actual problems you're encountering. But with Uno you'll get only USB serial, so you'll have to write code to do the communication, which will force you to have more awareness of the details.


@defragster - Teensy has a special Tools > USB Type setting for X-Plane flight sim controls. It allows you to create variables on the Arduino side that are linked to data references inside the flight simulator, so simply accessing the variable on Teensy gives read/write access to stuff within the sim. It has a special "Show Communication" window within the flight simulator, which shows a log of all the stuff happening in real time to keep the variables in sync with the simulator on the PC.
 
Paul
I apologize for the sparse 2nd question, Late night frustration is my only excuse.
To answer your question as completely as I can,
When I tried to use this dataref as a test, (FJS/732/Inst/HSI_GS_FLAG) I had the Plugin by Sandy Barbour open that sees datarefs, and I had the Teesny show comm window open.
The see dataref window showed the dataref changing from a 1 to 0 and back as I manipulated to sim to make that happen. The Teensy window was Blank. When I cycle plugged the Teensy the Teensy com window shower in Red Teensy disco then reconnect. I then add sim in front of the dataref as so, just as test, sim/(FJS/732/Inst/HSI_GS_FLAG Teensy com window then popped up not a valid dataref. I hope that makes more sense now of what i was seeing.
My question that popped up my head right now was I may have had it is a FlightSimFloat and the dataref is obviously a Bool. Would that be an issue with it ,seeing, the dataref?

Referring to my other post that was actually a different issue relating to what I thought was the length of the dataref error. Ended up being my stupid error and reading it cross eyed.

There are over 150 FJS specific datarefs that I need to interface and that is why this is so important to me. I really wanted to make it all Teensy as well as I have 2 other individuals that are going to copy my setup so this has the potential be a large order of Teensy's if we can figure this out. :)

On another side note, Dozer has another plane from the same 3rd party vendor and he was going to try and look into the issue as well. No word from him on his testing as of yet.

Anything else you need just let me know and I will provide it as best as I can.
 
Last edited:
I then add sim in front of the dataref as so, just as test, sim/(FJS/732/Inst/HSI_GS_FLAG Teensy com window then popped up not a valid dataref. I hope that makes more sense now of what i was seeing.

When does "popped up not a valid dataref" mean?

Did the exact words "not a valid dataref" actually appear on your screen? Or is that your own language, paraphrasing or describing something that was on your screen.

When you post a real screenshot, or you transcribe the EXACT TEXT of messages you see on your screen, then it's possible to match up the text in your forum message with the source code that prints messages. For example, maybe the message you saw as printed by this code at line 200 in memory.c. Or maybe it wasn't? Really, I'm guessing here (and using up time that could have been used to give you much better help).

Can you see how posting imprecise info is hindering efforts to help?
 
Normally, X-Plane is run in full screen mode. But it is possible to run it in just a window. When you run it that way, you can use ordinary screen capture techniques to grab a screenshot of your entire screen. Then you can post that image here. Please do so.
 
Thanks for catching me up Paul. The wide range and usage cases of the Teensy power is amazing! Especially compared to the meager power and high price and large size of the Uno.

If this worked before and works on UNO - then with good feedback on the issue that may have changed, my feel is the Teensy environment seems rock solid to evolve to get it to work again.

From YouTube I followed the DUE .vs. Teensy 3.1 on the ILI9341- Amazing how competent the M4 you picked is - not to mention the effort behind the optimization to use it!
Paul: Question:: What proto board do have in use in that video
BTW under IE the video to YouTube doesn't show (your link) - I have Flash off or something - might be good to add a URL link.
 
Both are custom proto boards. I just drew up PCB layouts and sent them off to one of the cheap Chinese PCB fabs. I believe it was probably iTead. They have a cheap 100 piece price. I also laser cut a big batch of matching plastic bases and tapped threaded holes, which goes much easier and faster as a big batch.

I like to have an exposed ground plane on the top side. So far, some old and very expensive products from Vector are the only ones I've found like that, so I just make my own with the ground plane. Then I make all my ground connections by just soldering a little loop of wire through 2 holes. Without ground wires all over the place, I make all the Vcc connections by soldering bare wires (usually leftover diode leads, since they're square and strong but flexible). That really cuts down on the wiring clutter, since only the signal wires are normal insulated wire.
 
Paul,
I uninstalled and then reinstalled the Teensy Plugin and for whatever reason now it is working ok but I have a question. Using the code below I can't get Pin 19 to change output when the dataref changes. When watching the dataref it changes from 0.000000 to 1.000000 but not fast it takes almost 2 secs to change from either number as it counts up or down when it changes. In the Teensy Com window it shows the dataref changing from 0.0 to 1.0 perfectly
Code:
FlightSimFloat gsFlag;

// setup runs once
void setup() {
  gsFlag = XPlaneRef("FJS/732/Inst/HSI_GS_FLAG");
  pinMode(19, OUTPUT);  // pin 11 on Teensy 2.0, pin 6 on Teensy++ 2.0
}

// loop runs repetitively, as long as power is on
void loop() {
  FlightSim.update(); // causes X-Plane's changes to be received
  if (gsFlag != 0) {
    digitalWrite(19, HIGH);
  } else {
    digitalWrite(19, LOW);
  }

}

TeensyCom.jpg
 
Last edited:
Good to know there are signs of it working
raflyer: perhaps out to 19 is working but the flag drops the next loop through and goes off? Maybe add a delay(200) after the write 19 high so it stays long enough to see?
 
Paul, Per my statement in an earlier post, 'My question that popped up my head right now was I may have had it is a FlightSimFloat and the dataref is obviously a Bool. Would that be an issue with it ,seeing, the dataref?"

I can confirm this. If I make it FlightSimInteger instead of Float, Teensy Comm window shows nothing blank nada, If it is set up as a Float then all is ok with Teensy seeing the dataref and noting the changes os said dataref in the Teensy Com window.
 
Good to know there are signs of it working
raflyer: perhaps out to 19 is working but the flag drops the next loop through and goes off? Maybe add a delay(200) after the write 19 high so it stays long enough to see?

I will try that here in just a bit and report back, Thanks!
 
Got it!
I had to make this change for it to work,

Code:
if (gsFlag <0.5)

from

Code:
if (gsFlag <01.0
 
Status
Not open for further replies.
Back
Top