Jump to content
The simFlight Network Forums

Recommended Posts

That's correct.  It does not currently work from FSUIPC 5.  It will work with some slight modifications within WideFS since it is 32 bit.  Pete was unable to get sockets to compile correctly as 64 bit last I heard.

Dustin

Share this post


Link to post
Share on other sites

but widefs doesnt support event.control and other things i need. Pete are there plans to update this to 64bit when back from your holiday? 

Share this post


Link to post
Share on other sites
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

 

Share this post


Link to post
Share on other sites
3 hours ago, brian60 said:

Thanks, i have it working for now using an app that receives udp and sends it to a virtual serial port

Care to share more details so others can do this, please?

Pete

 

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
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

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
3 hours ago, brian60 said:

First I created ...

I see you did make a post in User Contributions. Thank you!

Pete

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

 

 

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
22 minutes ago, dru5412 said:

I just used 

local socket = require("socket");

and it seems to be working for me.

That simple? Thanks!

Pete

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
26 minutes ago, dru5412 said:

but have the other issue with event.offset, but hopefully totally unrelated.

And not even specific to event.offset, but to a misunderstanding aof what infonite loops mean! ;-)

Pete

 

Share this post


Link to post
Share on other sites
7 minutes ago, Pete Dowson said:

And not even specific to event.offset, but to a misunderstanding aof what infonite loops mean! ;-)

Pete

Yeap, User Error. 

My fault...

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


×