Ian Dale Posted October 6, 2023 Report Posted October 6, 2023 I wondered if anyone could help. I'm having problems getting a Lua script that has been run using WideFS to find the luacom.dll file whereas Lua opened using FSX FSUIPC directly finds it fine. The command is merely require("luacom"). I've checked the package.path and package.cpath and believe the file is in the appropriate location... but the WideClient log still reports: 18734 *** LUA Error: error loading module 'luacom' from file 'C:\Users\xxx xxx\OneDrive\Desktop\WideClient\modules\lua\luacom.dll': The specified module could not be found. Does anyone know of a fix?
John Dowson Posted October 6, 2023 Report Posted October 6, 2023 It may be because it is under your windows Desktop folder. which has certain restrictions. Try moving it to a non-windows protected folder. If WideClient is installed there, also move that to a new location. Is the lua script requiring this in the same location? If not, try moving it to the same folder as the lua script.
Ian Dale Posted October 6, 2023 Author Report Posted October 6, 2023 That's interesting, I've tried changing folders to the D drive, moving LUACOM.DLL into this new WideClient folder alongside WideClient and the Lua code, have changed the LUA package.path and package.cpath to ensure they recognise this folder and now LUACOM.DLL seems to be found so that is progress thanks. But now we get a new error that doesn't appear when using FSUIPC/Lua alone only WideFS/Lua, I wonder why? Error: 2406 LUA: Path D:/WideClient/?.dll; 2406 LUA: CPath D:/WideClient/?.dll; 2406 *** LUA Error: error loading module 'luacom' from file 'D:/WideClient/luacom.dll': D:/WideClient/luacom.dll:1: '=' expected near ''
John Dowson Posted October 8, 2023 Report Posted October 8, 2023 Could it be a problem with your package.path and package.cpath settings? I am not sure why you are changing these - I have never touched these. Try removing the changes you made to these - it should work with the default settings. But it does seem that the dll is being found. Is this the same luacom.dll that is being loaded in FSUIPC? If you still get issues, can you attach the luacom.dll file you are using and I can try it here, but this will be on Monday or Tuesday.
John Dowson Posted October 8, 2023 Report Posted October 8, 2023 Btw, why are you requiring this com library anyway? The complete com library is built into WideFS7 and you shouldn't require it...
Ian Dale Posted October 8, 2023 Author Report Posted October 8, 2023 Luacom drives our Phidget cards John if we use it via FSX. We want to use P3D with Phidgets, and as P3D is 64bit whereas Luacom is 32 bit the two are incompatible. As WideFS is 32 bit we are attempting that route. So far we have been unable to address the Phidget21.dll or Phidget22.dll using FSUIPC COM library lua directly although that might be lack of knowledge. Its the exact same file we are using with FSUIPC... copied and pasted.
John Dowson Posted October 8, 2023 Report Posted October 8, 2023 As i said, if you can attach the file I can take a look...next week sometime....
Ian Dale Posted October 8, 2023 Author Report Posted October 8, 2023 That would be amazing John thanks, it’s attached below. Simply put our ultimate need is to get Phidget 1012 (0/16/16) Interface cards working in a P3D environment with LUA just like we can with FSX, our current planned method is via LUACOM but suggest using WideFS to run it as its 32 bit. If you know a better method to use vanilla LUA with FSUIPC (P3D) to open and run a Phidget card, we’d love to hear it. luacom.dll
John Dowson Posted October 10, 2023 Report Posted October 10, 2023 I am getting the same error you initially reported ("The specified module could not be found.") in both FSX and WideClient: Quote 52438 *** LUA Error: error loading module 'luacom' from file 'D:\Steam\steamapps\common\FSX\modules\lua\luacom.dll': The specified module could not be found. How did you get the dll loaded in FSUIPC4? Did you write the lua program that uses the luacom.dll, or was that supplied to you? Could you attach that as well please (if allowed). There really is no difference in WideClient’s Lua facilities to those in FSUIPC (except where explicitly stated of course), so I’ve no idea why the 32-bit LuaCom.dll gives errors there but not with FSUIPC4. Do you know the lua version that the luacom.dll was built with/for? There seems to be a 64-bit fork of the luacom project, so I could try building () that. However, I would like to get the 32-bit version loaded by FSUIPC4 first.... Later: Some success....I installed the latest lua-for-windows package and took the luacom.dll from there, and used this to replace the one you provided. This now loads ok in both FSUIPC4 and in WideClient, so it looks to be a problem with that dll. Are you sure it is the same one that you are using with FSUIPC4? I have attached the one I am using (it is slightly larger than the one you provided, 168KB vs 164KB) - it is the one that comes with the 5.1.4 lua distribution: luacom.dll Can you please try with that version. Cheers, John
John Dowson Posted October 10, 2023 Report Posted October 10, 2023 Btw, it seems that WideClient is crashing when using that luacom.dll I attached, shortly after or when the script loading the luacom.dll library is terminated. I also tried switching back to your version of the luacom.dll and now I see the same as you - it loads ok in FSUIPC4 but not in WideClient. I would be interested to see if you can use that luacom.dll, and also why this is different than the one you provided - maybe it is an older version? Anyway, please try that version and let me know how it goes, both with WideClient and FSUIPC4. This library is for using Microsoft's Component Object Model (COM) interface, not for handling COM ports, which is what the FSUIPC COM library is used for. Thee two COM libraries are therefore very different...! It maybe that using this library also requires that lua is also installed in Windows, which is why it didn't work for me before I installed it. I still don't understand why this is different in WidecCient though... 1
Ian Dale Posted October 10, 2023 Author Report Posted October 10, 2023 That’s great progress John, I will be back with the PC this is installed on over the weekend and will try the version of LUACOM you attached. The LUA is bespoke and written specifically for the project so I won’t be able to share publicly, but can PM elements to you for testing if that’s ok? Yea, we have LUARocks installed too, perhaps the issue lies in the version of LUA to make this work? it is highly likely that we’re using an older version of LUACOM. I didn’t compile it so don’t know the system used to create it and it’s been around since 2006 I believe 😮
John Dowson Posted October 10, 2023 Report Posted October 10, 2023 Not sure how much, if any, progress there is...! As I say, I can load that dll in WideClient but it crashes soon after, and I don't know why. I would like to see if you see the same though...and if that works in FSUIPC4 for you. 7 minutes ago, Ian Dale said: The LUA is bespoke and written specifically for the project so I won’t be able to share publicly, but can PM elements to you for testing of that’s ok? That's ok - I don't need to see this. I still don't understand why your dll loads ok in FSUIP4 but not in WideClient (they use the same lua compiler). I will see if I can determine why, but still not sure how to go about this at the moment... 1
John Dowson Posted October 25, 2023 Report Posted October 25, 2023 Did you make any progress with this?
Ian Dale Posted October 28, 2023 Author Report Posted October 28, 2023 Hi John Sorry for the late response as we've been off site due to torrential flooding blocking access to the sim. Today I've tested the file you attached and get the same error: 9969 *** LUA Error: error loading module 'luacom' from file 'D:/WideClient/Lua/luacom.dll': D:/WideClient/Lua/luacom.dll:1: '=' expected near '' Thanks for the help on this. Ian
Ian Dale Posted March 22 Author Report Posted March 22 Good morning, I wondered if anything had come to mind over what might be causing this issue John? It would be amazing to get Phidgets compatible.
John Dowson Posted March 22 Report Posted March 22 No idea, sorry. I haven't looked at this since our last discussions, but I don't think there is much I can do about this. I will take another look when time permits. John 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now