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
CptJocco
Posts: 4
Hi all,

First off, please bear with me as I am brand new to Arduino, coding...etc. I know computers well, have some knowledge of electronics (wiring, soldering, resistors...etc), but coding and the like is a new venture for me. That being said, I'm a private pilot and an avid lover of MSFS (been using it ever since it was just polygons and a black and white instrument panel). I want to start building my own home cockpit. So after finding out about MobiFlight, I bought an Arduino and am now starting the process, but I'm already stuck due to this firmware update problem.

The Arduino I purchased is a Arduino Mega 2560 R3 from SunFounder (part of like a "getting started" kit where it comes with a bunch of different components). The only thing I did before trying MobiFlight was I used the Arduino online editor to put a "blink" sketch on, and then a "button" sketch (where you can press a button to turn the onboard LED on). I then downloaded MobiFlight and started to connect it. It saw my Arduino but it failed on the Firmware update process. I searched these forums and saw someone suggest going back onto the Arduino online editor and running the EEPROM-Clear sketch to bring the Arduino back to brand new. I ran the EEProm sketch with apparently no issues. I then went back to MF and restarted it to try the firmware upload again. No luck. Here's the error from the log:

Error 9/9/2022 10:58:11 PM ExitCode: 1 => Something went wrong when flashing with command
"Arduino\hardware\tools\avr\bin\avrdude" -C"Arduino\hardware\tools\avr\etc\avrdude.conf" -patmega2560 -cwiring -P\\.\COM4 -b115200 -D -Uflash:w:"C:\MobiFlight\firmware\mobiflight_mega_2_2_0.hex":i

I would love any help please as from what I read, the Mega 2560 is supposed to work perfectly with MobiFlight, so I'm wondering if I did something wrong or if I got a bad module.

Thank you in advance for anyone's help.
Tom
2022-09-10 08:13
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

The Path looks strange to me.

Can you confirm you use newest Mobiflight Version ?

I wonder why the path or avrdude is different to MF Path ? Maybe this is correct but i'm not sure.
My idea.... If you use by fault a very old MF Version that not include the avrdude itself then it struggle maybe.


If you have newest version already....

Please make a standard testing....

1. Make a EEPROM Clear as you said.
2. Restart the MEGA (By press the button or by disconnect/reconnect it.
3. Then start MF while the Mega is connected.
MF should now "see" the Mega. You not have to go to settings or so and click on "Update Firmware manually"..... There should be a Popup like " NEw Board detected":
Simpyl Confirm you like to upload Firmware.

If this also not work....

Please change your USB Connection.
If you use a Hub.... Connect it directly to a PC USB Port.... Use another Port if you still are on the PC.
If you have a differen Cable from Mega to PC..... Use a other one.
I will say in 99% those issues occure in case of a bad Cable or a buggy USB Port !

LAST NOTE:
Also Cponfirm you have the right Drivers.
For CH340 Controller you need a special Driver !
Good Luck !
2022-09-11 01:46
Avatar
CptJocco
Posts: 4
Thank you for the reply. Here's some answers to your questions:

First a question - as I mentioned in my first post, I'm brand new to all this, so what is the CH340 controller you asked about and how would I know if I had the correct drivers (and if I didn't, where would I get the right ones)?

Regarding the version of MF - I was using the latest version (as I had just downloaded it from the MF website only 20 minutes prior). Granted MF updated itself today to the newer version, but as of yesterday I had the latest version (whatever the main download link took me to on the MF website).

The only thing I did in regards to file structure was to move the entire MF folder into the Prorgams (x86) folder. Otherwise I left everything as it comes.

I tried a different USB cable/port today with no luck.

I've done the standard testing - EEPROM, restart, connected the MEGA and then started MF - had MF detect the card and tell me it needs to update the firmware, and then it fails on the update.

Also, not sure if this matters, but MF and my MEGA are working just fine. I've already wired up some switches and LEDs and mapped them to things in the FENIX A320 (side question - is there a way to get a rotary encoder to respond faster? I have it linked to the Heading Knob, but it takes forever to spin through the headings. When I rotate the knob faster, the sim can't keep up - it changes the heading by one degree and then just stops until I stop rotating it. I have to rotate very slowly for it to keep up).

Thank you for your help!
Tom
2022-09-12 03:29
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi Again

About Problem.
We have some more reports now. Maybe there is a bug. It still can be a other problem on your side but just keep aware we checking this.
So have a look for Updates and Beta releases.



About CH340.
Mega Clones ( So boards like Sunfounder) can have 2 sets of USB Controllers.... The stock ones (same like original Arduino Brand) or the CH340.
Normaly this is written in the datasheet or the shop discription. You can also see this in the Devicemanager of Windows mostly.

The drivers for the Stock Arduinos are included in the Arduino IDE. So if you install that Arduino Stuff also all new Boards for Mobiflight (with that stock controller) work fine.
The CH340 Drivers must be downloaded by hand and installed.
E.g. here.... https://sparks.gogo.co.nz/ch340.html

NOTE: Not get confused..... CH340 Boards work fine (sometimes also without that drivers) e.g. for Arduino IDE and can be used but they not work with Mobiflight or other Apps aslong you not install those drivers.
Also not get confused if you say you buy a brand new board. Sometimes those Boards who come with that "laboratory stuff" , can include already a special firmware from Sunfunder e.g.
So they are technical not clean and need the eeprom clear.... Same like a new computer that already installed a lot of spam need a fresh windows before its "clean".





About Folder:
We normaly recommend to install MF in a "free" folder.
Windows secured folders ( like Programms X86 ) in theory work but you can get in trouble with write protection there. ( Thats why most Software today have a additional folder in the /user/documents area to allow writing of files.
With Admin Mode you can avoid this !
BUT
The most easy way is to install Mobiflight ( and also Sim, FSUIPC, AddOns and so on) in a fully free folder or better a HArddisk or partition.
E.g. c:/Mobi or d:/flightsimstuff/Mobiflight



About Encoder.
The speed of Encoder is not the problem.
Mobiflight handle it very fast.
The problem is mostly the Sim Interface.
Also a "wrong" or "bad" event can be the issue.
For example for a testing aircraft we had 2 Events for the HEading Bug. Both looks nearly the same. One was fast. The other allow only one detent every xxx milliseconds.
E.g. when the event include the Grafic Command that the virtual Encoder must be turned also... this can occur in delays.
For a Homecockpit we not care about if virtual knob is moving..... Its only important that virtual Heading is set!

So to figure this out you can test some other Events or you can talk to users on our Discord who use the same aircraft !
I just will say from basic Hardware side and MF Firmware there is no issue here cause it is pretty fast for other elements confirmed already.
[Last edited by pizman82, 2022-09-13 12:26]
Good Luck !
2022-09-13 12:21
Avatar
Johnny0357
Posts: 2
Hello,

I am having the same error message when trying to update the firmware on my boards. I am using four different Arduino Mega 2560's. I have MobiFlight 9.5.0 installed. I can connect to the simulator with no issue. My boards are just being detected as unknown and I can not seem to update the firmware. Having only one board connected, I tried to restart MobiFlight so I can have the program "see" the mega and upload the firmware that way. Doing this I received the error message, " avrdude timed out! Something went wrong when flashing with command "Arduino\hardware\tools\avr\bin\avrdude" -C"Arduino\hardware\tools\avr\etc\avrdude.conf" -patmeg2560 -cwiring -P\\.\COM1 -b115200 -D -Uflash:w: "C:\MobiFlight\firmware\mobiflight_mega_2_2_0 ".

Thank you,
Johnny
2022-09-21 20:29
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
UPDATE:

We check the basic fact and it looks like my first idea with a wrong path was wrong.
Sebastian says this looks on first view like a issue if you try to use a Arduino UNO instead of a MEGA.

be so kind...

1. Confirm you use a Arduino MEGA
2. If YES.... Tell us the VID/PID of that Mega(s) .... You can see them in Windows Device Manager.
Maybe we got a wrong label there for some Boards.
Good Luck !
2022-09-22 00:23
Avatar
Johnny0357
Posts: 2
Hello,

Looking into my microprocessor I noticed it indeed was not an Arduino Mega, I apologize for any confusion.

Thank you for your advice,
Johnny
2022-09-22 21:55
icon