Test Luup code (Lua): JobHandler_LuaUPnP::RunLua no global lua interface

I can’t seem to get any Luup code to run. I’m using the Test Luup code (Lua) feature with a simple log command using a device id of 0 like the wiki suggests.

luup.log("Test Hello")

I get the following from the log file:

10	06/22/10 12:25:42.435	UPnPCallbackEventHandler action RunLua request pMem 0x74b000/7647232 diff: 368640 <0x340e>
10	06/22/10 12:25:42.436	sbrk JobHandler_LuaUPnP::HandleActionRequest pMem 0x74b000/7647232 diff: 368640 <0x340e>
08	06/22/10 12:25:42.437	JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: RunLua <0x340e>
08	06/22/10 12:25:42.437	JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=0 <0x340e>
08	06/22/10 12:25:42.438	JobHandler_LuaUPnP::HandleActionRequest argument Code=luup.log("Test Hello") <0x340e>
01	06/22/10 12:25:42.439	JobHandler_LuaUPnP::RunLua no global lua interface <0x340e>
10	06/22/10 12:25:42.440	UPnPCallbackEventHandler action RunLua request done pMem 0x74b000/7647232 diff: 368640 took 0 <0x340e>

With this line in red:
01 06/22/10 12:25:42.439 JobHandler_LuaUPnP::RunLua no global lua interface <0x340e>

Any ideas?

Are you on UI4? If so, the device number is not optional anymore.

I’m on UI4. I’m entering 0 as the device id as it says here: http://wiki.micasaverde.com/index.php/Luup_Debugging

In Vera's web ui choose Devices, Luup plugins and click 'Test Lua UPnP code'. For the device number put in the number of the device you are debugging, which is shown when you click the + button next to the device. Or, if your Lua code isn't going to be calling any of the functions and variables you created in that device, you can just put in a device number of 0, which means this snippet of code runs by itself. If you put in a valid device number for a Luup plugin, it runs in the context of that device meaning it can call the other functions and variables in the plugin.

I don’t want to run the code in the context of a device because I don’t have any yet! I just want to run the code :). I ended up downloading a MiOS plugin just to run code.

The wiki has not been updated for UI4 (which I think is correct since UI4 is in Beta). There is no global lua context in UI4, so you need to run the code in the context of a device. I believe you could use the context of a physical device.

Ok, thanks for the info! Got something working finally!