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
wokkelp
Posts: 7
Dear fellow enthousiasts,

I stumbled upon Mobiflight after looking for a way to create button boxes for MSFS2020 that also support outputs.
What a great product and such early adopters with MSFS2020.

I installed everything, took out my Arduino Mega 2560 (fabricated by Velleman) and followed the first two tutorials.
After a few small hickups I managed to get the output to work when the parking break is set (the led on the breadbord turns on), yay!
Then onto the button. I have a few different buttons but tried it with the tactile switch as I could just put it on my breadbord with jumper cables.
I followed the steps but to no avail...

I know MF works because the LED turns on when the parking Break is set.
I know FSUIPC7 works because the LED turns on when the Parking Break is set.
In the FSUIPC 7 Console Log I see the output when I set the parking break by hand or by keyboard.
This is the output from MSFS2020 in FSUIPC7:
iconCode:
 3241469 16772 *** EVENT: Cntrl= 65752 (0x000100d8), Param= 0 (0x00000000) PARKING_BRAKES


However when pressing the button, nothing shows up in either logs, not in FSUIPC7 and also not in MF.

Here is the set-up of the button:



Edit:* I am sure I added the button correctly and it is hooked up according to the tutorial.
Too bad there is no "test" option for inputs.

Can anyone help me?
(I'm running the latest version of MSFS2020, with the Japan World Update)
[Last edited by wokkelp, 2020-10-02 16:20]
2020-10-02 14:45
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

There is a simple testing Option..... Enable the Logging Mode ( typ DEBUG) ...... Then you got a String below the Config Window
( EDIT : On the screenshot i see your Logging is still on.... Just check if your in DEBUG)

If you now press a button while in RUN mode you see there messages. At first if a PRESS or a RELEASE is detect and what device send this.
It also tell you if a Config is connected to that Input and if thos configs execute a comand.


About Problem:

1. Try another Value. The Parking Brake goes from 0 to 32767. Maybe "1" not work cause here the brake is just set by 0,1% ..... Simply try value for Press 32767 Release should be OK with 0
NOTE: In the FSUIPC Lists of the V7 BETA this INPUT is marked as "Not tested- GREY" Means it is no garantee this is already working !

2. Try EventID . 65752 Parameter 0 ..... Thats a toggle But better then a missing brake.

Summary: Keep calm. After FSUIPC7 final release all this problems are gone !
Good Luck !
2020-10-02 16:27
Avatar
wokkelp
Posts: 7
Thank you for being elaborate pizman! Apreciate that.

I have more questions than before though...
Why the different value? The tutorial stated 0 or 1. Isn't the parking brake a lever in a plane? Like on or off? (unlike the brake pedal, which can be pressed with a certain force?)

1. I don't see anything in the debug console of MF, and I've even tried just shorting out the pin with ground, without a button. Nothing..
Do I really hook up any pin with ground and a button inbetween? No resistors or anything?

2. Changing the FSUIPC Offset (0x0BC8) value to 21767 didn't work.

3. Changing the Action Type to EventID with 65752 and a Parameter of 0 didn't work either.

I think something else is going wrong, I also tried another Pin, 42 instead of 40 but no results...

The Pins aren't "high" with the current configuration.. When I put an LED in the button circuit, pressing the button does not light up the LED.
Are you sure I should hook up Pin 40 -> Button -> GND ?
[Last edited by wokkelp, 2020-10-02 18:09]
2020-10-02 18:03
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi,

all pins of the Mega are on high(+5V) via internal pull up resistors.
All switches are, if in closed mode, connected to GND and via the switch to the pins. What's irritating about that?
Grüße,
Stephan (Time: UTC+2)
2020-10-02 20:18
Avatar
wokkelp
Posts: 7
Mine doesn't seem to be set to high (+5v) because when I replace the button with an LED the LED lights up very very faintly.
Is there any way I can view the code being uploaded to the arduino?

I think the problem lies right at the hardware level and not within FSUIPC.

I plugged the LED straight into the 3.3v and it is less bright than on the Pin that is supposed to be High for the button.
[Last edited by wokkelp, 2020-10-02 20:46]
2020-10-02 20:37
Avatar
wokkelp
Posts: 7
mmm.....

If
iconCode:
pinMode(ledPin, INPUT);

and
iconCode:
digitalWrite(ledPin, HIGH);


Then the LED attached to that Pin is dimmly lit.

If however
iconCode:
pinMode(ledPin, OUTPUT);

and
iconCode:
digitalWrite(ledPin, HIGH);


The LED attached to that Pin is fully lit.

(I'm using a resistor to protect the LED from burning out, don't worry).

It seems that the Arduino 260 is functioning as it should.
I cross checked it with an older Genuine Arduino Uno I had laying around and I had the same results.

So, the problem is not with the arduino but somewhere in MF or the configuration of it.
2020-10-02 21:14
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Sorry, but I don't have promlems like yours.
Grüße,
Stephan (Time: UTC+2)
2020-10-02 22:39
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi again

Please stop thinking about the Controller like a arduino ! If you flash Mobiflight Firmware on the Board and it work as a "Mobiflight Board" then all the logics and systems from the old Arduino IDE are gone. Then this is technical no longer an Arduino. It´s a "Mobiflight Board" now ! .

As i said.... If you flash firmware correctly and you create a device.... Eg.g. a Button on Pin 40 then Mobiflight firmware "pulll up" that button.... And if that button close a circuit to GRD then a PRESS is detected.... If the circuit to GRD is broke again (button release) then also this is detected.


************
I can not see your system. So you need to do the testings yourself. OR you call me or Stephan on discord. With Shared screen we can observe the situation and order you to press the button. Then we can see the result same way as we would seat on your table next to you.
Good Luck !
2020-10-03 00:58
Avatar
wokkelp
Posts: 7
I don't know what happened but it works now.

I went onto discord and DocMoebiuz helped me out.

What I did that apparently fixed the problem.
- I reflashed the arduino for like the 10th time.
- I removed all config, and created an led, a button and a rotary switch (vma435)
- I then set MF to off-line and pressed play, I had partial response in the debug console, which was hopefull.
- Then I tried tinkering some more and looked up the datasheet of my vma435

I used event ID's for the inputs, from the dropdown list in MF.
I noticed the rotary switch didn't properly respond so I also hooked up the 5V to the rotary switch, then every "click" registered.
I tested everything in MSFS2020 and It works! Even the button, even with the parking brake, that didn't previously.

I think that the flashing proces is not always going as it should and I just had some bad luck along the way.
FYI, I didn't change anything tot the USB set-up on my PC or install any windows updates or other drivers.

Never flashing that thing back to arduino :P
2020-10-03 11:09
icon