GeneW

A2A add-on Lua error with FSUIPC 4.962

Recommended Posts

I have installed upgrades to my sim over the last couple days and encountered a problem with A2A C172 simplugin. I found the problem when I upgraded FSUIPC from 4.949f to 4.962. I had constructed my own set of guages for the A2A PA28 using guages from the A2A C172, plus a few others. This arrangement has been working fine since 2014 for both planes, I have been very happy with it.

 

My sim: FSX with Windows 7, A2A latest update (1-17-17), FSUIPC 4.962, and just updated simplugin to 2.97 today. The failure is the same with previous simplugins 2.94 which I have been using for the last couple of years.

 

The problem popped up when I upgraded FSUIPC from 4.949f to 4.962 a couple days ago. The PA28 RPM guage & a few other guages stopped working. Same result with the A2A C172.  After trying various restore & updates I found the problem in the ipcinit.log here:

 

********* LUA: "ipcInit" Log [from FSUIPC version 4.962] *********
     2480 System time = 20/02/2017 10:38:04
     2480 LUA: beginning "D:\FSX\Modules\ipcInit.lua"
     2480 *** LUA Error: ipcinit_SOURCE.lua:36: attempt to perform arithmetic on global 'HOBHR4' (a nil value)
     2480 >>> Thread forced exit <<<
     2480 System time = 20/02/2017 10:38:04
********* LUA execution terminated: Log Closed *********

 

Since this worked with the previous version of FSUIPC I naturally contacted Pete Dowson on his forum (You can check my posting & his response there). Pete suspected a timing issue and suggested I rename "ipcinit.lua" to "ipcready.lua" and re-test. The guages then worked & the LUA error went away. However the real problem is failure to initialize HOBHR4 in your Lua program. Pete said that if you have any further question you may contact him via private email. I hope I have explained this sufficiently, I did a lot of testing to arrive at this conclusion. I also have some of my own controls coded in Lua.

 

Gene
 

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

The real question is therefor:

"What changed in FSUIPC V4.962?"

 

I'll have to test with this new version and see if I can replicate it.

 

By the way, HOBHR4 holds value for local variable "L:e1Hour4".

Share this post


Link to post
Share on other sites

I did some tests as well. It looks like that the local variable doesn't exist/or has no value when starting up FSX and not having the A2A C172 loaded (or any other plane instead of the A2A C172). The local variables are specific to the airplane loaded. In the past this was not an issue, but now it seems it is. Maybe there was a change when or how FSUIPC loads lua files now.

 

I also changed the name to ipcready.lua and saved the A2A C172 as the default flight. Then it worked and I got no error and the instruments worked. But if a different aircraft is used, there is an error.

 

I have to make a modification to the lua script to cater for this. This behavior must be new with the latest version of FSUIPC.

Share this post


Link to post
Share on other sites

I had been using FSUIPC 4.949f until 2 days ago when I upgraded to 4.962. Obviously something changed but I do not know when or what. The implication from Pete's reply to my post on the simflight forum is that it might have to do when Lua is started. In his reply to me Pete offered to communicate with you if it would be helpful.

Share this post


Link to post
Share on other sites

I hate to tell you I have bad news. Not quite there yet. I downloaded the update A2A C172 & installed. When I tested this version my flight and engine controls that I have configured through FSUIPC were disabled. The ipcinit.log showed no error, just "thread killed" when I terminated the program. I did the following tests:

1) Went into FSUIPC to see if FSUIPC could see the controls, which it did. FSUIPC showed the controls operating as they should but they did not move anything on the plane.

2) I tested the controls with the FSX default 172, no simplugins running, and the controls work as expected.

3) i removed all .lua files from the modules folder to a save area. Then the flight & engine controls worked on the A2A 172 and other planes as expected, no simplugins running.

4) I restored ipcinit.lua to the modules folder, but left off all other lua programs that I have written (only a couple anyway) to make sure they were not a source of the problem. Then I initialized the A2A 172 guages, loaded the plane, and started it using the mouse to operate the throttle & mixture. The plane started, The RPM guage operated but did not match the plane. Some other engine guages did not operate, but the ipcinit log did not show any error.

 

I am at a loss as to what else to test. I wait to see what you might suggest. Thanks for looking at this.

 

Gene

Share this post


Link to post
Share on other sites

Well, I have tested the exact same, with the A2A C172 latest version and FSUIPC latest version. It will ONLY work with the A2A C172, no other aircraft. I have another look.

Share this post


Link to post
Share on other sites

I have done some more testing. As I said above, I have no issues. All instruments work and show the correct value.

 

The lua script ipcinit.lua is actually very simple. It reads LVars and writes the values into offsets (from 0X66C0 to 0x66FA) to be read by the simPlugins A2A FSUIPC Interface. I assume you are using this interface (included in the A2A C172 Add-On) not the 'standard' FSUIPC Interface that comes with Panel Builder, it will not work (instruments will not work or show the incorrect value).

Share this post


Link to post
Share on other sites

I will go back & reinstall simplugins from scratch, & then test again. It was late last night when I was testing, maybe my frustration level was clouding my work. i will post when I go through testing again.

Share this post


Link to post
Share on other sites

I did have a bad install the other day, this morning I had time to do a complete re-install of simplugin and the A2A 172 add-on. Better, but still not completely working. Following are all the steps I did and the results. All testing with the A2A C172 and FSUIPC 4.962.

 

1) No lua, no simplugins. All flight & engine controls work. I did not fly the plane, just mechanically checked the controls.

2) Completely uninstall simplugins from both computers, through control panel.

3) Download & install Simplugins, and A2A add-on and interface, dual computer setup.

4) Start SP on instrument computer with 172 panel.

5) Start SP A2A FSUIPC interface on FS computer. Came up as v 2.99

6) Start FSX. Connect & start the interface. All guages load and appear correct.

7) Load A2A C172.

8) Flight controls (yoke, rudder pedals, throttle, mixture) do NOT operate on the plane. I open FSUIPC axis assignment. I use the "send direct" option. I tried changing the control to "send to FSX" option. Also controls did not work, made no difference. Checked the ipcinit.log file, no error posted. Also checked the FSUIPC log, no error there either.

9) Using the mouse to handle the throttle & mixture from the screen, I was able to start the 172.  Here is the result of guages:

 

RPM, oil pressure, oil temp, altimeter, Nav 1 & 2, all operate correctly and match the plane.

 

The following guages did not operate at all: fuel level, fuel flow, egt, amps, vac, flaps, heading indicator.

 

I could not test other guages since I had no operating controls.

 

Where do I proceed from here?

 

 

Share this post


Link to post
Share on other sites

I really don't know. It looks to me like there is an interference between your lua scripts and the simplugins script. But that makes no sense as all we do is read LVARs and write them to the custom offsets. Unless you use the same offsets  (from 0X66C0 to 0x66FA), there should be no issue. The main change in the lua script I made is that it now checks that the A2A C172 loaded, if not it does nothing.

 

As I mentioned before, all instruments work for me. I use a standard joystick though assigned through FSX/Controls.

Share this post


Link to post
Share on other sites

OK, I guess my next step is to contact Pete Dowson again. It can't be my lua scripts because I removed them. They are not there. There is nothing fancy about my use of FSUIPC either. I have a PFC yoke and Saitek throttle quadrant, standard axis assignments.

I see that AVSIM forum may be down part of tomorrow. It may be a couple days before getting back on this. Meanwhile I will contact Pete.

Share this post


Link to post
Share on other sites

This is the answer I received from Pete:

--------

Without knowing what "ipcinit.lua" is doing I cannot help at all. I don't know why it is so secret! Nor do I understand why it needs to run before much else is ready in FS -- most everything should be started at ipcReady or later. When ipcInit is executed FS isn't ready at all. All it is suitable for is initialising some FS offsets.

--------

Then I changed ipcinit.lua to ipcready.lua and retested. I should have done that with my previous tests. Sorry. Changing ipcinit.lua to ipcready.lua  brought my controls back, and the guages that worked matched the plane's guages. I was able to make a test flight. However some guages did not work at all, the ones previously mentioned, plus the airspeed indicator. Do I need to do a re-build of the guages for the C172?

Share this post


Link to post
Share on other sites

I'll change the installer so it install the lua as ipcready.lua. 

 

I don't know what you mean by 'rebuild of the gauges', do you mean a re-install? I don't know if this would help.

 

I also tested it as ipcready.lua, everything works for me.

Share this post


Link to post
Share on other sites

Before this episode I was not aware of the difference between ipcinit and ipcready. I'm guessing that Pete changed something in the way (or when)  ipcinit starts.

 

Regarding the gauges that are not working, I meant to ask, should I rebuild my A2A 172 panel with the gauges you supply? I don't understand why  the gauges in my panel have all worked ever since the A2A add-on was released but some are not working now. I updated the A2A planes to the 1-17-17 update but I don't think they changed variable names. Is your A2A 172 up to date? I can't test this theory until tomorrow.

Share this post


Link to post
Share on other sites

The problem with some gauges working and some not turned out to be a firewall issue on the instrument computer. I'm not sure where it happened but some of the gauges had the firewall setting removed. So all is now working. Thank you for your help.

 

Gene

Share this post


Link to post
Share on other sites

Just what I wanted to suggest (Firewall). A reinstall will allow you to add them back. Sorry for not thinking about this earlier. I'm glad its all back working for you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now