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.

Go to page 1Go to page 012Go to page 2Go to page 2
Avatar
MustangMig
Posts: 32
Hello.
I am continuing the tests with MF for my next cockpit.
In the Settings / Modules tab the various Buttons and Leds are in apparently random order.
Instead I would like to arrange them in progressive PIN order.
It's possible to do it? How can I do?
Thanks
(My previous Cockpit is this https://www.youtube.com/watch?v=zbgtj7bT5xE ).
[Last edited by MustangMig, 2020-04-01 12:55]
2020-04-01 12:39
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
LOL
So many Years i use Mobilfight and again a interesting question i never think about.

I just test it and would say NO.
The order is pretty sure the sequence you create the Devices.
*******

For me this "problem" was not visible cause i simple create Devices with a "plan" in one row ..... And not just for Fun step by step..... So i know before i start what device is set to what pin. And i simply start at lowest Pin and go forward.
So Yes. My Devices are in Sequence of Pins. But just cause i create them in same sequence, too!

Summary. I think this is not a Problem. 99% of Users not care about sorting of Devices in that list.
After creating them there is normaly no reason to ever come back to this /setting/Boards Tab. And after choose them the sequence in Drop down is alo no longer interesting!
If you like a other sequence simply delete the Devices..... And create them new in order of Pins..... And for NExt Board think about sequence before you create them

***********
If Stephan or Sebastian think different then lets talk..... For me this is not a Problem and MF should stay in current system.
Good Luck !
2020-04-01 16:07
Avatar
MustangMig
Posts: 32
Hi Pizman82.
Done, it works and thank you.

In my opinion it is essential to have the various Buttons etc. in order of Pin, this to simplify the wiring.
In fact in this way from Button 1 the wire for Pin 1 comes out, from Button 2 the wire for Pin 2 comes out, etc.

If, on the other hand, they were NOT in the order of Pin, we could have, for example, that the wire for Pin 6 comes out of Button 1, the Wire for Pin 3 comes out from Button 2, etc. That is, a chaos of crossed threads.

As you rightly say, it is essential to first design a "plan" with the pins in sequence.
But despite the "plan", the error that forces you to redo everything can always escape.

For this reason I think it would be very useful to have the possibility to change the Pin in MobiFlight, and a final command of "SORT by PIN".

Is it appropriate to talk about it with Stephan and Sebastian? ... :thumbup:

Thanks again and bye.
2020-04-02 12:48
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Maby You missunderstand.....

We just talk about the "optic" of that list ( in Settings/Mobilfightboards) and also the optic of the Dropdown when you choose for a device.

The used Pin can be changed also today by a simple click....
Lets Say your Device is called "Button 5" is using PIN 8 at the Moment.
You can simply click the name of "Button 5" and you can rename it to "Button 8" for example. Also inverted you can change the Pin of a existing device. Click on Button 5 and choose in Dropdown a other Pin.... So change it from current used Pin 8 into Pin 5 for example.
After your settings you need tu press UPLOAD to finaly save it.

But sure.... The Device will be already in same position in that list now ( Whatever you change Pin or name) cause list show just the timeline of creating.
But again.... I not undertand the problem. This will not be visible finaly.... not change electrical setup or wire logic.


Last Note: Technical it should be possible to sort it already now with a trick.....
You can save your current file in a *,mfmc Backup File.
I not try it myself but you can edit this file with a Text Programm.... Maby you can simply copy paste the lines here and change the sorting.
Save it at the end and then Start Mobiflight.
Go to Settings and now LOAD the reworked mfmc file and UPLOAD it to the Board.
If i´m right then All Pin and Name settings are the same ( cause you just change the sorting) .... But the sequence of Entrys in that list should be like in your reowrked file now.
Good Luck !
2020-04-02 13:42
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi,

So I think that as long as it is only about buttons, you can follow a sequence. This works as long as each device only occupies one pin.
What if a device has two pins (encoder) or 3 pins (LCD, 7 segment) or 4 pins (stepper).

You could perhaps put the start pin in front of the device name, then you can see where devices with multiple connections are.

But basically, sorting here is not a good idea. Then, when planning, which is done on paper or in a program, you can pay more attention to a certain series of fologists. These are the service documents that you draw in the event of a defect.

I would then consider the sorting of the configs more important. But that's another topic ;-)
Grüße,
Stephan (Time: UTC+2)
2020-04-02 19:19
Avatar
MustangMig
Posts: 32
Pizman82
It is possible that it is misunderstood, it probably depends on the fact that we dialogue in three languages ​​(we translate from German to English and Italian, and then the opposite). In this three-fold passage, automatic translators are likely to lose the sense of some passage.

You're right, I verified that, in addition to the name, you can also change the Pin. I had already tried but I don't know why I hadn't succeeded (I'm a MobiFlight neophyte and maybe I hadn't uploaded?).
So changing the name AND PIN, I can put the devices in Pin order, as well as insertion.

Your other suggestion to edit the mfmc file also works, and it's even simpler.

Thanks and hello.
2020-04-02 20:47
Avatar
MustangMig
Posts: 32
Hi Stephan.

I had not yet considered two-pin encoders. As soon as possible I will test, and I hope to draw the correct conclusions.

No translator translates your word "fologists" to me, can you give me a synonym?

Thanks and bye.
2020-04-02 20:49
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
LOL - fologists is a typing error of mine - I mean with that a certain order. The sentense is correct so:

Then when planning, which is done on paper or in a program, you can rather pay attention to a certain order.

You're right, encoder have three pins but for the mega you only need two, the third is for GND. If the encoder has a push button he has 2 pins more - one for a mega pin and one for GND.
[Last edited by StephanHo, 2020-04-03 00:20]
Grüße,
Stephan (Time: UTC+2)
2020-04-02 23:02
Avatar
MustangMig
Posts: 32
Hi Stephan.
Thanks for the clarifications.

I am having difficulty setting the Encoder (Elma E33, 16 detents, 8 pulses):
1) In the Input tab, ask for Set Value "Use Expressions like $+1, etc.". But I don't know what to insert.
2) In the Settings it asks Type: "2 detent per cycle (01,10)". It's correct?

On the previous Cockpit, in the Board Configurator Leo Bodnar asked "Encoder type on each input pair", I entered "1:1" and it worked well.

Can you please suggest me what to insert, or show me a tutorial, or where the topic was covered?
Thanks.
2020-04-03 13:18
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi,

the settings for the Elma "2 detent per cycle (01,10)" are correct.
In the Input tab you have defined an encoder so got to the field with the three points ("...") and click it.
The InputConfigWizard open. First you choose the module the encoder is on, then chose the device.
At the input settings you choose only On Left and then On Right
On Left you choose as Action Type Event ID
On Left for the PMDG you take i.e. for COM1 the EventID 70359 and as Parameter 8192 (that's the value for mousewheel down)
On Right for the PMDG you take i.e. for COM1 the EventID 70359 and as Parameter 16384 (that's the value for mousewheel up)
Expressions are not needed an in standard you also do not need the preconditions and last but not least you do not need the $-value.
The two fast-tabs can be ignored.
Grüße,
Stephan (Time: UTC+2)
2020-04-03 19:07
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Just to avoid confusion.....

Stephans recommendation was for PMDG. I not knwo if you use this.

If you use for example a AddOn that work with Offset Set System then your right... Then you must use Offsetadresses and Values like $+1 and NOT Event ID´s

Basicly we can say..... A Encoder is technical nothing else like 2 Momentary Buttons .... If you turn it to the Left then on every signal it is simmular you press the LEFT Button .... And on every rightturn Signal the other Butten is pressed 1 time.
So if you use Input Typ "Encoder" then you have two Tabs.... "On LEFT" and "On RIGHT" The command you use here ( whatever EventID, Offset, Key, Vjoy and so on) is executed one time.... On every detent you turn the encoder in this direction.
Good Luck !
2020-04-03 19:30
Avatar
MustangMig
Posts: 32
Guys, thank you for your kind replies.
I have tested the Encoder, with the values you have told me, but it only works with NAV Frequencies.
I tested all the "Autopilot ... Value" commands and it didn't work with anyone.

I set these values:
Input / Action Type "FSUIPC Offset" (I don't use PMDG)
Input / Set Value "$+1"
Settings / Type "2 detent per cycle (01,10)"

When I operate the Encoder, the TX Led on the Arduino flashes both with the commands that work and with those that do not work (it does not flash at the first impulse, but from the second onwards).
What to do?
Thanks
2020-04-04 13:05
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
iconMustangMig:



I set these values:
Input / Action Type "FSUIPC Offset" (I don't use PMDG)
Input / Set Value "$+1"
Settings / Type "2 detent per cycle (01,10)"



We not say you should use $+1 ..... That was a Example !!

You also not tell us above what Offset you choose. Every funtion use a other Offset. And every Offset can work different. $+1 work only for some rare systems. Motly you must calculate the value from a difficult raw Data. Like your Value is 0-359 But the Offset show 0-65535 So you must calculate that a degrees if for example 182 so here $+182 is correct. Finaly if you use a AddOn it can be again use a different Logic.

Tell us:
What Sim,
What AddOn Aircraft OR if you use Stock aircrafts
What Function you like to controll.
Then we can help you and show you how you can research that data yourself for the next switches you like to build !
Good Luck !
2020-04-04 16:57
Avatar
MustangMig
Posts: 32
Hello.
I'm doing the tests with FSX and the Stock Aircraft Cessna 172 Garmin1000.
But the tests are preparatory to the construction of the next Cockpit, with the AddOn Citation Mustang of Fligth1, and the Prepar3D simulator.
The functions I intend to control are ALL those of the Mustang Flight1.

Well, I understood the meaning of "Set Value $ ..." and its formula (proportion 360°:65535=1°:182), so I was able to test the Encoder with the "Autopilot - AP Heading Value" function.

I set Settings "2 detent per cycle (01.10)". OnLeft "$-182". OnLeft (Fast) "$-1820", etc. It works but pretty bad, here are the reasons:

- He is "lazy", that is, he often does not react to the first shot, but after two or more shots.
- Sometimes the first shot does it by turning it backwards, and the next corrected.
- Turning the Encoder, when the bug arrives South (180°) it stops, and to go further you have to make it make the opposite turn of about 360°. This serious behavior makes it practically unusable, and obviously it does not exist in any other simulator, nor in the real plane (I avail myself of the advice of a friend of mine, a true Mustang pilot).
- OnLeft(FAST) is extremely "lazy", and to make it work I have to rotate the Encoder at an unnatural speed.

Can these problems be remedied?
Or does the poor reactivity depend on the limits of the Arduino Mega?

With "FSUIPC Offset" many commands are missing, some I have tested them with "EventID" and they work.
Finally I tested a Switch with OnPress Value "if($=1,0,1)" and OnRelease "if($=0,1,0". It works but is it correct or can it be done more easily?

Thanks for what you tell me.
(My previous Cockpit is this https://www.youtube.com/watch?v=zbgtj7bT5xE).
2020-04-05 13:38
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
You mix up again mutliple factors.

About Lazy.... this mostly occure with wrong settings.

Get sure in "settings" the "Logging Mode" is Disabled ( Only use it to find problems.... Cause this extremly slow down and laggy the system.... Specialy Encoders)
Also check FSUIPC Polling Rate in the Settings. It should be as fast as possible aslong system is stable..... I got 200 or 300 here. At 500 Encoder got delays mostly.

About your Input Problem....
Also This is explaned multiple times. Some Offsets in FSUIPC are Signed or Unsigned.
That mean Offset go for example from 0-255 or it go from MINUS - 128 to +127

If a offset is readout in wrong format then it will not work correctly.... Cause in your case after 179 ° there is no 180 there is -180 now.
This need to be recalculated in your Formula.
Same with a "Swap" If you say $+182 .... What happen on highest Point when the Value is 359° or 65535 ??? Then you can not Add again 182 cause that is abolve the maximum limit of that Offset. Here you need a Logic like "If Value is between 0 and 358 ° then always increase by 1 degree.... But at 359 not Add 1 Degree... Start at 0° again !
Same on other side.... From 1-359 we can decrease by 1 degree.... But at Value "0" a lefttrun must set 359 instead of -1
If Vlaue would be 0-359 the On Right would be something like if($<359,$+1,0) For on left if($>0,$-1,359)

In easy words... Those formulas need a advanced knowledge about Offsets, Math and Logic funtions. Thats why mmost Cockpitbuilders buy a AddOn that work with eventID or Key and Joystick Buttons instead of difficult Offset Calculations.


About missing Offsets.
NO Everything form Standard Aircrafts got a Offset.... Also things that have no own EventID.
You mean the Offset is not in MobiflightPresets... Thats right.... But it is listed in the PDF Manulas of FSUIPC.... So you need to search for them .


About your IF Formula.
Basicly corroect way but wrong usage.

If we talk about a Latching switch then we can not use a toggle.... Latching switches got a fixed ON and OFF position... So The ON must set the Offset to 1 and the OFF must set to 0 ( Here On Press Value 1 On release Value 0 ) Not use your If-Else here !!!

A Momentary Switch use a Toggle.... So if we press it we like to toggle from 1 to 0 or from 0 to 1 but here you need no Release.... if($=1,0,1) on Press is enough, Then with every press it toggle between On and Off.


******
At last.... Your Mustang:
Please research before you startup building if Mustang AddOn is compatible with FSUIPC.... If NOT then you can not use Mobiflight to controll it.... Or it need a lot of work to implement Mobiflight by hand with some own written scripts


*******
Hopefully i gave you some usefull information !
Good Luck !
2020-04-05 18:40
Go to page 1Go to page 012Go to page 2Go to page 2