Not sure if I should tag this on the end of this topic or start a new one.
I'm trying to put together a set of commands to control networked Tivos (Virgin Media Tivo here in the UK, Tivo Premiere etc in US)
I'm using the TCP plugin and I've got it working almost all of the time but, and this is the strange bit, only when running the code from the editor. When I try to use Voice it always fails.
Command:
<?xml version="1.0" encoding="utf-16"?>
<command id="1609" name="tivo power toggle" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="On my Virgin Media TV it requires the power button to be pressed twice to turn off. 
Whilst not required to press twice to turn on it does no harm and allows me to have a single event to toggle off/on">
<action>
<cmdType>Tcp.Client.Connect</cmdType>
<cmdString>tivotcp&&192.168.18.22&&31339&&\x0d</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Tcp.Client.Write</cmdType>
<cmdString>tivotcp&&IRCODE STANDBY\x0d&&1000</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Tcp.Client.Write</cmdType>
<cmdString>tivotcp&&IRCODE STANDBY\x0d&&1000</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TCP.Client.Disconnect</cmdType>
<cmdString>tivotcp</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>tivo power</phrase>
<event>tivo_toggle</event>
</command>
Annotated log
Garry - This was a voice command
20/03/2014 20:12:04 658 doCommand:tivo power toggle
20/03/2014 20:12:04 658 action repeat set to: 1
20/03/2014 20:12:04 658 Action: Tcp.Client.Connect - tivotcp&&192.168.18.22&&31339&&\x0d
20/03/2014 20:12:04 658 [action] Tcp.Client.Connect:tivotcp&&192.168.18.22&&31339&&\x0d
20/03/2014 20:12:04 658 [plugin] Tcp: New thread created for client: tivotcp
20/03/2014 20:12:08 215 [vcevent] TCP.StartListen.tivotcp
20/03/2014 20:12:08 215 action repeat set to: 1
20/03/2014 20:12:08 215 Action: Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:08 215 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:08 215 [plugin] Tcp: TCP.ClientError: System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at vcPlugin.tcpClient.listenToServerLoop()
20/03/2014 20:12:08 215 [vcevent] TCP.ClientError.tivotcp
20/03/2014 20:12:08 215 action repeat set to: 1
20/03/2014 20:12:08 215 Action: Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:08 215 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:08 215 Event Error: Thread was being aborted.
20/03/2014 20:12:08 215 [vcevent] TCP.EndListenLoop.tivotcp
20/03/2014 20:12:08 215 [vcevent] TCP.StartListen.tivotcp
20/03/2014 20:12:08 215 [vcevent] TCP.Reconnecting.tivotcp
20/03/2014 20:12:08 215 [plugin] Tcp: TCP.ClientError: System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at vcPlugin.tcpClient.listenToServerLoop()
20/03/2014 20:12:10 288 [vcevent] TCP.ClientError.tivotcp
20/03/2014 20:12:10 288 action repeat set to: 1
20/03/2014 20:12:10 288 Action: TCP.Client.Disconnect - tivotcp
20/03/2014 20:12:10 288 [action] TCP.Client.Disconnect:tivotcp
20/03/2014 20:12:10 288 [vcevent] TCP.EndListenLoop.tivotcp
Garry -- now try same thing from editor
20/03/2014 20:12:20 518 [vcevent] VC.OpenEditor
20/03/2014 20:12:20 518 options: loading options
20/03/2014 20:12:20 518 options: verifying speech engine culture language
20/03/2014 20:12:33 293 doCommand:tivo power toggle
20/03/2014 20:12:33 293 action repeat set to: 1
20/03/2014 20:12:33 293 Action: Tcp.Client.Connect - tivotcp&&192.168.18.22&&31339&&\x0d
20/03/2014 20:12:33 293 [action] Tcp.Client.Connect:tivotcp&&192.168.18.22&&31339&&\x0d
20/03/2014 20:12:33 293 [plugin] Tcp: New thread created for client: tivotcp
20/03/2014 20:12:33 293 [vcevent] TCP.StartListen.tivotcp
20/03/2014 20:12:33 293 action repeat set to: 1
20/03/2014 20:12:33 293 Action: Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:33 293 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:33 293 action repeat set to: 1
20/03/2014 20:12:33 293 Action: Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:33 293 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:35 325 action repeat set to: 1
20/03/2014 20:12:35 325 Action: TCP.Client.Disconnect - tivotcp
20/03/2014 20:12:35 325 [action] TCP.Client.Disconnect:tivotcp
20/03/2014 20:12:35 325 [vcevent] TCP.EndListenLoop.tivotcp
20/03/2014 20:12:41 652 doCommand:tivo power toggle
20/03/2014 20:12:41 652 action repeat set to: 1
20/03/2014 20:12:41 652 Action: Tcp.Client.Connect - tivotcp&&192.168.18.22&&31339&&\x0d
20/03/2014 20:12:41 652 [action] Tcp.Client.Connect:tivotcp&&192.168.18.22&&31339&&\x0d
20/03/2014 20:12:41 652 [plugin] Tcp: New thread created for client: tivotcp
20/03/2014 20:12:41 652 [vcevent] TCP.StartListen.tivotcp
20/03/2014 20:12:41 652 action repeat set to: 1
20/03/2014 20:12:41 652 Action: Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:41 652 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:41 652 action repeat set to: 1
20/03/2014 20:12:41 652 Action: Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:41 652 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:43 686 action repeat set to: 1
20/03/2014 20:12:43 686 Action: TCP.Client.Disconnect - tivotcp
20/03/2014 20:12:43 686 [action] TCP.Client.Disconnect:tivotcp
20/03/2014 20:12:43 686 [vcevent] TCP.EndListenLoop.tivotcp
Garry - editor closed now trying with voice command again
20/03/2014 20:12:50 409 doCommand:tivo power toggle
20/03/2014 20:12:50 409 action repeat set to: 1
20/03/2014 20:12:50 409 Action: Tcp.Client.Connect - tivotcp&&192.168.18.22&&31339&&\x0d
20/03/2014 20:12:50 409 [action] Tcp.Client.Connect:tivotcp&&192.168.18.22&&31339&&\x0d
20/03/2014 20:12:50 409 [plugin] Tcp: New thread created for client: tivotcp
20/03/2014 20:12:50 409 [vcevent] TCP.StartListen.tivotcp
20/03/2014 20:12:50 409 action repeat set to: 1
20/03/2014 20:12:50 409 Action: Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:50 409 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:50 409 [plugin] Tcp: TCP.ClientError: System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at vcPlugin.tcpClient.listenToServerLoop()
20/03/2014 20:12:52 138 [vcevent] TCP.ClientError.tivotcp
20/03/2014 20:12:52 138 action repeat set to: 1
20/03/2014 20:12:52 138 Action: Tcp.Client.Write - tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:52 138 [action] Tcp.Client.Write:tivotcp&&IRCODE STANDBY\x0d&&1000
20/03/2014 20:12:52 138 Event Error: Thread was being aborted.
20/03/2014 20:12:52 138 [vcevent] TCP.EndListenLoop.tivotcp
20/03/2014 20:12:52 138 [vcevent] TCP.StartListen.tivotcp
20/03/2014 20:12:52 138 [vcevent] TCP.Reconnecting.tivotcp
20/03/2014 20:12:52 138 [plugin] Tcp: TCP.ClientError: System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at vcPlugin.tcpClient.listenToServerLoop()
20/03/2014 20:12:52 138 [vcevent] TCP.ClientError.tivotcp
20/03/2014 20:12:52 138 action repeat set to: 1
20/03/2014 20:12:52 138 Action: TCP.Client.Disconnect - tivotcp
20/03/2014 20:12:52 138 [action] TCP.Client.Disconnect:tivotcp
20/03/2014 20:12:52 138 [vcevent] TCP.EndListenLoop.tivotcp
20/03/2014 20:12:57 698 shutting down form, saving window state
20/03/2014 20:12:57 698 Minimizing to notification area
20/03/2014 20:13:00 628 focused: Idle
20/03/2014 20:13:00 628 [vcevent] unFocused.VoxCommando
20/03/2014 20:13:00 628 [vcevent] focused.Idle
20/03/2014 20:13:03 613 focused: explorer
20/03/2014 20:13:03 613 [vcevent] unFocused.Idle
20/03/2014 20:13:03 613 [vcevent] focused.explorer