PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Help with scripts => Topic started by: theclansmen on 01 September, 2014, 15:13:50

Title: freshstuff start failed
Post by: theclansmen on 01 September, 2014, 15:13:50
hey there
i need your help.
i figured out how to make a PtokaX server run on raspberrypi
but now i want to make freshstuff.lua start and i doesn't.

Freshstuff is 5.0.1 and PtokaX is either 0.4.1.2 or 0.5.0.2 both on lua 5.1

scripts is found with command !getscripts
result is (0) freshstuff.lua

when i try to start it with !startscript freshstuff.lua
i get *** error, script freshstuff.lua start failed.
*** Freshstuff3 5.0.1 detected PtokaX 0.5.0.2 host app
*** loaded 8 releases in 0 seconds
*** Freshstuff3 5.0.1 kernel loaded

but i won't start on both PtokaX. need help please.
Title: Re: freshstuff start failed
Post by: the-master on 02 September, 2014, 18:32:02
Your ***error is no error, it's scriptloading, plz post errors or try explaining your problem correct.
Title: Re: freshstuff start failed
Post by: illustris on 17 February, 2016, 06:55:59
I have the same problem. I think it is because freshstuff comes with windows DLLs for the lua filesystem library. I installed the lua-filesystem library and replaced PXLFS.dll with lfs.so, but that didn't work either
Title: Re: freshstuff start failed
Post by: the-master on 17 February, 2016, 12:12:52
What problem? theres no problem specified.. freshstuf started and no errors given..
Title: Re: freshstuff start failed
Post by: illustris on 18 February, 2016, 01:35:28
there is no clear error message to show what the error is. All it says is

[06:01:25] <WoodStock> *** Error, script freshstuff.lua start failed.
[06:01:25] *  *** FreshStuff3 5.0.1 detected PtokaX 0.5.2.1 as host app.
[06:01:25] *  *** Loaded 0 releases in 0.0024030000000002 seconds.
[06:01:25] *  *** FreshStuff3 5.0.1 kernel loaded.

If anyone can tell me where this elusive "real error message" is, i can post it here.
Title: Re: freshstuff start failed
Post by: the-master on 18 February, 2016, 08:08:37
Plz post the version of Pto you're using..

[2016-02-17 17:09] *** *** FreshStuff3 5.0.1 detected PtokaX 0.5.2.1 as host app.
[2016-02-17 17:09] *** *** Loaded 1 releases in 0 seconds.
[2016-02-17 17:09] *** *** FreshStuff3 5.0.1 kernel loaded.
[2016-02-17 17:09] *** *** FreshStuff3 5.0.1 'extras' module loaded.
[2016-02-17 17:09] *** *** FreshStuff3 5.0.1 'requester' module loaded.
[2016-02-17 17:09] *** Loaded 0 requests in 0 seconds.

I think you need to change script/freshstuff/libnew/PXLFS.dll
Title: Re: freshstuff start failed
Post by: PPK on 18 February, 2016, 10:59:09
Quote from: illustris on 18 February, 2016, 01:35:28
If anyone can tell me where this elusive "real error message" is, i can post it here.
Check if you have in Settings.pxt
QuoteLogScriptErrors   =   1
Then all scripts error are written in ptokax_dir/logs/script.log
Title: Re: freshstuff start failed
Post by: illustris on 19 February, 2016, 03:49:38
Fri 19 Feb 2016 01:47:01 UTC - /home/pi/PtokaX/scripts/freshstuff.lua:57: module 'pxlfs' not found:
        no field package.preload['pxlfs']
        no file '/home/pi/PtokaX/scripts/freshstuff/pxlfs.lua'
        no file '/home/pi/PtokaX/scripts/freshstuff/libnew/pxlfs.dll'


I tried renaming PXLFS.dll to pxlfs.dll and got this error
Fri 19 Feb 2016 02:41:24 UTC - error loading module 'pxlfs' from file '/home/pi/PtokaX/scripts/freshstuff/libnew/pxlfs.dll':
        /home/pi/PtokaX/scripts/freshstuff/libnew/pxlfs.dll: invalid ELF header


I tried copying the lfs.so file from /usr/lib/arm-linux-gnueabihf/lua/5.1/lfs.so to the libnew folder and renaming it to pxlfs.dll and got this error
Fri 19 Feb 2016 02:45:54 UTC - error loading module 'pxlfs' from file '/home/pi/PtokaX/scripts/freshstuff/libnew/pxlfs.dll':
        /home/pi/PtokaX/scripts/freshstuff/libnew/pxlfs.dll: undefined symbol: luaopen_pxlfs

Title: Re: freshstuff start failed
Post by: the-master on 19 February, 2016, 08:09:05
Try using these files, copied from running freshstuf on Pto 0.5.2.1 32bit
Title: Re: freshstuff start failed
Post by: illustris on 19 February, 2016, 08:40:13
I can get freshstuff working on windows without any issues. The problem is, it comes bundles with pxlfs.dll, which was compiled for x86 windows. That will not work on my raspberry pi.
a .so file is the UNIX equivalent of a dll ( http://www.codeproject.com/Articles/13501/Platform-Independent-Coding-DLLs-and-SOs )
The freshstuff zip you gave would work in windows, but not linux because it uses the platform dependent pxlfs.dll
Title: Re: freshstuff start failed
Post by: the-master on 19 February, 2016, 09:10:50
Quoteit comes bundles with pxlfs.dll, which was compiled for x86 windows
I had to replace it with proper dll, so it's bundled with a prior version  :(
But freshstuff is a release script, how about other release scripts?
Title: Re: freshstuff start failed
Post by: illustris on 19 February, 2016, 10:04:58
I finally got it working. Here's what i did

cp /usr/lib/arm-linux-gnueabihf/lua/5.1/lfs.so <PtokaX path>/scripts/freshstuff/libnew
or if you're on x86 linux,
cp /usr/lib/x86_64-linux-gnu/lua/5.1/lfs.so <PtokaX path>/scripts/freshstuff/libnew

edit freshstuff.lua and replace :
1. 
require "pxlfs"
with 
require "lfs"
2.
package.cpath=Core.GetPtokaXPath().."scripts/freshstuff/libnew/?.dll"
with 
package.cpath=Core.GetPtokaXPath().."scripts/freshstuff/libnew/?.so"
Title: Re: freshstuff start failed
Post by: the-master on 19 February, 2016, 11:30:45
WD  :D
My guess.. :huh: it's using both places with the dll/so files. :boxed:
Title: Re: freshstuff start failed
Post by: PPK on 19 February, 2016, 11:44:44
Quote from: illustris on 19 February, 2016, 10:04:58
2.
package.cpath=Core.GetPtokaXPath().."scripts/freshstuff/libnew/?.dll"
with 
package.cpath=Core.GetPtokaXPath().."scripts/freshstuff/libnew/?.so"
Or better solution. Remove package.cpath from that script and then it will use lua libraries from paths set on os ;) Script should not change paths, because then it is "Defective by Design" ...