So I was doing some Lua programming for scene control and things were going well. Then I noticed Scenes stopped working. I kept paring things down until I got to nothing but a comment or “return true” in my Lua code and I always get “Received Empty Response” when I test the code with the Go button. I am using firmware 1.0.979 and have reloaded it already. I’m kind of stumped now and would appreciate some troubleshooting direction.
Not this is of any help, but I’ve run into the same thing. The code works fine and then some unknown event happens and it starts returning an empty response. its been doing that since the first luup release I tried. I eventually just abandoned the lua code out of frustration, hoping it will get fixed in a later release.
Enable detailed logging, make the error occur, and then submit a ticket in the UI. They’re trying to chase down these conditions and they can probably do it from the diagnostics collected.
This has happened to me. Turned out that there was a syntax error in one of my LUA scenes. Unfortunately, it was not the one I was currently working on, so it took me awhile to realize what the problem was. The syntax error caused the LUA engine to fail to load.
Suggestion: Try removing all LUA code (save it to a text file so you can copy/paste it back) until LUA starts working again, then carefully put the code back one scene at a time, until you find the problem one. You can see if the LUA engine is working by putting a simple statement in the “Test Lua Code” area, and try running it (I use the simple LUA statement: local buff=“ABC” to see if the LUA engine is okay)
Thanks aa6vh. Looks like I am back up and running now. I had no idea an error in one scene Lua code would break everything, including the Lua test code function. I guess the error in the code breaks the Lua engine at startup. I submitted a trouble ticket after detail logging, for what it’s worth.
Thanks to you all from me too!! That was exactly my problem as well. One lua error took down all the lua code. Is that stated somewhere in the Wiki?? It should!!!
The syntax of Lua is verified before execution. If the code is valid, then it will be executed, so you always should test the code before adding in to a scene. In some cases, the code can have valid syntax, but different variables type. An ex: you can assign or fetch some numeric (int) value from Vera and then do something with it and assign it to a text, boolean or other type. Then the result will be the crashing of Lua engine until the next restart. This if you don’t add a virtual device with bad code.
I received no error messages when saving the Lua code in the scene itself, nor has the scene been executed. It appears that just having a syntax error in a scene code, when the Lua engine is loading during a reboot, will cause the Lua engine to crash.
In my case, the syntax error was an invalid if statement:
aa6vh if you enable verbose logging: /usr/bin/VerboseLogging.sh enable and follow the log: tail -f /var/log/cmh/LuaUPnP.log after you press save and the engine restart you should see the lua syntax error in the log like this:
10 01/11/10 11:25:23.934 JobHandler_LuaUPnP::CreateLuaInterfaces created global 0x76f260 <0x400>
01 01/11/10 11:25:23.936 LuaInterface::StartEngine: [string "function scene_4()..."]:2: ')' expected near '=' <0x400>
10 01/11/10 11:25:23.939 Code: