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! 

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