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
sa0987
Posts: 1
I had not been able to find a solution to read the Mobiflight output on a non-LCD native device. As such I attempted my own.

While it is not 100% complete, I have been successful at reading LCD data from Mobiflight (I2C Master/Slave) and displaying it on a Raspi. As an example the slave would run on 0x27 and read whatever the would have been sent to the native 16x2 LCD. The output is being sent to a circular 1.12cm I2C waveshare device for altitude (self made).

I would like some help completing this project and making it bullet proof.

Current issues:

- I am guessing a the output, but it seems accurate
- I am unable to "pipe" the data to the display side of the app

Sample data and code is provided. Anyone that has gotten this to work previous, please let me know. Or if you have an interest in completing this.

thank you, sa0987

iconCode:
### assumed output received (input to Raspi)
d = {
 "45 : 0x2D --  41 : 0x29 --  237 : 0xED --  233": "."
,"61 : 0x3D --  57 : 0x39 --  13 : 0x0D --  9 : 0x09" : 0
,"61 : 0x3D --  57 : 0x39 --  29 : 0x1D --  25 : 0x19" : 1
....

 }


iconCode:
C++ code

#include <pigpio.h>
#include <iostream>

using namespace std;

void runSlave();
void closeSlave();
int getControlBits(int, bool);

const int slaveAddress = 0x27; // <-- Your address of choice
bsc_xfer_t xfer; // Struct to control data flow

int main(){
    // Chose one of those two lines (comment the other out):
    runSlave();
    //closeSlave();

    return 0;
}

void runSlave() {
    gpioInitialise();
    cout << "Initialized GPIOs\n";
    // Close old device (if any)
    xfer.control = getControlBits(slaveAddress, false); // To avoid conflicts when restarting
    bscXfer(&xfer);
......



iconCode:
Mobilfight 0x27 output 
Debug	12/17/2022 18:10:37	Command: SetLcdDisplayI2C <25,1,   1437                         ;>
Debug	12/17/2022 18:10:37	Command: SetLcdDisplayI2C <25,1,   1444                         ;>
Debug	12/17/2022 18:10:37	Command: SetLcdDisplayI2C <25,1,   1450                         ;>
Debug	12/17/2022 18:10:37	Command: SetLcdDisplayI2C <25,1,   1463                         ;>
Debug	12/17/2022 18:10:37	Command: SetLcdDisplayI2C <25,1,   1470                         ;>
Debug	12/17/2022 18:10:37	Command: SetLcdDisplayI2C <25,1,   1476                         ;>
Debug	12/17/2022 18:10:37	Command: SetLcdDisplayI2C <25,1,   1486                         ;>

C++ pipe to python reading the output 
0 [1]
0 1437
[1]
0 [1]
0 1444
0 [1]
0 1450
[1]
0 [1]
0 1462
[1]
0 [1]
0 -1
[1]
0 [1]
0 1470
[1]
0 [1]
0 1476
[1]
0 [1]
0 1486
[1]
0 [1]
0 -1
[1]
2022-12-18 00:18
icon