MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
Ghrim40
Posts: 5
I'm using FSX flight-sim. Mobiflight is NOT capable of of making an LED flash that I'm aware of. But I wanted to make the Landing Gear Transition light to Light steady when the gear was working and moving, and flash if the gear had failed. So I intentionally created two CONFLICTING configs for each landing gear...one tries to turn the light on at the same time the other tries to turn the light off....and a precondition that they only work if the gear has failed. It seems to be working. I know traditionally we try to AVOID conflicting configs, and in this case I created them on purpose. My question is simply "is it ok to run the software / system like this?" Is there a downside to intentionally using conflicting configs within Mobi-Flight? Here's a link to the video of it to better show what I am talking about... https://www.youtube.com/watch?v=Jl7J6Z7IPys
2021-06-27 03:38
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
I don´t see the whole Config and how you do this.

In theory this is NOT correct! But for sure. The Mega will not explode or your house will not blown up in case of this "bug using".

"Maybe" this ocurre in a issue if you got a complex config ( full cockpit) ... But also here i would say.... Failed Gear is a verry rare issue. In 99,99% of your Simulation Time this will not happen.... ( Expect your a guy who like to create this fault by hand every second day) .... So this should not be verry problematic finally.

Whatever....

To avoid this "issue" you can think about alternates.....

1. Electrical. There exist "electrical parts (Maybe Capacitors) that ocure in a blinking..... Or IC Controllers.

2. With Mobiflight by using a Offset.... E.g. the Seconds or Milliseconds internal time Offsets.....
For example the Seconds in time MODULLO 2 occure in a Value 1 or 0 with a 1 second interval .... So 1 Sec ON, 1 Sec OFF, 1 Sec ON and so on.

3. Coding: With LUA it should be possible to write a code that can make a specific interval....
Like Write Offset xy to 1... wait xxx milliseconds .... Write the Offset to 0 .... wait again xxx milliseconds ..... Jump to start and loop again.
Good Luck !
2021-06-27 15:29
Avatar
Ghrim40
Posts: 5
You're correct, I like to make the sim have "random failures" such as gear, engine, fuel leaks, etc. and then try to solve those failures while flying.

I'm not worried about the house blowing up, lol...but this will be a complex config with a full cockpit. I'm worried that maybe as it gets more complex it will start generating errors in the software since there are several configs that are conflicting with each other.

I thought about electrical with a capacitor, but sometimes I would want the light to burn steady...other times for the same light to flash. I couldn't figure out how to make it do both with a capacitor.

I don't know anything about the LUA programming. Is there a code that anyone has that I could "copy and paste" here? I don't know how to program or write the code.

I'm going to try the "time offset". Never thought about that. It might work better for me. :w00t:

The best way I can explain the config I have now is that I use preconditions to check the position of ALL the landing gear. If one of the gear is "stuck/failed" up or "stuck/failed" down then that config will try to turn on the LED while a second config turns it back off. The result is that the light flashes. But if the other gear that is NOT failed starts moving, the LED will stop flashing and burn steady until the other gear stops moving...then the 1st conditions take back over and the light will start flashing again. And finally if the position of all of the gear match (all are up OR all are down) the the light will go off.

It's working but its real "messy". I'm going to try to make a better solution using the "time offset" like you said, unless I can find a LUA script that someone has already written. Thank You for that idea!!

P.S. Here is an image of the current "messy" config set I have set up right now.
https://www.flickr.com/photos/12586394@N04/51274861444
2021-06-27 17:52
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi Again

As i said... No blowing up of your house is expected.... So we are fine B)

I think "finally" the problem is.... All ways we choose have the same negative effect: They gain traffic from MF to Mega !

You use this "tricky way" and simply say config line e.g. 59 say "Please let the LED light up" ...... Config line "60" say "Disable the LED" . And that occure in a blinking in case MF simpy "loop" all the configs over and over again. By move the two configs ( make a lot of other configs between) you can controll the blinking frequency..... Cause MF take a longer time in the loop to come from the ON to the OFF Config.

The "Software" Solution i recommented technical do the same.... Whatever we use Time Offset ( A little more save in case a change only happen every 1000ms) or we use a Lua Script ( more changes within one second) ...... We still would send for each ON or OFF Swap a command via Serial to the Arduino.

So....."perfect" would be a FIRMWARE Solution.....
E.g. we got 5 different situations..... OFF, ON , Slow Blink, Medium Blink, Fast Blink
Here MF would say to mega ONE TIME "Please do xxxx with LED yyyy" and then the whole "process" is done on the Mega itself..... Means no longer Comunications between Mega and Computer itself aslong the status not change !


****************
Alternate is electrical.... Here also no Communication is needed between.

I need to talk to Stephan..... The Problem between Blink or Steady is no big deal. For example you could simply use 2 LED´s nearby..... One Blink.... One is steady. And only one is used same time.
Alternate is ONE LED that is controlled via 2 different Pins (seperated with diodes) ..... Channel one use a Blinking element.... Channel two is a simple all Time 5v for steady.
May Stephan got a good idea here!
Good Luck !
2021-06-28 00:57
Avatar
aeromax
Posts: 252
Supporter
Nose Gear Ext. GREEN
0x0BEC 4 Bytes Int
Compare:
> 16380
then: 1
else: 0

Nose Gear Move. RED / Up and Off
0x0BEC 4 Bytes Int
Compare:
> 16380
then: 0


a.s.o.
Life is Good When You Find What You are Looking For!
2021-08-25 20:33
icon