Left here for archival purposes.
User avatar
By limbo
#10221 I had this experience lot of times.
If you load a broken file (a file with syntax errors) to the module named as init.lua and run it (or restart the module) the result will be be trapped into endless boot loop.

The module will prompt you with a message and after a while will boot again.
A message will look line this:
Code: Select all> PANIC: unprotected error in call to Lua API (init.lua:57: unexpected symbol near 'true')

Maybe I'm wrong but in this case the only solution I found to escape this bootloop trap is to reflash the module with the firmware! (I need you opinion on this)

However by tricking the start up process you can avoid an error like this.
This is the best solution for this problem for the moment:
Use the following code as init.lua and pass to NextFile variable your actual code. By using this trick you will get 5 seconds delay no matter the NextFile brings.
This is enough time to delete or rename the tricky file and start over with a new try.

Code: Select all--Startup file--
 l = file.list();
    for k,v in pairs(l) do
    --  print("name:"..k..", size:"..v)
         if k == NextFile then
         print("Wait 5 seconds please")
         tmr.alarm(0, 5000, 0, function() dofile(NextFile) end)
         print("Started file ".. NextFile)
       --  do nothing
print("End of startup")   
User avatar
By limbo
jankop wrote:I give quickly from a terminal (LuaLoader) command file.remove("init.lua").

Well it depends on com port speed I suppose. I tried lot of times to remove file , rename file or even format the file system but no juice!
So I had to start working with the code provided as solution on my post above.