Using third party Arduino based hardware with MobiFlight - MobiFlight/MobiFlight-Connector GitHub Wiki
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.
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.
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
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
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.
The rotary encoders appear as a double button press.
Here an encoder is connected to pins 52 and 53.
Once you know which pin is connected to which button, you can make a new module configuration.
You can test your configuration by checking the output of the Debug window and pressing the buttons.
The Input Config can now be created.
Remember to switch of debugging and offline mode when you have finished
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.
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.
The GNS530 will now be recognised by the RealSimGear Firmware Update Utility.
The GNS530 will now work with the RealSimGear software as before.