View Full Version : Tansport Send response timeout????
sorka
March 19th, 2009, 09:13 AM
I've setup Girder to control my TiVo in another room with a TiVo remote. I'm using TiVo's ASCII commands through tcp. I've configured a bunch of transport send wizards for each remote. I had to translate the ascii into hex because girder won't let me enter a carriage return \r at the end of the command which TiVo uses as the terminator.
The main problem I'm having though is that there appears to be a timeout waiting for the response. It appears to be 1000 ms. This means that I can't send out more than one command a second which is really slow.
Does anyone know if this default timeout can be changed or removed?
I thought about doing these through a script. There are even examples on how to open up a port and send text in the manual, but the example uses a hard coded tcp address but the address will be changing from time to time, so I'd like to be able to change it by modifying the transport entry in the transport manager. Is there a way to get access to an already open port in the transport manager from the scripting?
Thanks.
Ron
March 19th, 2009, 09:15 AM
Can you attach the script you are using?
sorka
March 19th, 2009, 09:21 AM
I'm not using a script. I'm using the transport send action dialog and creating one of these for each event.
Ron
March 19th, 2009, 09:27 AM
The transport send action works in conjunction with a script. In the drop-down "Select Transport Device" what did you select?
sorka
March 19th, 2009, 09:38 AM
In the "select transport device", I selected "TiVo" which is the transport device I configured in the transport manager with an ip and port.
In the text window below, I enter my hex values and check the "hex" checkbox as I'm not using ascii because I have to terminate the command with a \r (0x0d)
Ron
March 19th, 2009, 09:42 AM
Ok! We are getting somewhere.
If you go to the transport manager and highlight the Tivo entry. What does the "detail" text below say? (Should be about 4 lines of text). Take a screenshot if it's too much.
sorka
March 19th, 2009, 09:54 AM
Ahh, now we are getting somewhere. So the last line in the details is "Denon AVR control and status feedback".
I take it that when I added the device, it was for a profile that includes a script that is waiting for a response.
There are other choices that also include various script tutorials.
Ron
March 19th, 2009, 09:55 AM
Yep, we'll need to customize one for you. This should not be to bad. Do you have an API available?
sorka
March 19th, 2009, 10:21 AM
Having another strange problem first. Whenever I quite girder and restart it, I have to re-enable components in the component manager and add the ip and ports back into the transport devices as the all get erased every time I quit. This wasn't happening before. Before I could quit and and relaunch Girder and everything was as it was before
Ron
March 19th, 2009, 10:31 AM
Are you getting any errors in the lua console?
sorka
March 19th, 2009, 10:40 AM
Yes,
LOG: Component Manager : 4 - UnitSystem Unable to read config file UnitSystem.cfg Config File Open Failed
Welcome to Promixis Girder 5.0.8 build 542
...ram Files\Promixis\Girder5\\luascript\compat-5.1.lua:169: module `transport.devices.DenonAVReceiver.lua~' not found
stack traceback:
[C]: in function `error'
...ram Files\Promixis\Girder5\\luascript\compat-5.1.lua:169: in function <...ram Files\Promixis\Girder5\\luascript\compat-5.1.lua:160>
...ram Files\Promixis\Girder5\\luascript\compat-5.1.lua:191: in function `require'
...is\Girder5\luascript\components\TransportManage r.lua:343: in function `ReadTransportClassFile'
...is\Girder5\luascript\components\TransportManage r.lua:269: in function `LoadTransportClasses'
...is\Girder5\luascript\components\TransportManage r.lua:302: in function `LoadSerialClasses'
...is\Girder5\luascript\components\TransportManage r.lua:111: in function `LuaStateIsReady'
...iles\Promixis\Girder5\luascript\ComponentManage r.lua:676: in function `StartEnabledComponents'
...iles\Promixis\Girder5\luascript\ComponentManage r.lua:229: in function <...iles\Promixis\Girder5\luascript\ComponentManage r.lua:228>
[C]: ?
...iles\Promixis\Girder5\luascript\ComponentManage r.lua:228: in function <...iles\Promixis\Girder5\luascript\ComponentManage r.lua:227>
sorka
March 19th, 2009, 10:46 AM
OK, I got it all fixed. Also added a new transport class and set the parser type to DISABLE.
Next question is, is there a way to go back and retrofit all of my send transport events with the new transport device?
Whenever I bring up the dialog for the send events, the transport is set back to the default and the text is missing. If I exit without saving, it remains unchanged, but if I select the new transport device, it then saves the fact that there's not text in the window.
Ron
March 19th, 2009, 10:54 AM
Great, I've also made the loader routine more fault tolerant.
I am not clear what is going wrong for you. Are you in fact opening the actions you created (in the tree on the right) or are you creating new transport send actions by clicking in the tree on the left?
sorka
March 19th, 2009, 10:59 AM
I'm double clicking on already created actions in the my subtree for my remote event mappings. When the box comes up, if I press the test button, the event gets sent even though the text in the send box is empty, the ascii/hex checks are unchecked, and the transport shows the default.
sorka
March 19th, 2009, 11:46 AM
Ron, still having problems with my transport class.
Could you post a simple example of a class that has the parser type set to DISABLE?
I've tried modifying one of the scripts to do this, but when the transport tries to connect, it just says connecting....
Thanks.
Ron
March 19th, 2009, 11:50 AM
I am not sure DISABLE would do what you want.
Do you have the API so I can have a look what would be appropriate?
sorka
March 19th, 2009, 11:56 AM
Not sure what you mean by API.
If you mean the protocol, then it's simple ascii. Examples
IRCODE UP\r
IRCODE DOWN\r
etc.
They are fire and forget not response expected from the device.
The manual says to set the parser type to DISABLE when any incoming data is expected to be discarded.
sorka
March 19th, 2009, 11:57 AM
Just to re-iterate. I want to send ascii to a TCP port without expecting a response. No parsing, no timeouts, etc.
Ron
March 19th, 2009, 12:16 PM
Here you go place this file under <GIRDER>luascript/transport/devices
then restart Girder and use the "Simple Send" Device to create a new device in the transport manager. Any data sent to this device will not require a response.
sorka
March 19th, 2009, 12:26 PM
Thanks. I dropped it in the transport directory and tried it. Just get "Connecting..." and it never connects. This looks like the example I worked up first from the tutorial4 file.
The transaction based examples work just fine and connect every time.
The problem is they're expecting a response. It's still working in that the tuturial 2 example I modified works and I just set the response timeout to something really low. But the the problem is if I set it to lower than about 50 ms, something locks up in the scripting and stops sending tcp packets. Anything above 50 ms seems to be fine.
sorka
March 19th, 2009, 12:31 PM
Correction. Looks like I have to set the timeout to 100 or so.
Ron
March 19th, 2009, 12:33 PM
Messing with the timeout is not the way to go in this case. You want to ignore responses altogether.
The snippet I sent you works on my end here. I am not sure why it is not working for you. Are you getting any errors? Can you upload the script that is indeed working for you?
sorka
March 19th, 2009, 01:02 PM
The stock tutorial2 example works as does the Denon AVR.
Ron
March 19th, 2009, 01:09 PM
I have no idea why this is not working with the file i sent you. Anyway, make a copy of tutorial2.lua name it "mysend.lua" make the following changes to that file:
line 16 change to
module("transport.devices.mysend")
around line 193 BEFORE the "})" but after "end," add this:
Send = function ( self, data )
if self.Transport then
-- the false below indicates we don't care about the return values.
return self.Transport:Send(data, false)
end
end,
sorka
March 19th, 2009, 01:36 PM
Awsome! That works perfectly!!
Thank you!!
-Alan
Ron
March 19th, 2009, 01:41 PM
Very good!!
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.