Jump to content
The simFlight Network Forums

Lua Socket 64 FSUIPC 5


Recommended Posts

Although I no longer use LUA to interface with my cockpit modules, I still have it set up from when I did and it works.  The only confusion I have is that I have a core.dll *size 102,912) in the Modules root and I have one in the Modules\lua\socket folder and they appear to be the same. 

Make sure you have this at the top of the lua file.

local socket = require("socket")

Also, I noticed that you have to have a socket.lua and a socket_core.dll that may actually be the 64 bit DLL(?).  These go in the Modules root.

 

socket_core.dll

socket.lua

Edited by budman9mm
Additional Files
Link to comment
Share on other sites

I got it working.

Thank you!

Quote

Also, I noticed that you have to have a socket.lua and a socket_core.dll that may actually be the 64 bit DLL(?).  These go in the Modules root.

But all I seem to need are socket.lua and a socket_core.dll in the modules folder (or the lua folder). At least as long as I only need Socket core, UDP and TCP.

Link to comment
Share on other sites

1 minute ago, Pete Dowson said:

Could you explain how, please? That "socket_core.dll" is definitely the 32-bit version. Are you using P3D4 and FSUIPC5?

Yes, I am using P3D4 and FSUIPC5

I just put socket.lua and a socket_core.dll in the modules folder.

Required it with:

local socket = require("socket")

Have successfully tested to send UDP data

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Bleedin said:

Yes, I am using P3D4 and FSUIPC5

I just put socket.lua and a socket_core.dll in the modules folder.

Required it with:

local socket = require("socket")

Have successfully tested to send UDP data

And the Lua file doing your UDP exchange is running in FSUIPC5?

If so, that is weird. I certainly don't think a 32-bit DLL can run in a 64-bit process.

I see that the "socket.lua" file uses a DLL called "socket.dll", not "socket_core.dll", though I suspect that the socket.dll needs socket_code. Do you have a socket.dll there?

Pete

 

Link to comment
Share on other sites

5 hours ago, Pete Dowson said:

And the Lua file doing your UDP exchange is running in FSUIPC5?

If so, that is weird. I certainly don't think a 32-bit DLL can run in a 64-bit process.

And things are getting weirder...
Removed socket_core.dll and it still works.
I have no other dll:s i the modules folder or its subfolders.
I execute the script with a fsuipc "key press" so everything runs in FSUIPC 5.14.

Link to comment
Share on other sites

16 hours ago, Bleedin said:

Removed socket_core.dll and it still works.
I have no other dll:s i the modules folder or its subfolders.
I execute the script with a fsuipc "key press" so everything runs in FSUIPC 5.14.

Hmmm. I don't understand how that's working.

If you have time and the inclination, do you think you could download Process Explorer and run it when P3D is running and check what DLLs are in use by the process. It will be an almighty long list though, so don't bother if it looks too daunting.

https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer

Pete

 

Link to comment
Share on other sites

1 hour ago, Pete Dowson said:

If you have time and the inclination, do you think you could download Process Explorer and run it when P3D is running and check what DLLs are in use by the process. It will be an almighty long list though, so don't bother if it looks too daunting.

Ok. I'll have a go at it tonight.

Link to comment
Share on other sites

32 minutes ago, Bleedin said:

Here is the list of DLLs used by the P3D-process.

The luascript with the socket operations was running when the list was made.

Thanks.

Very strange. No sign of anything specific to Lua or sockets. There wasn't a list expansion against the FSUIPC.DLL entry, was ther?. It something got loaded by FSUIPC (effectivel), then it might be there, like a subfolder entry.

I'm going to have to set up to PCs running P3D4 with  my LuaSockets example (from the Lua Examples ZIP) -- a Master-Slave link to make one sim follow the other. Not sure when I can fit that in though.

Pete

 

Link to comment
Share on other sites

  • 6 months later...
On 4/28/2019 at 8:47 AM, Fscats said:

Was any progress made on getting Lua sockets to work with Fsuipc V5.  I would really like to be able to leverage this.

Thanks much

Evan

As I reported in the thread: I have gotten socket (UDP, TCP) to work. Have successfully run code with UDP in two separate environments. Both with Fsuipc V5 and P3D V4.3 on win7.

Link to comment
Share on other sites

  • 4 years later...
15 hours ago, Ian Dale said:

Might this also be the explanation as to why require(“LUACOM”) works in FSX but not in P3D?

No. This is quite an old post. The lua COM library is working in all versions of FSUIPC. The 'LUACOM' library that you are using is different - it is a library to support the windows COM object library, not to read data from COM ports/sockets, which is what this thread is about.

As I said in the other thread, I have no idea why/how WideClient can load this library but not FSUIPC. As I said (in the other thread), I will take another look at this when time permits.

John

Link to comment
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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.