Jump to content
The simFlight Network Forums

chris178

Members
  • Posts

    6
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    LHR

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

chris178's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi Pete Sorry for delay in response but had two very busy days at work... I did some 'building' exercises trying to build luasocket again yesterday evening but not much success - I will update tomorrow. As to the github luasocket - there is a green button "clone or download" on the right top cornet where the code directory tree is displayed allowing to download whole package (use 'Download ZIP' sub-button). Just in case url is: https://github.com/diegonehab/luasocket/archive/master.zip . Other way is to use 'git' to clone project structure onto local file system. Best regards Chris
  2. Thanks Pete for update. This all seems to be a little bit too much for my knowledge - i feel like "trying to fix a space rocket being only a plumber" :) I've just taken a crash course on command line compiling with windows (quite frustrating). Tool I was hoping was going to help me - luarocks uses CLI cl.exe. At the end of the task (and many problems with header and library files... from both VC and win SDK) I've got brand new core.dll for socket and mime modules (mime might not be needed...). I've installed quickly VS Express 2008 for this task - and reading your above explanation - this could have been a bad choice. There is good and bad news. 1. Good news - command line stand-alone lua (5.1.4) interpreter on my Win7 machine now reports latest luasocket version (LuaSocket 3.0-rc1). Sample mclistener.lua works well joining mcast group. 2. Running luasocket version test script with FSUIPC (new core.dll in place) now returns: 1112318 *** LUA Error: error loading module 'socket3.core' from file 'C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\modules\lua\socket3\core.dll': The specified procedure could not be found. Different Visual Studio, libraries, etc? Best regards Chris
  3. Hi Pete, Tried to use latest luasocket library but without success... I'm bit puzzled. That's what I did: 1. Created lua dir in FSX modules directory. 2. Layout as follows (following luasocket installation manual): Directory of C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\lua 27/06/2008 11:18 8,469 ltn12.lua 01/06/2016 23:10 <DIR> mime 01/06/2016 23:14 2,521 mime.lua 01/06/2016 23:18 <DIR> socket3 01/06/2016 23:15 5,012 socket3.lua Directory of C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\lua\mime 15/10/2007 18:08 12,800 core.dll Directory of C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\lua\socket3 15/10/2007 18:08 29,184 core.dll 26/05/2016 11:20 9,243 ftp.lua 26/05/2016 11:20 3,698 headers.lua 26/05/2016 11:20 12,330 http.lua 26/05/2016 11:20 8,074 smtp.lua 26/05/2016 11:20 3,612 tp.lua 26/05/2016 11:20 11,036 url.lua 3. As you see modified lib name to socket3 and relevant dir/files. 4. It also make sense to modify a line in socket3.lua : local socket = require("socket3.core") This unfortunately causes error message in debug window: 4308389 *** LUA Error: error loading module 'socket3.core' from file 'C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\modules\lua\socket3\core.dll': The specified module could not be found. Although the file core.dll in fact exits there (taken from lua 5.1.4 clibs installation folder). Perhaps not matching exactly LUA version built into FSUIPC? 5. If I leave socket3.lua unmodified ( local socket = require("socket.core") ), then all seems to be running but my impression is that build in luasocket is run and my test script: socket = require("socket3") print(socket._VERSION) returns: 5177284 LUA.0: LuaSocket 2.0.2 Unfortunately I'm not software engineer and my experience here is very limited. Any ideas what I'm doing wrong? BTW: Here is a bit from NEW file of recent luasocket package: What's New Main changes for LuaSocket 3.0-rc1 are IPv6 support and Lua 5.2 compatibility. * Added: Compatible with Lua 5.2 - Note that unless you define LUA_COMPAT_MODULE, package tables will not be exported as globals! * Added: IPv6 support; - Socket.connect and socket.bind support IPv6 addresses; - Getpeername and getsockname support IPv6 addresses, and return the socket family as a third value; - URL module updated to support IPv6 host names; - New socket.tcp6 and socket.udp6 functions; - New socket.dns.getaddrinfo and socket.dns.getnameinfo functions; * Added: getoption method; * Fixed: url.unescape was returning additional values; * Fixed: mime.qp, mime.unqp, mime.b64, and mime.unb64 could mistaking their own stack slots for functions arguments; * Fixed: Receiving zero-length datagram is now possible; * Improved: Hidden all internal library symbols; * Improved: Better error messages; * Improved: Better documentation of socket options. * Fixed: manual sample of HTTP authentication now uses correct "authorization" header (Alexandre Ittner); * Fixed: failure on bind() was destroying the socket (Sam Roberts); * Fixed: receive() returns immediatelly if prefix can satisfy bytes requested (M Joonas Pihlaja); * Fixed: multicast didn't work on Windows, or anywhere .... so obviously I'm eager to get this lib working ... but perhaps there are unavoidable conflicts with build-in luasocket library? Best regards
  4. Hi Pete It looks like Diego Nehab has moved development of the luasocket to https://github.com/diegonehab/luasocket. The latest version seems to be 3.0-rc1. And it looks like my ubuntu lua package is installed with the latest luasocket. This could be reason why mcast join works in my linux environment, but of course there could be some other reasons. Thanks for suggestion using external library capacity - I'll give it a try with the latest luasocket from github (renamed). Best regards
  5. Thanks Pete for quick response - I'm quite amazed. To be honest - I don't know much about WideServer, but my idea is to use linux OS in device communicating with FS. With regard to my original post - I've run a test on my ubuntu 14.04 machine and LUA 5.2 environment running below exact code: local socket = require("socket") host = "230.1.1.1" port = "7001" udp = socket.udp() udp:setsockname(host, port) print(udp:setoption("ip-add-membership" , { multiaddr = "230.1.1.1", interface = "*"})) while 1 do data, ip, port = udp:receivefrom() if data then print("RX: ", data) end socket.sleep(0.01) end print(udp:setoption("ip-add-membership" , { multiaddr = "230.1.1.1", interface = "*"})) returns just "1" in console and I can see in network analyser "membership Report / Join group 230.1.1.1 for any source" packet sent via NIC. Exactly same code run through FSUIPC on Win7 64 bit machine reports for above line "nil setsockopt failed". Perhaps older/different version of LuaSocket library used in FSUIPC? I'm obviously just guessing here. But it looks like lua not able to send/trigger right thing in Win7 tcpip stack. This is my guess. I don't know if anything can be done on this from your point of view, but if not I'm going to turn back and use unicasts (that use normal arp/routing tables in the OS). Thanks any way Pete. Best regards Chris
  6. Hi All, I'm having an issue setting up LUA script for UDP multicast communication. The idea behind udp multicast implementation is that I could get independent from client/server machine's IP addresses and instead use pre-defined multicast addresses. This should save hassle setting correct FS destination IP address on all devices talking to FS lua multicast listener over multicast. Here is the relevant part of my multicast listening script (instance that should join specified UDP multicast group and process messages sent to that group): host = "230.1.1.1" port = "7001" udp = socket.udp() udp:setpeername(host, port) print(udp:setoption("ip-add-membership" , { multiaddr = "230.1.1.1", interface = "*"})) IP traffic analysed with wireshark revealed that script isn't sending multicast join group message (to the network/switch), so no multicast traffic is distributed from the switch to the FS machine running above LUA script. There would be some other solutions on the switch setup to make it flood all ports with multicast data, but it would be very interesting to find out why above "join" command doesn't work? Console debug window shows issue with multicast join command (udp:setoption("ip-add-membership" , { multiaddr = "230.1.1.1", interface = "*"})): debug info is: nil "setsockopt failed" I'm running Windows 7 64 Pro. Would this be some sort of bug in lua's socket library not "talking" correctly to windows tcpip stack or something else? Any advice would be much appreciated. Chris
×
×
  • 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.