Using third party Arduino based hardware with MobiFlight - MobiFlight/MobiFlight-Connector GitHub Wiki

WARNING:

There is a chance you could stop your hardware working by changing the firmware.
You are doing the following procedures at your own risk.
Before you start, ensure you can reload the manufacturers firmware.

RealSimGear GNS530 Example

This is an example using the RealSimGear GNS530, which uses an Arduino Mega internally.
RealSimGear is a registered trademark of RealSimGear Inc.

The GNS530 was detected by MobiFlight during start up. With the name Default and the type of Arduino Mega 2560.

GNS530 not recognised

The board was flashed with the MobiFlight firmware without any issues.
A button device was added to each digital pin, using the name of the pin.

Arduino Mega configuration file with all digital pins set as inputs.

All.Inputs.mfmc renamed as a txt file

All inputs file loaded into MobiFlight

All inputs

MobiFlight needs to be running Offline with Logging set to Debug. Clicking on Extras, Settings on the menu allows you to set:

  • Logging enabled
  • Log Level Debug
  • Offline Mode enabled

MF settings

When each button is pressed on the RealSimGear GNS530, you will see which pin is activated in the Debug Window at the bottom of the MobiFlight program.
Here you can see buttons 32 through to 37 were pressed.

Debug output

The rotary encoders appear as a double button press.
Here an encoder is connected to pins 52 and 53.

Debug output of an encoder

Once you know which pin is connected to which button, you can make a new module configuration.

GNS530 button config

You can test your configuration by checking the output of the Debug window and pressing the buttons.

Debug output of GNS530 buttons

The Input Config can now be created.

Input config

Remember to switch of debugging and offline mode when you have finished

Reloading the RealSimGear firmware in Windows.

The firmware files can be downloaded from the Firmware section of this page.

RealSimGear Firmware download page

Ensure MobiFlight is not running, even in the system tray.
Otherwise MobiFlight could block access to the serial port.

The RealSimGear Firmware Update Utility does not recognise the GNS530 with the MobiFlight firmware loaded.

Firmware not recognised

Therefore we need to reload the firmware using the avrdude utility.
From a command prompt run this command, with -PCOM1 for com port 1 or in this example com port 4 with -PCOM4 at the end of the command line.

"C:\Program Files (x86)\RealSimGear Firmware Utility\Data\Loader\avrdude" -C “C:\Program Files (x86)\RealSimGear Firmware Utility\Data\Loader\avrdude.conf” -v -pATmega2560 -cwiring -b115200 -D -Uflash:w:"C:\Program Files (x86)\RealSimGear Firmware Utility\Data\RSG Firmware\Binary\RealSimGear-Arduino-3.2.4-GNS530.ino.mega.hex":i -PCOM4

The output should be like this.

Flashing the GNS530

The GNS530 will now be recognised by the RealSimGear Firmware Update Utility.

GNS 530 firmware is recognised

The GNS530 will now work with the RealSimGear software as before.

⚠️ **GitHub.com Fallback** ⚠️