View Full Version : sending ASCII via tcp/ip
cameronl
September 2nd, 2006, 03:37 AM
hi there, I downloaded the demo of girder yesterday but I'm having trouble with it :)
I'm trying to send ASCII commands via tcp/ip to my projector.
I've read through the forums, read the part on gis in the manual but I'm still having trouble.
Is there a simple way of doing this i.e. like sending a serial command but instead of specifiing the com port I specify the ip port?
btw; girder wouldn't load up for me unto I removed the audiomixer.dll from the plugin directory.
thanks for your time.
CaM
Rob H
September 2nd, 2006, 04:04 AM
Yes, you need to use the GIP plugin for this.
If you just want to send then it's fairly straightforward, if you want to receive data back from the projector then it's a little more complex, but not too bad really.
Suppose that the projector is on IP address 192.168.0.5 and the port is 1234 then you'd open the port using
local socket = gip.Open('192.168.0.5', 1234)
if socket then
-- this should be okay, strictly speaking you should install a callback to check that the connection was made successfully
socket:Write('some string')
end
See the manual for the gip library for full details and post here if you need any more help.
What projector is it?
By the way, there is an alternative way to do this using a 'serial' device, at least in Girder 4.0.6 and up. It does mean creating the device manually, since there is no DUI support for it yet, but the new serial.Classes.Queued2 device class does support either a serial or IP transport layer. This has the advantage that you should be able to use the DUI actions to send to the projector.
cameronl
September 3rd, 2006, 03:14 AM
hi there, the projector is a projectiondesign action model two.
I'll look into creating a device once I get my frist script to run :)
so, I created a script, put it in the startup area (so I can test it). My code is the following (which btw doesn't seem to work).
local socket = gip.Open('192.168.1.90', 1025)
if socket then
socket:Write(':POWR 1\0x0D')
end
am I right in assuming the socket:Write part is where I put my ascii command?
If I open my ascii file in hyperterminal it actually displays it as
%001 POWR 000001
Are they both ascii?
thanks for your help :)
CaM
Rob H
September 3rd, 2006, 04:00 AM
That looks okay except you should use \r to terminate it (Carriage return in a Lua string)
The %100 bit is the acknowldege response from the projector. You'll have to add a callback to the socket if you want to see the responses in Girder
cameronl
September 3rd, 2006, 12:16 PM
ok, I've finally got it working!
lol, it took me a while to figure out I needed to include the gip plugin :)
thanks for your help.
CaM
Promixis
September 4th, 2006, 03:23 PM
what projector is this?
Rob H
September 5th, 2006, 01:22 AM
See http://www.projectiondesign.com/Default.asp?CatID=1432
cameronl
September 5th, 2006, 01:35 AM
yep, that link shows the one I have.
I can control it via cat5 or usb which is pretty cool :)
imho it is one of the best 720p pj's. My only complaint with it is the lack of 12v trigger.
CaM
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.