View Full Version : Serial only works oince after LUA reset

mattie herring
September 16th, 2012, 08:29 PM
Howdy all,

So I am a newb at girder/LUA, and am having issues with a device driver that I am using to control and Optoma tw615-3d projector. All I really want to do is turn it on/off via girder, and I have been able to send it commands through the serial send action that work just fine if they are done after a Lua reset (F11), but which fail after that. Here is a typical snippet of the LUA log that shows what I am talking about

Welcome to Promixis Girder 5.0.14 build 551
Serial: Optoma TW615 3d : Simple Send: 7E 30 30 33 37 20 33 0D ~0037 3.
Serial: Optoma TW615 3d : Simple Receive: Data 50 P Code: 1
Serial: Optoma TW615 3d : Simple Send: 7E 30 30 30 30 20 30 0D ~0000 0.
Serial: Optoma TW615 3d : Simple Receive: Data Code: 16384
Serial: Optoma TW615 3d : ERROR: No response to last command
Serial: Optoma TW615 3d : Simple Receive: Data 49 4E 46 4F 32 INFO2 Code: 1
Serial: Optoma TW615 3d : Simple Receive: Data 49 4E 46 4F 30 INFO0 Code: 1

This first command (in this case, a gamma setting command, chosen to be random and make sure that I wasn't messing the codes up somehow) runs just fine, and you see the 'P" returned to indicate that it passed. The second command, to turn it off, just seems to go into the ether. I have gotten this command (~0000 0) to work just fine after F11. Also, I have verified that so long as a <CR> is sent, I should get a response (at least from a serial console like putty or Hercules) even if it is a failure. the terminator for send is <CR> and I seem to have that working, as before I got it working the device just wouldn't respond at all. Also, I am just using the stubbed Initialize and ReceiveResponse (I really don't care, for this device at least, if I receive a response). Finally, the last two responses received are from when the Projector was turned off with a remote.

Also (editing this now) it appears from looking at the moxa serial server I am using this for that girders is simply not sending any data after the first time following a reset.

For my driver I am using the Simple serial object. Below if what my driver looks like:

Device Driver

local Super = serial.Classes.Simple
local device = Super:New({
Name = "Optoma TW615 3d",
GlobalName = "Optoma TW615 3d",
Description = "Optoma TW615 3d projector, useds in 132 and TT (dide fills 132)",

LogLevel = 0,-- change this to a higher number or false when the device is working

BaudRate = 9600,
Parity = 0,
DataBits = 8,
StopBits = 1,
FlowControl = 'N',

CallbackType = serial.CB_TERMINATED,
ReceiveTerminator =string.char(13),

SendStartByte = '~',
SendTerminator = string.char(13),
IncompleteResponseTimeout = 500,
NoResponseTimeout = 1000,

Initialize = function(self)
if Super.Initialize(self) then
-- add your own initializations here
self.Status = 'Initialized'
return true

ReceiveResponse = function(self, data, code)
if math.band(code, serial.RXCHAR) > 0 then
-- add code here to process the data parameter
Super.ReceiveResponse(self, data, code) -- must call the parent's ReceiveResponse



BTW, The Optoma command codes start with a ~, and terminate with a <CR> (0x0d, or dec 13). It returns P for success and F for failure, and also occasionally some INFO codes that it fails to have documented anywhere (I'd past the link to the documentation, but as a newb the forum won't let me).

Thanks a bunch, and please let me know if (or what :)) newb mistake I am making here.


September 19th, 2012, 12:33 PM
I have a similar issue and hope there is a fix!

September 19th, 2012, 12:36 PM
Have you tried using the transport classes instead?

mattie herring
September 19th, 2012, 03:10 PM
thanks for the response.

I have not looked closely at the transport classes, as I was following the instructions in the manual and also used the serial device creator to get started, since I am not familiar with Lua or indeed, even really a developer. Is it necessary to use these classes to get a serial driver working?

Thanks again,