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
Joppnl
Posts: 30
Hello,

got the 7-segments working but:

The 5Hz change is not being displayed in the freq.

So, i.e.: display in MSFS on 124.905 --> 124.900 on 7segment display.

I tried it on the LCD display but the same.

Now...unless there is an other thought: I think it is in FSUIPC....

If I look at the raw data MobiFlight receives 2490 in both cases.

I did program MF like the tutorial (like BCDmode, the masking of 0xFFFF etc) so that should be ok I guess.

Also: in other threats is said a special modulo (%) formula but that doesn't work because the data is not getting to Mobi flight so no formula will work...

Any thoughts?

Thanks!

2020-09-30 20:06
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

You got wrong Offset!

The 311A is from a time when frequencys in Sim was just 5 digits long ( 123,45 ) and the last 6th diggit simply not exist. ( early time of FlightSim)
Then there was a time we got the 6th diggit but all Sims just use the 25khz System.... Means already this diggit not needs to be included in the Offset cause we could simply say
" if the frequency end on 5th digit with a 2 or 7 then we need a 5 on the 6th..... If NOT ( so it end with 0 or 5) we need a 0 ... so 123,400 , 123,425, 123,450 ,123,475, 123,500 "
Here we use a simple formula with your suggested MODULO% to make this possible !

NOW with FS2020 and P3Dv5 we got the Big Change.... There is the 8.33 khz System come into the Sim.
So FSUIPC give us a new couple of Offsets for the COM´s ......

iconQuote:

05C4 4 Active COM1 frequency in Hz (32 bit int) Ok-SimC Ok-SimC
05C8 4 Active COM2 frequency in Hz (32 bit int) Ok-SimC Ok-SimC
05CC 4 Standby active COM1 frequency in Hz (32 bit int): Ok-SimC Ok-SimC
05D0 4 Standby COM2 frequency in Hz (32 bit int) Ok-SimC Ok-SimC



NOTE: I not know if this is already implement in the BETA of FSUIPC7 ..... IF not you need to wait some weeks until final release is available.
Good Luck !
2020-10-01 01:32
Avatar
Joppnl
Posts: 30
Well....I didn't see that one coming!!

tried a lot: more bytes, other masking, read the forum to find an answer.....

I used the presets in MF and there is only one preset for the com1 freq but that one is not working right (not showing the 5kHz digit).....

But I can say : the values you gave work!!!
(just alsop needed to adjust nu # of bytes but as you gave the 32 bits...simple=4bytes....)

Thank you for your support and explanation, learning a lot!


Now: can you help me out with the offset adresses for the Toggle com1 active/standby ?

And same question for com2 active/standby??

I do not see them in the MF drop-down menu

Here's a picture showing what I've been able to do with the displays so far: you can see the last 5 digit of the active freq is working!

And PS: heading is working perfect also >180 & <0 :) (and (not on picture yet) I shifted it 1 pos to the left... (detail))

[Last edited by Joppnl, 2020-10-01 17:54]
2020-10-01 17:37
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi
As i say a lot of times... Not get stuck with the Presets. This is just a little selection of important elements. NOT a fully list. If you need something that is not include simply search the FSUIPC Lists of Offsets..... then enter the data manualy into the configs instead of click on "use preset".

***********

About the Swap
Here i not know if FS2020 work same way like before.... And if those elements are still inlcuded fully.
So you need to try out.

Way 1. Via EventID

iconQuote:

66372 COM1_RADIO_SWAP
66444 COM2_RADIO_SWAP
66448 NAV1_RADIO_SWAP
66451 NAV2_STBY_SET


All are Execute Events... so Parameter should be Zero 0


Way 2. Via Offset
iconQuote:


Offset: 3123 Size in Byte: 1 Radio Use/Standby swap toggles, Write bits to operate toggles.
2^3 COM1 swap
2^2 COM2 swap
2^1 NAV1 swap
2^0 NAV2 swap



Here you must try if you need to write the BIT or the BYTE in FS2020.

With Bit you must use that Offset With 1 Byte INT .... And you must select the BITMASK to the needed BIT....
So all bits disabled expect the one you need. E.g. NAV2 is Bit 0 .... So the most right one..... COM1 is Bit 3 ( The 4th. of the right)
Value is 1 here.

With Byte you simply write a DECIMAL Value to the full byte ( Bitmask untouched... So all 8 Bits selected) .
Value 1 is NAV2 .... Value 2 is NAV1.... Value 4 is COM2 ...... Value 8 is COM1
Good Luck !
2020-10-01 20:19
Avatar
Joppnl
Posts: 30
Hi pizman82,

again ( :thumbup: ): lots of thanks for your support!!

Thank you for the information.

I can deal with bitmanipulation...done that when programming in C++ but there you have somewhat more freedom as you wrtite the code yourself where as with MF you'll need to understand the 'thinking' if the program itself first....

But...the good news is: don't need to get into the bits: event 66372 does the swap job perfect!

Cannot say anything about the other swaps as I did not connect more then 2 7segm displays at the moment but that will be the next step (and adding a rotary switch...see how that works).

While I am working with MF I do experience some well...rather strange behaviour:

1) when executing MF for the 1st time, (very) sometimes it DOES detect that there is an Arduino but it says that MF is not loaded on the Arduino (Mega) where it already worked for about a week.

So...I said No, do not upload the firmware and then it keeps giving a yellow error marker that no board is attached. Deconnecting and reconnecting from USBport does not help, also restarting MF does not help.

But...next day, when powering on the PC everything is back to normal (it mostly is). So..no clue...could be the board (Mega clone) could be MF communication...


2) as with tonight: when I was defining the switch for a com_freq_swap it did not work at that moment so I thought I did something wrond...

I stopped MF, did press Run again, but nothing....stopped, run again...nothing....was playing around a little and then all of a sudden the swap button seemed to work.

Strange and nasty because you do think you make a mistake or some offset does not work where MF somehow does not implement it directly (?)

3) question: where can I look up the right event_numbers and offsets??



Thanks!
[Last edited by Joppnl, 2020-10-02 22:29]
2020-10-02 21:52
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
The lists withe the EventIDs and the Offsets are in the \Modules\Documents-folder of your sim.

Another question: do you drive the Mega(s) directly at the PC or do you use a hub. When a hub, did you have an external powered hub or only an unpowered one?
Grüße,
Stephan (Time: UTC+2)
2020-10-02 22:47
Avatar
Joppnl
Posts: 30
Thanks StephanHo,

do you have a specific name of this list_file (including extension_name)?

Can't find/don't have this dir, don't see it on the standard MSFS folder neither in the somewhat hidden folder

(Appdata/Local/Packages/Microsoft.FlightSimulator_8wekyb3d<long_number>).


The MEGA is connected by 1 short blue USBcable that came with the MEGA which is connected to a 2.5m long USBextention cable as my PC is not near where I am.

So total length 2.5..3M (but only 1 device (MEGA) connected to this cable which goes directly to the USB of the motherboard.

Can not make it shorter but I do have a direct USB cable I think (and long enough) so might check that out when the problem occurs.

What is your experience (if you have) with powered USB_hubs and MF/Arduino? Does that work?

Thanks for toyr support!
2020-10-03 14:48
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Pretty sure Stephan will awnser himself..... So just my experience by the way.

1. The Lists.
Stephan talk about the final Version of FSUIPC 4,5,6 for P3D .... there the Lists was in the Sim/Modules/FSUIPC Documents Subfolder.
In the FS2020 FSUIPC7 Beta as i know the files are within the FSUIPC Folder OR somewhere in c:/users/xxxxxxx/Documents ...... Like lots of other Software that use this pulplic folders today. .... In the Past that files was PDF In the FSUIPC7 Beta they are as i know ODS or XLS ( Open Office Calc or MS Excel Spreadheets) .
The files are mostly called "offsetStatusxxxxx.yyy"


About your Hardware....

We get experience those cheap blue USB Cables ( The short ones for free included with the China clone Megas) can be problematic.
Length is not a good factor. A High Quality USB Cable with 5m can be more stable as a "bad" Cable with just 0,2m.
Whatever it´s a good workarround if you get massive connection Problems to change Cables and/or Hubs. Here the same.
You can buy a 4xHub for 6,99$ or a 4x Hub for 49,99 $ ..... Pretty sure the quality can be "verry" different.

Basicly we recommend those powered Hubs for bigger Projects. The USB Power of 500mA ends pretty fast if you use 10, 20 or more Megas. And it´s more tidy to simply connect all 6 Megas in a Overhead on a Hub so only 1 final cable goes to the Master Server where MF and Sim is running !
Good Luck !
2020-10-03 16:37
Avatar
Joppnl
Posts: 30
Thank you pizman82!!

Right!!

I found that specific ODS file now and I can read it...wow...that's a very looooong list....might get lost in it! :-)


Ahaa...I will change that cable...and see what is happening.(although 9/10 times it's working fine)

At the moment I have 1 MEGA connected to 1 USB port AND I make use of an external 5V/6A power supply to feed the externals (like 7segment, LCD, LED's etc).

So, next thing is to extend the 7 segments displays (I have 2 connected, each one wired seperately to the MEGA) and to daisy chain the others and make 6 in total (I've already read about changing the diode with a wire to prevent voltage-loss), make swap buttons work and make rotary encoders work well...enough fun for the future..

Ooh ...and I must not forget to fly as well :-)


Thanks again guys for your support!
[Last edited by Joppnl, 2020-10-03 19:21]
2020-10-03 18:09
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
iconJoppnl:



At the moment I have 1 MEGA connected to 1 USB port AND I make use of an external 5V/6A power supply to feed the externals (like 7segment, LCD, LED's etc).



OHHHH :scared: Maybe that the Issue !!!!

If you power 5 Volt devices ( like 7Seg LCD or so) via a EXTERNAL Power suply there is a verry important rule !
The GRD of that external Device MUST be shared with the GRD of the Arduino.

For example.....

You got a 7Seg Max tube.... You use CLK, SLK and DIN from 3 Arduino Ports..... BUT you use 5v and GRD from a external device. Then this will end in a issue. Cause the potential of the Data Lines is different as from the 5v/GRD suply.
So simply connect a wire to the GRD of the External Suply and connect it into a free GRD port of the MEGA !

Same way we recommend to connect each MEGA GRD with the next MEGA ( if you use multiple boards) via a GRD to GRD cable.... So you get sure all Megas ( and all external devices) use always the same potential !!!
Good Luck !
2020-10-04 02:16
Avatar
Joppnl
Posts: 30
Good thinking :thumbup: :thumbup:

But..did that....and I think when the GND is not connected to the MEGA there could be no data transfer from the MEGA to the external peripherals...but well, it was a possibility so :thumbup:

Anyway, thank you for the thought and bringing it up!

OK..let's not discuss it in this thread (as I needed some support for the 5kHz missing...the answer you gave made it work :thumbup: but about the Arduino/MF:

Problem is: MobiFlight firmware is not being recognized by MF itself.

As I see it:

Arduino MEGAmodule itself is being recognized, both by the default Arduino drivers and MF (otherwise it wouldn't say: I detected it but I see no firmware) so, hardware looks ok.

So the MF software DOES detect an Arduino but not that the firmware is on it.

Could be that the MEGA is not 'telling' MF that the firmware is on it or that MF is not listening well enough to 'hear' that there is firmware on it.

Now...I will have a look at it in the upcoming time, I will change cables (as you never know...most weirdest things can happen with half_broken cables) and if I need further support I will ask for it in an other threat, let me first keep an eye on it how it's working in the future so I can try a few things before asking for support :thumbup:

Thanks!
[Last edited by Joppnl, 2020-10-04 11:30]
2020-10-04 10:40
icon