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! 

icon
Avatar
MGReyes
Posts: 6
Hi, I'm new in MobiFlight and I'm trying to test each type of component, and I'm having troubles with buttons (the other components I could runs ok). I'm testing in Xplane 11

I tried with different configurations but in one video I saw this:

On Press
Action Type = FSUIPC Offset
Use presset = Radio - COM1 Switch Freq
Offset = 0x3110
Value Type = Int
Size in bytes = 4
Mask value with = 0xFFFFFFFF
BCD Mode = NOT checked
Set Value = 66372

On Release
Action Type = FSUIPC Offset
Use presset = Radio - COM1 Switch Freq
Offset = 0x3110
Value Type = Int
Size in bytes = 4
Mask value with = 0xFFFFFFFF
BCD Mode = NOT checked
Set Value = -66372

I tried also with other pressets related to the radios but not works (yes if like use it like a switch. For example with taxi light).

About the connection of the button I try with two config but in an arduino mega:



If you could help me, I would appreciate it.
[Last edited by MGReyes, 2018-06-26 03:23]
2018-06-26 02:55
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4703
Supporter
Hi
Welcome to Mobiflight.
Here some mistakes are done.

At First... About electrical Setup.
Please check our tutorials for that !!!

A 5 V is not need for Buttons.
The PIN is basicly HIGH .... You Build a Line From PIN to GRD. If Line is closed then Arduino see a PRESS . If Line is NOT closed ( In case of switch is off or not pressed) then Arduino see a RELEASE .
So please NOT use resistor or 5v here. your shematic of Picture 2 is correct.

Note: In Pic a you set 5v to a High Pin... Normaly this is not a problem (whatever it´s wrong) but "maby" This kill your Board. You should basicly check function of your pins/board external or via Mobiflight Logging Mode..... We not need to talk about Configs if the button/Pin/Board itself is already broke.

****
About Configs.
NOTE: The Presets are NOT working 100%. We not support that since long time. See it just like examples from the early Days of Mobiflight.
For example the Preset for "Freq switch" are using Offset 3110 ! THIS was a system that not be used after maby 2016. Today we use EVENT ID instead of that methode.
On That Point i will say appology for your trouble.... Sebastian realy should remove Presets ( or rework) it in the future ! Or maby a Information about that should be done by Sticky!


Solution:
For Freq Swap you can use OFFSET :
iconQuote:

3123 1 Radio Use/Standby swap toggles, Write bits to operate toggles.
Don’t bother to read it, there’s no meaning to anything read.
2^3 COM1 swap
2^2 COM2 swap
2^1 NAV1 swap
2^0 NAV2 swap



OR you use EventID : COM STBY RADIO SWAP 66372 ( Use EventID as Typ instead of FSUIPC Offset in that Case .... Parameter is 1 or 0 i think)

Additional Information:
- You need no release command in that situation
- You should tell us what system you use and what aircraft. All basic Information in this topic are for P3D/FSX and for STANDARD Aircraft ( No AddOns)
Good Luck !
2018-06-26 03:26
Avatar
MGReyes
Posts: 6
Hi! Thanks for your response.

Unfortunely I tryed with your solutions but continue not working. I tryed with another pin and also not work :(
With the second solution porpossed I tryed with Parameter 0 and 1. And with 'On Release' and without it.

I'm using Xplane 11 with Cessna 172 and Baron 58.
Running in Windows 10.
The XPUIPC Version 2.0.4.8 64 bit
2018-06-26 03:55
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4703
Supporter
iconMGReyes:


I'm using Xplane 11 with Cessna 172 and Baron 58.



Thats the Problem !

Mobiflight is basicly designed for FSX and P3D . Xplane itself not work with FSUIPC ( And thats the only way Mobiflight can talk to a sim)
As you said you have XPUIPC ... So You can controll XPlane, too. BUT in a verry limmit and basic way !
Xpuipc include only the "standard" range of Offsets ( No special AddOns are included. Only the Standard Aircrafts and AddOns that use that standard stuff)
Also Xpuipc ( as i know) NOT accept EVENT ID ( Thats a function of FSX/P3D ONLY )

***
About EventID :
We can controll lots of stuff via Offset.... But mostly in a difficult and uncomfortable way.
For example to Increase Altitude with a Encoder we not can write a Offset simply with "1" and then Altitude increase by 100 ft . Here we must READ the Current value ... Must recalculate it ( Cause ALT is not shown 1:1 The Offset value shows for example the Altitude in Meters instead of feet and ,multyply by 65536 .) So we need to transfer it to feet and divide it through 65536 and then multiply it with 100 to get the value for 100ft.

So in FSX/P3D we got EventIDs.... There all this difficult Stuff is done by the Sim itself. And we only say "Execute Event Number xyz" and the Sim do exact what we need.

***
Solution for you:

1. Again please check your Hardware youreself. I can not see if your Board is Ok. Before you search for a software issue for lots of hours get shure your board is working fine.

2. For XPlane you have 3 possible ways.

A ) The easy way is to work with Keycommands or Joystickinputs. ( You define controlls in XPlane internal Keybind section. Thats nearly same like the EventID in FSX.)
But there you need no Mobiflight. Joysticks must be done with a HID Controller
Key Commands can be done with Mobiflight ( Whatever there are other solutions too.)

B ) If you use a Standard Aircraft ( Or a AddOn that work with standard stuff) then controll it via Offsets !
As i wrote in last reply you can controll for example the COM1/COM2 and NAV1/NAV2 swaps with Offset 3123
This is a BIT Based Offset. You need Bitmask for that ! ( Checkthe Manual or use Forum search. OR Ask here again if you have trouble with that)
NOTE !! I not know if XPUIPC include that Offset 100% correct. Normaly Yes. But i not use XPlane and con NOT confirm this !

C) You use a Other Programm. For example ArdSim ( I Hope thats the name... I never used it) is specialy for XPlane Controlls.
Bote THIS is completly external of Mobiflight. Other System, Other Hardware maby, NO Support from my side !

Test out this stuff. Call for help if needed. Have fun !:thumbup:
Good Luck !
2018-06-26 13:23
icon