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
emmanuel.morales
Posts: 13
Hi guys,

I am newbie in this world, I have fsx, fsuipc, arduino mega 2560 and mobiflight of course.

I want to be able to manage fcu for now of the a320 aerosoft v 1.31.... I do not want jeheell at least not for now.

I have the lua scrip out of linda-config and I read the tutorial how ro set lvars with mobiflight but I am lost.

I know aerosoft at least from what I read is hard but I want aerosoft. Anyone could guide me thru. I am not sure whats the action type in the input, I am not sure what goes first fsuicp or mobiflight and if someone has the lua file that I need inputs and outputs onlu for FCU.


Thank you so much and hope to get help.

Emmanuel from México
2019-02-19 03:36
Avatar
emmanuel.morales
Posts: 13
PLEASE HELP...
2019-02-21 01:00
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2330
Supporter
Hi

As you already accept.... Aerosoft A320 is not realy good for Homecockpits.
Thats why not many people exist that use it.... And mostly those people just build verry basic Stuff and not things like the FMS.
Maby your lucky and somebody here will reply.... But i not think that anybody here already build a FMS for Aerosoft Bus.

I just overfly the Lvar List.
all needed Button Inputs for the Left and Right FCU are inlcuded and listed.

Basicly you need the script or you work with single Lua Macros via FSUIPC (Reg version) .
Technical you can do that as i see it at the moment.

NOTE:
Much more easy would be a setting of internal Key Commands. Please check out if you have internal in Aerosoft a way to set Joystick Inputs or Ke Commands to those FCU Keys.
If yes you not need scripting.
Good Luck !
2019-02-21 15:41
Avatar
emmanuel.morales
Posts: 13
yhanks pizman,

perhaps someone can give me a little push to start with.

1..- so, I put the lvars file into the modules file of FSX.

2.- whats next to create inputs in mobiflight (BTW I have some as events id for default aircraft and they work) need new inputs or just override them??

3.- now for the input: what should be the Action type: Key, LUA macreo FSUIPC offset and whatever te action type is how should I fill in the rest like value, mask value, offdet, etc.

4.- now in FSUIPC in the Logging tab, under log details, which options shoul I mark IPC reads, IPC writes, button and key operations, events, axis controls, log lua plugins, etc. ?

5.- then I go to key presses?

sorry I am lost, what should I configure first, is it Mobiflight or FSUIPC?

please some one helps,

thanks

emanuel

*I did not know how to upload images.
2019-02-23 03:29
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2330
Supporter
Again my Friend.... I have no experience there and give only basic hints.

Mobiflight itself can NOT controll Lvars. Mobiflight can only simulate Key Presses, Joystickbuttons (With VJoy PlugIn) can Controll Offsets and can Run Lua Scripts or Macros (LUA PlugIn) ...... It can also fire EventId but thats not helpfull in that case.

Your Lvars are a "other" technic that is basicly not compatible with Mobilfight.

What you need now is something like a adapter.... a Tool that recive a command from Mobiflight ( vie one of technics i say above) and this tool THEN execute the command to the Lvar.

This is basicly done with the LUA Scripts. You write a Code that say " IF Something is TRUE ( For example if Key "x" is pressed ) then Write the Lvar for FMS Button "A" with parameter 1 so it will be pressed in Sim "

Here you got lots of ways. You can write for example macros that are fired one time and execute the command.... You can assign those Macros in FSUIPC to a key for example.
Then you say in Mobiflight that your Input Button on Pin xy should simulate a "x" key..... FSUIPC see this "x" key and say "Start Macro xy" and this macro finaly write your Lvar.

Another way is to use Joysick Commands...... OR you can fire this macros directly via the LUA PlugIn of Mobiflight (to save the key press transmit)
Maby the most professional solution is to Write with Mobiflight a Offset (Bits) and a Global script will observe this Offsets and execute the Lvar Commands in case if a bit is change.

*****
Summary :
For a Beginner i think the Single Macro is maby the best solution. If you get more experience you can try a global script. But here i´m out. never do this before!
Good Luck !
2019-02-23 04:53
Avatar
thatchi
Posts: 95
Emmanuel.
Look at this thread. I did a prototype mcp for aerosoft Airbus , but it not complete and only able to display speed, heading, alt and vs.
There how to instruction .
When have time , I will try to finish the inputs with buttons and encoders. It is doable, but I am so busy with work for now.
If u able to complete it, please share.
Good luck. :)
2019-02-23 14:18
Avatar
thatchi
Posts: 95
Sorry. The thread.
https://www.mobiflight.com/forum/topic/1930.html
2019-02-23 14:18
Avatar
emmanuel.morales
Posts: 13
THATCHI,

I see your prototype, but am still not understanding the logic for inputs with encoders. this is the LUA scripst I am using:

--SPD
ipc.writeSW(0x66C0, ipc.readLvar("L:AB_AP_Speed_Select"))
ipc.writeSW(0x66C6, ipc.readLvar("L:AB_AP_Mach_Select")))*100)

--HDG
ipc.writeUW(0x66C8, ipc.readLvar("L:AB_AP_HDG_Select")*182.0444444444444)
ipc.writeUW(0x66D1, ipc.readLvar("Autopilot_TRK_set")*182)
--ALT
ipc.writeUW(0x66D5, ipc.readLvar("L:AB_AP_ALT_Select"))
--VS
ipc.writeSW(0x66C2,ipc.readLvar("L:AB_AP_Vs_Select2"))
ipc.writeSW(0x66C4,ipc.readLvar("L:AB_AP_FPA_Select2")*10)

--HDG/TRK
ipc.writeSW(0x66CC,ipc.readLvar("AB_AP_HDGTRK"))
--SPD/MACH
ipc.writeSW(0x66CE,ipc.readLvar("AB_AP_SPDMACH"))


while 1 do

--HDG/TRK
HdgTrkLvar=ipc.readLvar("AB_AP_HDGTRK")
HdgTrkOffset=ipc.readSW(0x66CC)

if HdgTrkOffset~= HdgTrkLvar then
--ipc.writeLvar("AB_AP_HDGTRK",HdgTrkOffset)
ipc.writeSW(0x66CC,ipc.readLvar("AB_AP_HDGTRK"))
end

--SPD/MACH
SpdMachLvar=ipc.readLvar("AB_AP_SPDMACH")
SpdMachOffset=ipc.readSW(0x66CE)

if SpdMachOffset ~= SpdMachLvar then
--ipc.writeLvar("AB_AP_SPDMACH",SpdMachOffset)
ipc.writeSW(0x66CE,ipc.readLvar("AB_AP_SPDMACH"))
end

--
SPDmode_cur = ipc.readLvar("L:AB_AP_SPDmode_set") --0x66D9
HDGmode_cur = ipc.readLvar("L:AB_AP_HDGmode_set") -- 0x66DA

-- Selected / Managed Display
if SPDmode_cur ~= SPDmode_pre then
SPDmode_pre = SPDmode_cur
if SPDmode_cur == 1 then
ipc.writeUB(0x66D9,SPDmode_cur) --managed
else
ipc.writeUB(0x66D9,SPDmode_cur) --selected
end
end

if HDGmode_cur ~= HDGmode_pre then
HDGmode_pre = HDGmode_cur
if HDGmode_cur == 1 then
ipc.writeUB(0x66DA,HDGmode_cur) --managed
else
ipc.writeUB(0x66DA,HDGmode_cur) --selected
end

end

ipc.sleep(20)


--SPD

SpdMachVar = ipc.readLvar("AB_AP_SPDMACH")
if SpdMachVar == 0 then

SpdLvar = ipc.readLvar("L:AB_AP_Speed_Select")
SpdOffset=ipc.readSW(0x66C0)

if SpdOffset > 399 then
ipc.writeSW(0x66C0, 399)
elseif SpdOffset < 100 then
ipc.writeSW(0x66C0, 100)
end
if SpdOffset~=SpdLvar then
ipc.writeLvar("L:AB_AP_Speed_Select",SpdOffset)
end

elseif SpdMachVar == 1 then

--MachLvar = ipc.readLvar("L:AB_AP_Mach_Select")*100
MachLvar= tonumber(string.format("%.2f", ipc.readLvar("L:AB_AP_Mach_Select")))
MachLvar=MachLvar*100
MachOffset=ipc.readSW(0x66C6)

if MachOffset < 10 then
ipc.writeSW(0x66C6, 10)
elseif MachOffset > 84 then
ipc.writeSW(0x66C6, 84)
end

if MachOffset ~= MachLvar then
ipc.writeLvar("L:AB_AP_Mach_Select",MachOffset/100)
end

end


ipc.sleep(20)
--HDG
AB_hdgtrk = ipc.readLvar("L:AB_AP_HDGTRK")

HdgLvar=ipc.readLvar("L:AB_AP_HDG_Select")*182.0444444444444
HdgOffset = ipc.readUW(0x66C8)


TrkLvar=ipc.readLvar("Autopilot_TRK_set")*182.0444444444444
TrkOffset = ipc.readUW(0x66D1)

if AB_hdgtrk == 0 then

if HdgOffset ~= HdgLvar then

currentValue =(ipc.readUW(0x66C8))*0.0054931640625
ipc.writeLvar("L:AB_AP_HDG_Select", currentValue)

end

else


if TrkOffset ~= TrkLvar then
currentValue = ipc.readUW(0x66D1)*0.0054931640625
ipc.writeLvar("Autopilot_TRK_set", currentValue)
end

end
ipc.sleep(20)
--ALT
AltLvar=ipc.readLvar("L:AB_AP_ALT_Select")
AltOffset=ipc.readUW(0x66D5)

if AltOffset < 100 then
ipc.writeUW(0x66D5,100)
elseif AltOffset >49000 and AltOffset < 55000 then
ipc.writeUW(0x66D5,49000)
elseif AltOffset > 55000 then
ipc.writeUW(0x66D5,100)
end

if AltOffset~=AltLvar then
ipc.writeLvar("L:AB_AP_ALT_Select",AltOffset)
end

ipc.sleep(20)
--VS
if ipc.readLvar("AB_AP_HDGTRK") == 0 then
VsHdgLvar=ipc.readLvar("L:AB_AP_Vs_Select2")
VsHdgOffset=ipc.readSW(0x66C2)

if VsHdgOffset < -60 then
ipc.writeSW(0x66C2,-60)
elseif VsHdgOffset > 60 then
ipc.writeSW(0x66C2,60)
end
if VsHdgOffset ~=VsHdgLvar then
ipc.writeLvar("L:AB_AP_Vs_Select2", VsHdgOffset)
end
else
VsTrkLvar=ipc.readLvar("L:AB_AP_FPA_Select2")
VsTrkOffset=ipc.readSW(0x66C4)/10

if VsTrkOffset < -9.5 then
ipc.writeSW(0x66C4,-95)
elseif VsTrkOffset > 9.5 then
ipc.writeSW(0x66C4,95)
end
if VsTrkOffset ~= VsTrkLvar then
ipc.writeLvar("L:AB_AP_FPA_Select2", VsTrkOffset)
end


end
if SpdOffset~=SpdLvar then
ipc.writeLvar("L:AB_AP_Speed_Select",SpdOffset)
end

elseif SpdMachVar == 1 then

--MachLvar = ipc.readLvar("L:AB_AP_Mach_Select")*100
MachLvar= tonumber(string.format("%.2f", ipc.readLvar("L:AB_AP_Mach_Select")))
MachLvar=MachLvar*100
MachOffset=ipc.readSW(0x66C6)

if MachOffset < 10 then
ipc.writeSW(0x66C6, 10)
elseif MachOffset > 84 then
ipc.writeSW(0x66C6, 84)
end

if MachOffset ~= MachLvar then
ipc.writeLvar("L:AB_AP_Mach_Select",MachOffset/100)
end

end


ipc.sleep(20)
--HDG
AB_hdgtrk = ipc.readLvar("L:AB_AP_HDGTRK")

HdgLvar=ipc.readLvar("L:AB_AP_HDG_Select")*182.0444444444444
HdgOffset = ipc.readUW(0x66C8)


TrkLvar=ipc.readLvar("Autopilot_TRK_set")*182.0444444444444
TrkOffset = ipc.readUW(0x66D1)

if AB_hdgtrk == 0 then

if HdgOffset ~= HdgLvar then

currentValue =(ipc.readUW(0x66C8))*0.0054931640625
ipc.writeLvar("L:AB_AP_HDG_Select", currentValue)

end

else


if TrkOffset ~= TrkLvar then
currentValue = ipc.readUW(0x66D1)*0.0054931640625
ipc.writeLvar("Autopilot_TRK_set", currentValue)
end

end
ipc.sleep(20)
--ALT
AltLvar=ipc.readLvar("L:AB_AP_ALT_Select")
AltOffset=ipc.readUW(0x66D5)

if AltOffset < 100 then
ipc.writeUW(0x66D5,100)
elseif AltOffset >49000 and AltOffset < 55000 then
ipc.writeUW(0x66D5,49000)
elseif AltOffset > 55000 then
ipc.writeUW(0x66D5,100)
end

if AltOffset~=AltLvar then
ipc.writeLvar("L:AB_AP_ALT_Select",AltOffset)
end

ipc.sleep(20)
--VS
if ipc.readLvar("AB_AP_HDGTRK") == 0 then
VsHdgLvar=ipc.readLvar("L:AB_AP_Vs_Select2")
VsHdgOffset=ipc.readSW(0x66C2)

if VsHdgOffset < -60 then
ipc.writeSW(0x66C2,-60)
elseif VsHdgOffset > 60 then
ipc.writeSW(0x66C2,60)
end
if VsHdgOffset ~=VsHdgLvar then
ipc.writeLvar("L:AB_AP_Vs_Select2", VsHdgOffset)
end
else
VsTrkLvar=ipc.readLvar("L:AB_AP_FPA_Select2")
VsTrkOffset=ipc.readSW(0x66C4)/10

if VsTrkOffset < -9.5 then
ipc.writeSW(0x66C4,-95)
elseif VsTrkOffset > 9.5 then
ipc.writeSW(0x66C4,95)
end
if VsTrkOffset ~= VsTrkLvar then
ipc.writeLvar("L:AB_AP_FPA_Select2", VsTrkOffset)
end


end

end



so in MF a created an input:
-action type: FSUIPC offset.
-load preset: in blank.
-base setting: +offsset: 0x66C0
+value type: Int +syse in bytes: 2
+mask value with: 0xFFFF ... bcd mode: no checked
-more options: set value: on left side: $-1 on right side: $+1

in FSUIPC, I set a key to start the lua, but nothings happens, I just need to get the first one input/encoder to start with so I can understand the logic.


thanks
emmanuel
2019-02-26 18:12
Avatar
emmanuel.morales
Posts: 13
I just cannot get it to work. :confused:
2019-03-15 00:38
Avatar
emmanuel.morales
Posts: 13
Anyone has been able to configure the fcu for aerosoft 320?

All I need is a little push, if you just pls give me an example with and input that already works.

Please.

Thanks
2019-04-08 02:18
Avatar
emmanuel.morales
Posts: 13
I am willing to pay if anyone helps to setup a fcu for aerosoft a320 . Pls I need it.

Thanks :confused:
2019-05-09 23:35
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2330
Supporter
I´m sorry but i can´t help you.... Whatever if you pay me 1000$ i not be able to help :(

I think you are on te wrong spot here.

Your problem is simple and i explane it multiple times.....
There exist AddOns that are build specialy for homecockpits ( Like Project Magenta, Prosim, Jeehell)
There exist AddOns that build for Casual Screen Simulation BUT they also include a SDK/PlugIn that allow us a easy usage with a homecockpit
And finaly there exist AddOns like Aerosoft Airbus that are Build for Screen-Flying and that not concepted for Homecockpits

As you still know it is also possible to build a HC with those AddOns like Aerosoft.... Cause the Data internal MUST be shared with the Sim and must exist... And every data that exist can be readout by a programm. But this simply means.... YOU must write this programm.

And thats why i say your on wrong Spot.... A Programmer that can write those scripts will not use Mobiflight, cause he will programm his "own Mobiflight" that is 100times better then our Programm.
So here in Forum are 98% Users that can not script or writing programm.... Cause thats the major argument why they finaly use Mobiflight !


******
I recommend....
A ) Learn Programming by youreself (The perfect solution)
B ) Search for a Programmer or somebody who can share you a working code..... Here you should look in HC Boards, Aerosoft Forums and so on.
C ) Switch to a other AddOn. Aerosoft is a low qualitiy AddOn as i know.... Whatever the Freeware FMGS is still better and more realistic like Aerosoft. If you can spend money then checkout the Project Magenta A320 ..... 1000$+ but pretty sure the most advanced AddOn on the market ( as i heard)
Good Luck !
2019-05-11 22:59
Avatar
emmanuel.morales
Posts: 13
thanks for your reply, so I decided to rebbot my pc and migrate to W10.. I am now in the process to install FSx again, and I finally decided to go for jeehell, do you know if its better to have 2 pcs or 1 will be good enough? I tried to read the manual but it seems to me that it is some how hard to configure it all.


thanks

emmanuel
Yesterday 01:49
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2330
Supporter
Hi again.

Please note that i will NOT make suggestions to Jeehell directly. I not use it myself (cause i would never fly a airbus aslong Boeing exist on this planet :love: )
So feel free to checkout for other programms if you like. I can just say that Jeehell is Freeware and looks verry professional. Also its basicly good compatible with Mobiflight (Whatever you will need SIOC if you like a full cockpit)

About Multi PC´s .... Here Jehell is wonderfull and i would say nearly on same level like a 1000$+ Highend AddOn.
Jehell support most of functions over Network.... That mean you can share the Insturments (as i know including the FCU´s ) over lots of computers.....
And that means you can use Grafic Power of the Sim PC 100% for Outside View.

If you plan for a Full Cockpit i recommend a MultiPC Setup. The Client Computers here can be pretty sure simple 400$ Office Computers. For the Screen of FCU, PFD,ND and so on you need no Grafic Power.... A Onboard Grafic is enough !
Good Luck !
Yesterday 05:45
icon