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
ViniciusQuadros
From: Macapá/AP, Brazil
Posts: 8
Hello Folks!

I'm having a issue. I hope you all can help me.

I bought a two-seesaw key to simulate the master alternator and the master battery of Cessna 172.

I connected the first seesaw key to arduino and upload the config to mobiflight using a button as an input.

I set, on press, the offset "0x3101", Int, Size 1, Mask Value with 0xFF, Value 1.

I set, on release, the offset "0x3101", Int, Size 1, Mask Value with 0xFF, Value 0.

The key worked great. When I lift the key, the alternator lift on the simulator.

The same occurs when a down the key, the alternator down on the simulator.

The problem is... If I change alternator on the simulator with a mouse click... and then... lift or down the seesaw key... the moviment on the simulator be opposite of the seesaw key. Example: I lift the seesaw key, and the alternator on the simulator turns down. I down the seesaw key, and the alternator on the simulator turns on.

How can I solve this?

I know that I can adjust this mannualy (with mouse clicks). But I don't want to adjust this everytime I'm planning to fly. I'm saying this because it's possible to load the airplane with some switches lift or down, differently of the switch positions of the home cockpit.

I apreciate your help.

Sorry for any mistakes in English. I speak portuguese (from Brazil).
2019-07-24 17:46
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3969
Supporter
Hi

You talk about two different problems.....

1. About your switch.... We must split between toggle and set functions.
A Toggle Function is normaly used by momentary buttons.... so a press simply "swap" the function .Mostly Bool things like ON/OFF but also row toggles like Press1 set to 1 Press 2 set to 2 Press 3 set to 3 and so on.
THOSE Toggle Functions are Problematic when you use a latching switch ( Like yours) cause here a missing Input command or a wrong startup state ( or a manual mouse input) let the system get Non-Sync. ( Exactly what you describe)
BUT: If your configs are correct then this can´t happen in that situation.... Cause your Input ( Offset 3101) is a SET Offset.
Set Offsets not "toggle" they set to a state....
In your example: On Press set switch to 1 .... On Release set switch to 0 ....... If your switch is unsync by a manual Mouse Input ( For example ON in Sim but OFF in Cockpit) then the next Moving ( From OFF to ON) occure in nothing cause you try to set Sim to ON but it is still ON.... So nothing should happen but your switch is sync again now.

So.... Please check your Input configs.... and your System. I Not try out a.t.m. but Offset looks ok.... So a Release ( Offsetwrite to 0) can NOT set the switch to ON as you say... And also not inverted, too. Check if you have a issue or maby just observe it wrong.

***************
About the basic Problem:

Whatever in your situation this is solveable with the correct config..... The Main Problem is not the inverted Moving.... its that Status of Cockpit is not simmular to Sim status.
Here we have some ways to go....

1. Auto Sync
Mobiflight got a Sync Function ( Can be set to a fake key ) If you press the key then ALL Inputs are send in a row and set Sim to the current Situation of ALL your switches.
Problem: This work NOT for ON-OFF-ON Switches. Its High recommend to work with ON-ON-ON Switches if you plan to use this !

2. Verry Simple.... NOT use your Mouse to make Inputs ! In a finished cockpit you will not need your Mouse.... So you will not use it anymore !

3. Startup State.
Most Users work with that.... They Load always the same File at beginning and have a little Checklist to bring ALL Non Momentary switches to the "standard" State that is occure in this save file. Then all is 100% Sync and stay so aslongyou have no misssing Event Bug or a System crash !
Good Luck !
2019-07-25 00:39
Avatar
ViniciusQuadros
From: Macapá/AP, Brazil
Posts: 8
iconpizman82:

Hi

You talk about two different problems.....

1. About your switch.... We must split between toggle and set functions.
A Toggle Function is normaly used by momentary buttons.... so a press simply "swap" the function .Mostly Bool things like ON/OFF but also row toggles like Press1 set to 1 Press 2 set to 2 Press 3 set to 3 and so on.
THOSE Toggle Functions are Problematic when you use a latching switch ( Like yours) cause here a missing Input command or a wrong startup state ( or a manual mouse input) let the system get Non-Sync. ( Exactly what you describe)
BUT: If your configs are correct then this can´t happen in that situation.... Cause your Input ( Offset 3101) is a SET Offset.
Set Offsets not "toggle" they set to a state....
In your example: On Press set switch to 1 .... On Release set switch to 0 ....... If your switch is unsync by a manual Mouse Input ( For example ON in Sim but OFF in Cockpit) then the next Moving ( From OFF to ON) occure in nothing cause you try to set Sim to ON but it is still ON.... So nothing should happen but your switch is sync again now.

So.... Please check your Input configs.... and your System. I Not try out a.t.m. but Offset looks ok.... So a Release ( Offsetwrite to 0) can NOT set the switch to ON as you say... And also not inverted, too. Check if you have a issue or maby just observe it wrong.

***************
About the basic Problem:

Whatever in your situation this is solveable with the correct config..... The Main Problem is not the inverted Moving.... its that Status of Cockpit is not simmular to Sim status.
Here we have some ways to go....

1. Auto Sync
Mobiflight got a Sync Function ( Can be set to a fake key ) If you press the key then ALL Inputs are send in a row and set Sim to the current Situation of ALL your switches.
Problem: This work NOT for ON-OFF-ON Switches. Its High recommend to work with ON-ON-ON Switches if you plan to use this !

2. Verry Simple.... NOT use your Mouse to make Inputs ! In a finished cockpit you will not need your Mouse.... So you will not use it anymore !

3. Startup State.
Most Users work with that.... They Load always the same File at beginning and have a little Checklist to bring ALL Non Momentary switches to the "standard" State that is occure in this save file. Then all is 100% Sync and stay so aslongyou have no misssing Event Bug or a System crash !



Hello my friend!

Thank's so much for your contribution.

Very, very helpful.

Arriving at home, I'm going to try your suggestions and take pic of my inputs' configs and send here to your view. I think if I show you, you can help me find some errors.

For now, please, tell me something... How can I enable "Auto Sync"?

Thanks again!
2019-07-25 16:17
Avatar
ViniciusQuadros
From: Macapá/AP, Brazil
Posts: 8
Hello Folks...

Here are some pics on how my settings are configurated.

Just to explain... With this settings below, I'm having the issue I told on the first post of this topic.

Hope you all can help me.


Hardware Settings








Software Settings









Thank you all.
2019-07-25 19:27
Avatar
ViniciusQuadros
From: Macapá/AP, Brazil
Posts: 8
Here is a video of my issue using the settings show on the pics above.

https://youtu.be/UpQxM85a5C4
2019-07-25 19:44
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3969
Supporter
I dont see the datasheet of your switch !

This is a ON-ON Dual switch . 6 Pins.... 3 Pins on each side for each switch.
In Case there are 3 Pins for eachTWO-Position switch we can say this is a ON-ON switch and not a ON-OFF.
(Again i see no Data Sheet. If there is a included LED the pins can be different and its a ON-OFF finaly.... But i will say 99% its ON-ON by check the picture you send)

Your Issue !
Without Dtaseheet i can just guess.... But normaly the MIDDLE Pin is GRD on those switches. Your Picture show me that you have set the middle Pin (RED) to Pin 28 and the WHITE cable to GRD .... Thats WRONG !
Simply change sequence.... Upper Pin of Switch must set to Pin 28 in your case.... Middle Pin to GRD on Mega.

Alternate:
In Case you have a ON-ON switch you can define 2 Devices, too. So you wire Upper Pin to Pin 28 and create a Device "Button" like "Master Alt ON"
You also wire the lower Pin to a free spot like Pin 30 ... Device again Button Name it "Master Alt OFF"
The Middle Pin is wired again to GRD
NOW you make 2 Input Configs (Instead of 1) The first use the Upper "button" and have only ON PRESS to Set Function to 1
The second Config use as device the lower button..... Also ONLY IN PRESS and set Function to OFF.

******************
Both is possible.... Your first technic is more easy and profitable.
Simply change the 2 wires together..... Then all should be fine !
Good Luck !
2019-07-25 19:54
Avatar
ViniciusQuadros
From: Macapá/AP, Brazil
Posts: 8
Thanks for your response.

I'l try right now.

Here is the datasheet (it has a neon led):

2019-07-25 20:01
Avatar
ViniciusQuadros
From: Macapá/AP, Brazil
Posts: 8
The key I bough is exactly the one above.

Here is a better explained datasheet:



Note: I tried change the wires position (the middle one to the groun and the bottom one to PIN28)... but worked the same issue.
2019-07-25 20:12
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3969
Supporter
hhhm. Datasheet show me not what pin is what.
If you have a volt meter you can find it out.

A Other way is to simply check it with Mobiflight.

Make a new config .... Create a Input Config..... with your Button. then use ON PRESS the Typ "Key send" and choose for example "A"
Use for On Release also KEy send and use "B"

Then choose in Settings Tab "Offline Mode" OR get sure you do the testings aslong Sim is running in Backround.
Open a Text Programm like Editor or Wordpad ..... Run Mobiflight ( And Sim if no Offline mode is enabled) and then Klick to the Cursor in the text Programm.
Press some buttons on your keyboard to check if you be able to write.
THEN Use your Button.
If all is OK then the Button should write A in One Position and B in the other.

If this work fine then te problem is in FSUIPC and we must check the Offset. If your test shows a problem like also inverted commands.... Double Commands etc then the wire logic is wrong !
Good Luck !
2019-07-25 20:37
Avatar
ViniciusQuadros
From: Macapá/AP, Brazil
Posts: 8
It workerd well.

When I lift the button, writes letter "A" on the notepad.

When I down the button, writes letter "B" on the notepad.

Using the two grey terminus (not using the gold one). The middle one is set to GND and the bottom one is set to PIN28.

But the issue still ocours...

Don't know what else to do :(.

NOTE: the offset code I got from project magenta's website.
2019-07-25 20:59
Avatar
ViniciusQuadros
From: Macapá/AP, Brazil
Posts: 8
Another Note:

I tried to use this same key with the function of strobe lights.

Worked perfectly! Even when I change the strobe switch with mouse click I change the key position two times and the simulator sync correctly with my hardware.

The issue appears to be only on the master alternator...

Other question... How can I configure the auto sync?
2019-07-25 21:05
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3969
Supporter
OK.
Must check the Offset maby.
Some things are not logical 100%. If there is a issue in FSUIPC we can not use it as expected.


About Sync.

This function can be choose as a TYP of Event.

Simply set a Button for example somewhere hidden in your cockpit.... Create it as a "Button" Device.
Then make a INPUT Config....Use this Button ... And set for ON PRESS as TYP Synchro Function.

Then a press will start the sync sequence. ( sure only if MF is running)
Good Luck !
2019-07-25 22:16
icon