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! 

Go to page 1Go to page 012Go to page 2Go to page 2
Avatar
capitainekurck
Posts: 24
hi all

i start with mobifligth and i start to build my MCP. i first try to understand how to program mobiflyght reading the forum but it difficult.
i try to increase the altitude with a rotary encoder (for example) but i can't. I use a ec12 24 position encoder.

in mobyflight on the configure box i use event ID 70032 and on param -1 10 1 and 10 depending on fast or slow right or left turning. but it don't increase or decrease as a want.
sometime it increase by 1 or 100 or anything and most of time it do nothing

what s wrong ?

regards
L.S.
2019-06-08 20:01
Avatar
StephanHo
From: EDDG, Germany
Posts: 1261
Supporter
Hi L.S.,

you are on the right way. The EventID is correct so far. But the parameter seems to be the problem.
So think about how you do it on the screen. The you take the mouse - left click, right click, wheel up, wheel down.
If you link this knowledge to the EventID-list ( at the end) then you have your parameters.
Instead of 0 and 1 take 8192 for on right and 16384 for on left.

If you do not have the EventID-list, you can download it here: http://myhomecockpit.de/PMDG_737NGX_EVENT_IDs_SP1d.pdf

Exception: if you use the rightsingle mousebutton use the value 2147483648 but with a minus (-) in front: -2147483648. Otherwise MobiFlight indicates an error.

Please report how it works.
Grüße,
Stephan
2019-06-08 20:27
Avatar
capitainekurck
Posts: 24
ho Stephan.

so if i understand on each EVENTID of PMDG_737NGX_EVENT_IDs_SP1d.pdf the only parameter that you can give is the number who simulate a mouse action.
is it true ?

regards
2019-06-09 11:39
Avatar
StephanHo
From: EDDG, Germany
Posts: 1261
Supporter
Hi,

the hint on the mouse actions is nothing more than a copy of the actions on the screen. Many controls of the PMDG are performed on the screen with the mouse. So what could be more appropriate to use this handling with MobiFlight? These actions are logical and quickest to implement. Personally, I know of no other parameters and I have doubts that they exist.
Exceptions are the rotary switches. Here the parameters 0, 1, 2, 3 etc. are taken from left to right.
Sometimes you can get the parameters out by combining them with the offset list. Once you understand this, it's pretty easy to handle.
Compared to other add-on aircraft, the handling of the PMDG machines is quite simple.
Grüße,
Stephan
2019-06-09 11:56
Avatar
capitainekurck
Posts: 24
ok thanks i try with button and it work, but i still have problem with my encoder. i try all type detents and i can't make it work normally. i think there are not compatible with mobiflight.
i know that it possible to find the type of detent with 2 led i must find a link on the net.
2019-06-09 14:54
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2533
Supporter
This is not needed.

Google for the Typ of your Encoder.... Then you get a datasheet. Important is the Detent/Signal Resolution.

24 Position means 24 Detents pretty sure..... if it have 24 Signals its a 1:1 Encoder..... If it have 12 Signals its 1:2 and so on.
You can choose the Resolution in the Device Settings Tab...... Not forget to UPLOAD it again to the Board if you do a change here.

About Testing.
You can use the Mobiflight Debug String for that.... Or you set 2 simple easy things.... ( Ignore the ON FAST Tabs)
Use for example on Left "Key Send" "A" and on Right Key Send "B"
Then start a Writing Programm like EDITOR or WORDPAD. Run Mobiflight and Sim and this Wirting Programm.
Klick the Cursor and turn your Encoder..... It should now write AAAAAA or BBBBB if you turn it for a cuple of time.... One Character per Detent !
Good Luck !
2019-06-09 15:35
Avatar
capitainekurck
Posts: 24
yes you right with the notepad i find that it a 1 detent per cycle but i lose some "step", I can see it when i log event with fsuipc. perhaps it a problem of debouncing. or it's a too cheap encoder.
[Last edited by capitainekurck, 2019-06-10 02:43]
2019-06-09 20:16
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2533
Supporter
Lots of possible reasons.

1. Wrong electrical setup.... Maby a bridge by solder .
2. Broke Encoder (Internal shifting broke so some detents are not seen.
3. Bouncing

Or its a Software Issue.

Please try the follow....
In Mobiflight Settings please set....
A ) Logging Mode to OFF
B ) Offline Mode to ON

Now Startup just Mobiflight and Notepad. But NOT start the Simulator.
With "Offline Mode" the Keys are send whatever no Sim is connected a.t.m.

Then test again.... Missing Keys already there ???
If Yes then its a Hardware issue..... If Not then problem is maby System performance when running the Sim in Backround.

Please report final results !
Good Luck !
2019-06-10 09:04
Avatar
capitainekurck
Posts: 24
so i test it .
i try 3 differents encoders. 2 same encoders and 1 from an other sort. All are 24 detents 1:1. the first is soldered and the 2 other are connected with dupond wire. and i lose a lot of steps on all 3.

i try to do the same with an on off on switch and i change position on the swich as far as i can and i don't lose step.
i will try to test my encoder a test board and led.
2019-06-17 02:10
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2533
Supporter
You Mix up two facts i think....

WHERE do you miss the "steps" ??

As i said its different if we talk about FSUIPC or Mobiflight itself.

If you test it like i said ( Offline Mode ON Logging Mode OFF ) with Notepad for example then THIS is the Mobiflight Part.
If you turn for example 10 detents and you got 10 time "aaaaaaaaaa" in Notepad then Mobiflight work fine.
If here is a Problem then your Hardware is problematic (Or Mobiflight got a Bug)


If you now use for example Event ID for Course Selector Increase and you turn it but some steps get lost THEN The Problem is in FSUIPC or the Transfer to it is the Problem.

******
So please try it again with Notepad and your current Encoders. I think 95% that the problems are only in Sim.
If i´m right then you must change the FSUIPC Poll Rate to a different Value AND you must confirm again Logging Mode is Disabled !!!
Good Luck !
2019-06-17 05:35
Avatar
capitainekurck
Posts: 24
hello

I do exactly as you said. i test with notepad and mobiflight ( Offline Mode ON Logging Mode OFF ) without FSX and fsuipc. so i lose step between the arduino , mobiflight and notepad
2019-06-17 20:26
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2533
Supporter
Thats strange....

Another facts....

1. Is the missing of Steps systematic or random ???

If you lose for exampel every second step then its a resolution problem.....
If you loose always the same step ( for example with 28 detents always detent 11,15,16 then its maby a hardware problem inside your Encoder.

2. What about your turning speed.
Mobiflight split between fast and slow turns.....
If you turn fast then the "On Fast" command will be executed instead the " On slow" command.
I nver tested but "maby" without a fast command selected mobiflight simply do "nothing" when you turn fast .... OR It send also the slow command.

You can check this verry easy..... Use the same Testing ground like before .....
Make one Run without FAST Entrys ( not selected) and check results.
Then make a run and use for example On Left "A" .....On Left Fast "B" ........ On Right "C"......... On Right Fast "D"
Maby you can figure out that the missing Steps are simply On Fast executes,.
Good Luck !
2019-06-17 21:02
Avatar
capitainekurck
Posts: 24
hello

it's completely random .
I try 2 computers, 3 arduino mega et 3 different encoders and i got the same issue.
I try low turning and fast turning its idem

Is there someone who can use encoder without loosing step ?

Do you use interrupt in the library to catch the encoder step or not
I don' t know if it a problem with my hardware or with mobiflight but all hardware i test i got the same issue.

I m wery interested to know what sort of encodeur you use

Mine is:
https://www.ebay.fr/itm/5pc-Ec12-e12-audio-encoder-360-deg-rotary-encoder-lotus-15mm/201415040844?hash=item2ee5459f4c:g:rHQAAOSwER1a4ctg
https://www.ebay.fr/itm/10PC-Rotary-Encoder-With-Switch-EC12-Audio-Digital-Potentiometer-15mm-KQ-Handle/254275911955?hash=item3b34068113:g:V7cAAOSws0ZctOP3
2019-07-13 19:52
Avatar
capitainekurck
Posts: 24
Hi

I have made some search and i find on this site some explanations how to use encoder with arduino
https://www.pjrc.com/teensy/td_libs_Encoder.html#polling

so i wire the encoder on pin 18 and 19 who are interrupt pins of the mega and now i don't lose steps but for one detent i got 2 increments ( i must have A and i got AA).
so i try to wire one pin of the encoder on an interrupt pin of the arduino and the other on pin that is not an interrupt pin and it work fine without losing step and having one detent for one increment. Perhaps there is a problem with the library use to drive encoder in the arduino sketch. It seem that i still lose some detent when i turn it very fast but it difficult to detect it and it not a problem.

i still got a little problem but its not a really a problem. Is that i miss the very fist detent each time i change direction (turning right to left or left to right) but i think it a little bug in the sketch.

An other thing, the threshold between fast turning and slow turning is very high perhaps it depend of hardware and it will be nice if we can adjust it.

regards
L.S.
2019-07-31 12:39
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2533
Supporter
@ Captain Kirk
Here my knowledge is at the end. I not know how your arduino sketch work and how Mobiflight handling "interupt"
As i know no other users have basic Problem with Encoders in the "text editior" Test .... So "normaly" Mobiflight see the Inputs from the Encoders 100% . We know that there can be problems to execute the commands in some cases ( Loggin Mode Bug ) BUT i not can reproduce a Problem ( and not heard about) at the Input side from Arduino.

Sorry i can not help you here
******************

@ titobcn86
You already confirm/find out that your Encoder is work fine and Mobiflight see the commands.
YOUR Problem is simply a wrong config.

I not know what AddOn is used or if you fly with standard Aircrafts..... But your reported symptom show me simply you use wrong parameter and/or Offset.
Please check youreself Whats the correct offset to change AP Altitude and calculate the correct parameter.
Alternate is to use EventID instead..... Here you must not calculate it youreself !

If you work with a AddOn Aircraft like PMDG then use the correct Offset/EventID for that.... Nearly all AddOns NOT work with FSUIPC Standard Values.
Good Luck !
2019-08-02 13:09
Go to page 1Go to page 012Go to page 2Go to page 2