PDA

View Full Version : GlobalCache SendIR LUA function does not work



Dwightgb
September 11th, 2006, 06:00 PM
I have a GC-100 module set up on the network. I can ping from my computer. Using the Send IR GC events, I can send IR commands & the device response to the commands correctly. However, when I use the LUA equivalent command SendIR nothing happens. In fact the globalcache.New("192.168.1.70") command always returns valid even when the GC-100 module has been unplugged.

I must be missing something. Can anyone help.

tmorten
September 11th, 2006, 06:29 PM
Here's some code from my GML that works (note the last three parameters on SendIR... I seem to recall they weren't exactly as documented in the Girder docs):

-- Connect to the GC, if the Connection existed this retrieves the old object.
local a;
a = globalcache.New('192.168.2.100');

-- Check if we have a connection.
if not a then
print("Could not open GC");
return;
end

-- Activate an InFocus Screenplay7200 projector
a:SendIR('0000 006C 0022 0000 0158 00AF 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0060 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 00AF', 1,3,1)

Dwightgb
September 18th, 2006, 05:49 PM
Thank you for your reply, but the problem is that the connection over the network is never being made to the GC-100. Here is the code I am running:

--GC-100 test - connection
gcTest = globalcache.New("192.168.1.70")

if not gcTest then
print "gcTest not valid"
elseif gcTest == nil then
print "gcTest == nil"
else
print "gcTest valid"
end

From my code development machine I pinged the 192.168.1.70. It timed out every time. There is no GC-100 on this network.

When I run the above code on the development machine, I always get "gcTest valid" on the Interactive LUA Console.

I have used Ethereal to monitor packet activity from my box. When I pinged the address, Ethereal captured all of those packets. When I ran the above code, Ethereal captured no packets at all. I have no filters active in Ethereal.

I appears the LUA code is not connecting to the network even though it says it is. I have confirmed that "gcTest" table is not nil and has the correct Address value.

As I said in my first post, if I use the Global Cache action "Send IR GC" or "Send IR CCF", Ethereal captures packets.

On a system where the GC-100 is on the network and ping works, these actions work as advertized. So the problem appears to be related to using LUA to connect to the GC-100.

Sorry, but I still need help.

Dwightgb
September 28th, 2006, 11:01 AM
Thanks for your answer. The problem is that the LUA Script does not appear to send commands over the network. Do I have to request some module that is not automatically loaded?

Rob H
September 28th, 2006, 02:25 PM
This is one for Ron to look at I think.

Dwightgb
September 29th, 2006, 11:01 AM
Do I need to do something or wait for a reply?

Ron
September 29th, 2006, 11:25 AM
Sadly currently there is no way for you to know if the connection has been made. I'll have to change some stuff inside the gc plugin. Let me have a look....

Ron
September 29th, 2006, 11:41 AM
okay try this one.



gcTest = globalcache.New("192.168.1.70")

for i=1,10 do
print(gcTest:GetStatus())
win.Sleep(100)
end


GetStatus will return the following values:

'Connected'
'Connection Failed'
'Attempting Connection'
'Closed'

tmorten
October 1st, 2006, 01:45 PM
I thought I might give this a try to make my IR sending more reliable. With the new DLL, I get a luascript error:

Called from GlobalCache: globalcache.lua:47: attempt to index global `gip' (a nil value)
stack traceback:
globalcache.lua:47: in function <globalcache.lua:37>

Is this a configuration error on my end, or something about the new DLL?

Thanks,
Tim

Ron
October 1st, 2006, 03:28 PM
sounds like I referenced the GIP plugin. Can you enable that?

tmorten
October 1st, 2006, 04:07 PM
Thanks; that did the trick.

Cheers,
Tim

tmorten
October 1st, 2006, 07:31 PM
It only ever says "Attempting Connection" for me, though I'm able to successfully send IR commands.

Ron
October 2nd, 2006, 09:28 AM
that's weird. Are you waiting long enough,.. it might take a few seconds for the connect to happen.

tmorten
October 2nd, 2006, 12:57 PM
I had it try in a loop for 30 seconds, but the value remained at "Attempting Connection"... not a big deal (since the actual IR transmission seems to work fine), but it would be handy to be able to validate the connection.

Cheers,
Tim

Ron
October 2nd, 2006, 01:18 PM
I agree. Weird thing that it did work for me, I'll check what is going on.

nurowolf
October 3rd, 2006, 07:14 PM
Hey Ron, are you going to roll the GC connection status check into the standard distribution.

I think I would like to use this.

Ron
October 3rd, 2006, 07:20 PM
yeah this will go in.

nurowolf
October 3rd, 2006, 07:22 PM
Cool :grin:

I will what for the new package release ( that way I can stop myself from getting distracted from my current girder projects)

Dwightgb
October 5th, 2006, 12:20 PM
I enabled GIP but the code you suggested does not compile. It says that GetStatus is a nil value. I looked at gcTest in the variable display & it has an entry of type table. The address is correct but there is no function GetStatus.

I doing script testing on a system that does not have the device attached. I will test it later on a system that has the device connected.

I copied & pasted your code.

GIP is version 2.2, filename gip2.dll, API 3, device number 251

I am running Windows 2000.

I expect it is something obvious that I am missing. Any other plugins that I need.

Ron
October 5th, 2006, 12:22 PM
This update has gone into Girder 4.0.10, download that one. You are probably running an old GC plugin.