Jump to content
The simFlight Network Forums

Lua Socket 64 FSUIPC 5


Recommended Posts

On 9/10/2017 at 2:08 PM, brian60 said:

widefs doesnt support event.control and other things i need

event.control is triggered by FSUIPC detecting a control event being passed via the Sim's Windows message queue -- or, in some cases by using a Simconnect intercept function.  Whilst I cannot implement this in WideClient, it would be possible for a Sim-based plug-in the use the events to set flags orwhatever in user offsets so that the WideClient plug-in can use event.offset or event.offsetmask.

On the Lua sockets code, I'm afraid I really have no idea how to fix it. I need assistance on that.  Any network experts out there who can also get to grips with rather convoluted Lua code?

Pete

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

First I created two virtual serial ports with this free app com0com - https://sourceforge.net/p/com0com/news/2012/06/com0com-v3000-released/

it creates two virtual serial ports and links them together. One port is connected to a LUA script with com read and write and the other is connected to this

free app CommTunnel - http://www.serialporttool.com/CommTunnel.htm. this app even has a window so you can see whats being sent and received.

I use esp8266 12f wifi chips with mcp23017 gpio expanders(I2C version)  with adafruit library(for mcp23017) and arduino IDE for programming. (ordered in bulk from china they are very

cheap and you can chain 8 via I2C for 128 gpio ports on one esp12f). The 8266 is more powerful and has more memory and costs alot less than an arduino and has WIFI. you can get the

nodemcu devkit that has a serial interface on board but i am trying to cut out as many wires as possible.

 

Link to comment
Share on other sites

14 minutes ago, brian60 said:

First I created ...

That's very ingenious! Well done!

Would you care to post that in the User Contributions subforum, using an appropriately descriptive title? That way it is preserved where folks can find it instead of scrolling off (as this thread will).

Thanks!
Pete

 

Link to comment
Share on other sites

3 hours ago, brian60 said:

First I created two virtual serial ports with this free app com0com - https://sourceforge.net/p/com0com/news/2012/06/com0com-v3000-released/

it creates two virtual serial ports and links them together. One port is connected to a LUA script with com read and write and the other is connected to this

free app CommTunnel - http://www.serialporttool.com/CommTunnel.htm. this app even has a window so you can see whats being sent and received.

I use esp8266 12f wifi chips with mcp23017 gpio expanders(I2C version)  with adafruit library(for mcp23017) and arduino IDE for programming. (ordered in bulk from china they are very

cheap and you can chain 8 via I2C for 128 gpio ports on one esp12f). The 8266 is more powerful and has more memory and costs alot less than an arduino and has WIFI. you can get the

nodemcu devkit that has a serial interface on board but i am trying to cut out as many wires as possible.

 

Interesting work around.  The main reason I change to using lua sockets in the first place was due to the fact that I was losing a lot of data using the USB serial ports with the com lib and connecting to my panels which are Arduino Megas.  I suspect there are multiple reasons for this,  but have you experienced any data loss and/or corruption with this method?

Dustin

Link to comment
Share on other sites

21 hours ago, budman9mm said:

have you experienced any data loss and/or corruption with this method?

Its best to send small commands or just one offset or offsetmask at a time from the arduino  then let the luascript handle it. I am just using this for switches and indicators now.

Link to comment
Share on other sites

  • 1 month later...

You an get lua sockets under Fsuipc5.12b by loading the 32 bit luasocket library from
  http://files.luaforge.net/releases/luasocket/luasocket/luasocket-2.0.2/luasocket-2.0.2-lua-5.1.2-Win32-vc8.zip

unpacking it into "modules/Lua" and then replacing "socket/core.dll" with the one from  https://download.zerobrane.com/luasocket-win64.zip.

Luis Damas

Link to comment
Share on other sites

On 11/14/2017 at 8:26 AM, ldamas said:

You an get lua sockets under Fsuipc5.12b by loading the 32 bit luasocket library from
  http://files.luaforge.net/releases/luasocket/luasocket/luasocket-2.0.2/luasocket-2.0.2-lua-5.1.2-Win32-vc8.zip

unpacking it into "modules/Lua" and then replacing "socket/core.dll" with the one from  https://download.zerobrane.com/luasocket-win64.zip.

Aha! Excellent! Thank you very much, Luis!

So, then, what would the "require" declarations need to be in your Lua code as I'd like to document this in the installed Lua PD). You'd need to provide for the missing 64-bit socket.core, mime.core DLLs which were buillt into 32-bit FSUIPC, and presumably also the ltn12.lua, socket.lua and mime.lua which I also included?

Sorry if I appear ignorant about this stuff, but, in fact, I am! :-(

Thanks,
Pete

 

 

Link to comment
Share on other sites

2 hours ago, Pete Dowson said:

So, then, what would the "require" declarations need to be in your Lua code as I'd like to document this in the installed Lua PD). You'd need to provide for the missing 64-bit socket.core, mime.core DLLs which were buillt into 32-bit FSUIPC, and presumably also the ltn12.lua, socket.lua and mime.lua which I also included?

I tried what Luis suggests early on into this thread.  The require statement was the problem I ran into because Lua kept balking at everything I tried ( I cannot recall right now as to the exact error, I can try again if it will help).  

Luis, if you figured this out, I will be very happy!  Intently awaiting your reply.

-Dustin

Link to comment
Share on other sites

On 15/11/2017 at 5:21 PM, Pete Dowson said:

Aha! Excellent! Thank you very much, Luis!

So, then, what would the "require" declarations need to be in your Lua code as I'd like to document this in the installed Lua PD). You'd need to provide for the missing 64-bit socket.core, mime.core DLLs which were buillt into 32-bit FSUIPC, and presumably also the ltn12.lua, socket.lua and mime.lua which I also included?

Sorry if I appear ignorant about this stuff, but, in fact, I am! :-(

Thanks,
Pete

 

 

I just used 

 

local socket = require("socket");

 

and it seems to be working for me.

Link to comment
Share on other sites

1 hour ago, Pete Dowson said:

That simple? Thanks!

Pete

 

Well all i can say is for me, i downloaded the lua and core.dll as described and seemed to work without needing any other change.. 

When I say worked ( i can open socket and communicate over it) but have the other issue with event.offset, but hopefully totally unrelated.

Link to comment
Share on other sites

  • 4 weeks later...
On 11/20/2017 at 10:45 AM, dru5412 said:

Well all i can say is for me, i downloaded the lua and core.dll as described and seemed to work without needing any other change.. 

When I say worked ( i can open socket and communicate over it) but have the other issue with event.offset, but hopefully totally unrelated.

I was finally get some real time to test this out and I am happy to report that after a few initial tests,  sockets is now working! 

 

On 11/15/2017 at 12:21 PM, Pete Dowson said:

You an get lua sockets under Fsuipc5.12b by loading the 32 bit luasocket library from
  http://files.luaforge.net/releases/luasocket/luasocket/luasocket-2.0.2/luasocket-2.0.2-lua-5.1.2-Win32-vc8.zip

unpacking it into "modules/Lua" and then replacing "socket/core.dll" with the one from  https://download.zerobrane.com/luasocket-win64.zip.

It's the first step that, the best I can recall, that I didn't do before.  I think I was only overwriting the core.dll in the second step.  So many thanks for getting this to work!

-Dustin

Link to comment
Share on other sites

  • 10 months later...

I ran into this problem also.
I need lua sockets for fsuipc 5 in P3D V4.x x64.
Found the solution in this thread but unfortunately the link to the x64 ”socket/core.dll” is dead (404) and I can’t find it elsewhere.
Does anyone have the file to share or a working link?

/Bleedin

Link to comment
Share on other sites

48 minutes ago, Bleedin said:

The problem is that I need a 64-bit version. Can’t find any x64 binaries.

Oh, I thought they were included with the 2.0.2 release. That's a pity.

48 minutes ago, Bleedin said:

Also tried to compile them myself but with no success.

I had the same problem.  The code is dense and sparsely commented. Very complicated with its extensive use of stacks.

I wonder what happened to the link posted originally. Perhaps I should have downloaded then and hosted it here, but you don't really expect links to stop working.

Maybe you can persuade one of those who did manage to get it to supply it. I could then host it here.  Try posting an appeal if you can't PM an existing user.

Pete

 

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.