Board index FlightGear Support Interfacing

Telnet - Starting Engine

Connecting two computers, using generic protocol, connecting with Matlab?

Telnet - Starting Engine

Postby paddy01 » Thu Jan 29, 2015 10:47 pm

Hi,

After a bit of time away from Flightgear I've just re-installed with 3.2 after a bit of a hardware upgrade. Loving the new scenery!

I've started collecting parts to build my own basic panel and will be using switches connected to a Raspberry Pi with Python to take the switch inputs and interface with Flightgear over telnet.

So far so good, Flightgear is running with telnet enabled and I can connect via putty and use get/set commands etc to change properties however I'm stuck with how to constantly set the /controls/engine/engine[0]/starter property to true to continue spinning the starter until engine has started. On the c172p this is momentary switch (key) for which I'll need to replicate the function.

If I set the property to true via telnet then I see the prop 'twitch' but the property immediately reverts to false, which makes sense but I can't seem to figure out how (via telnet) to recreate the function of the keyboard 's' key to set the property to true until the key is released.

Would I keep sending the set /controls/engine/engine[0]/starter true 5 times a second over telnet (UDP) with some form of program while loop?

Apologies is this has an obvious answer but I've hit a real brain block here on my first foray into hardware interfacing with FG.

Oh, for the time being i'm only concerned with the c172p.

Many thanks,

Paddy
paddy01
 
Posts: 27
Joined: Tue Apr 30, 2013 10:20 pm
Callsign: P-ADDY
Version: 3.2.0
OS: Win7 / Xubuntu 14.10

Re: Telnet - Starting Engine

Postby ludomotico » Fri Jan 30, 2015 1:19 am

Try setting /controls/switches/starter to true

Also, remember "/controls/engines/engine/magnetos" must be set to 1 (right magneto selected), 2 (left magneto selected) or 3 (both magnetos on). On a real C172, since the starter position is always after the BOTH position of the key, I guess "/controls/engines/engine/magnetos" must be set to 3 and after that "/controls/switches/starter" to true if you aim to a real behaviour.

Keep in mind setting /controls/engine/engine[0]/starter to true do work on some aircraft, but not on the C172.
User avatar
ludomotico
 
Posts: 1269
Joined: Tue Apr 24, 2012 2:01 pm
Version: nightly
OS: Windows 10

Re: Telnet - Starting Engine

Postby Hooray » Fri Jan 30, 2015 3:19 am

besides, these things will 99.99% of the time have to go through the property tree - so you could look up the properties and bindings used there to see what is needed in terms of external commands - usually, that should get you going pretty quickly.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Telnet - Starting Engine

Postby paddy01 » Fri Jan 30, 2015 10:24 pm

Thanks guys, I had a feeling I was over thinking this and didn't think to differentiate between the engine starter property and the starter switch property.

eBay has been well used today ordering up some switches :D
paddy01
 
Posts: 27
Joined: Tue Apr 30, 2013 10:20 pm
Callsign: P-ADDY
Version: 3.2.0
OS: Win7 / Xubuntu 14.10


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 3 guests