16
Python Scripting / Re: Help! My Vox isn't running a command except for via the green arrow in cmd edit!
« on: March 04, 2016, 05:59:38 PM »
It gives me an error with access denied to the Com port, although I make sure to close the port before I log out, so that windows doesn't assign it to a process that is non-existent when it wakes up.
I can't figure out what it is...
I just saw that it gave me the following error (I included the successful attaching of the file which I use to interface with my Arduino first):
Error:
BUT when I use my voice to first close the com port:
And then open it again:
It works! If only it would work this well to do the exact same thing in the macro...
I have a weekend now, and what are weekends for (for pupils) but to have free-time... Another programming night! Yay!
Thanks for all your time Almighty Vox-Meister (James)!
Oskar
P.S I will test this tonight (now for me) and if it doesn't work I might ask for help here.
I can't figure out what it is...
I just saw that it gave me the following error (I included the successful attaching of the file which I use to interface with my Arduino first):
Code: [Select]
04/03/2016 22:38:05 721 Action: PY.ExecFile - D:\My files\Programs\VoxCommando\Scripts\Arduino.py
04/03/2016 22:38:05 721 [action] PY.ExecFile:D:\My files\Programs\VoxCommando\Scripts\Arduino.py
04/03/2016 22:38:05 725 Action INFO: code OK, no result
04/03/2016 22:38:05 725 action repeat set to: 1
Error:
Code: [Select]
04/03/2016 22:38:05 725 Action: PY.ExecString - OpenSerial()
04/03/2016 22:38:05 725 [action] PY.ExecString:OpenSerial()
04/03/2016 22:38:05 814 [plugin] Python Error:Line: 16 >>
SystemError: Access to the port 'COM3' is denied.
04/03/2016 22:38:05 949 [plugin] System.UnauthorizedAccessException: Access to the port 'COM3' is denied.
at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
at System.IO.Ports.SerialStream..ctor(String portName, Int32 baudRate, Parity parity, Int32 dataBits, StopBits stopBits, Int32 readTimeout, Int32 writeTimeout, Handshake handshake, Boolean dtrEnable, Boolean rtsEnable, Boolean discardNull, Byte parityReplace)
at System.IO.Ports.SerialPort.Open()
at Microsoft.Scripting.Interpreter.ActionCallInstruction`1.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
at IronPython.Compiler.PythonCallTargets.OriginalCallTarget0(PythonFunction function)
at IronPython.Runtime.FunctionCaller.Call0(CallSite site, CodeContext context, Object func)
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at IronPython.Compiler.PythonScriptCode.Run(Scope scope)
at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)
at Microsoft.Scripting.Hosting.CompiledCode.Execute(ScriptScope scope)
at vcPlugin.iPy.execString(String strCode)
04/03/2016 22:38:05 950 Action ERROR: Line: 16 >>
SystemError: Access to the port 'COM3' is denied.
BUT when I use my voice to first close the com port:
Code: [Select]
04/03/2016 22:38:34 384 guessed text:Close ?? (Kodi Simple actions)
04/03/2016 22:38:34 632 guessed text:Close com ?? (Startup)
04/03/2016 22:38:34 948 Something was recognized
04/03/2016 22:38:34 948 Rulename: root # Semantics: 1
04/03/2016 22:38:34 948 Group: Startup Speech: Close com
04/03/2016 22:38:34 948 semanticID: 529
04/03/2016 22:38:34 948 kvp: command | 529
04/03/2016 22:38:34 949 semanticID: 529
04/03/2016 22:38:34 949 kvp: command | 529
04/03/2016 22:38:34 949 alternate:Close com
04/03/2016 22:38:34 963 doCommand:Close Com3
04/03/2016 22:38:34 963 action repeat set to: 1
04/03/2016 22:38:34 963 Action: PY.ExecString - CloseSerial()
04/03/2016 22:38:34 963 [action] PY.ExecString:CloseSerial()
04/03/2016 22:38:34 964 Action INFO: code OK, no result
And then open it again:
Code: [Select]
04/03/2016 22:38:38 205 guessed text:open com ?? (Startup)
04/03/2016 22:38:38 509 Something was recognized
04/03/2016 22:38:38 509 Rulename: root # Semantics: 1
04/03/2016 22:38:38 509 Group: Startup Speech: open com
04/03/2016 22:38:38 509 semanticID: 485
04/03/2016 22:38:38 510 kvp: command | 485
04/03/2016 22:38:38 510 semanticID: 485
04/03/2016 22:38:38 510 kvp: command | 485
04/03/2016 22:38:38 510 alternate:open com
04/03/2016 22:38:38 515 doCommand:Open Com3
04/03/2016 22:38:38 515 [plugin] Sending json request:
04/03/2016 22:38:38 515 action repeat set to: 1
04/03/2016 22:38:38 515 [plugin] {"jsonrpc": "2.0", "method": "GUI.ShowNotification", "params":{"title":"open com (70.9)","message":"(1 Open Com3) "},"id": "0"}
04/03/2016 22:38:38 515 Action: PY.ExecString - OpenSerial()
04/03/2016 22:38:38 515 [action] PY.ExecString:OpenSerial()
04/03/2016 22:38:38 519 Action INFO: code OK, no result
It works! If only it would work this well to do the exact same thing in the macro...
I have a weekend now, and what are weekends for (for pupils) but to have free-time... Another programming night! Yay!
Thanks for all your time Almighty Vox-Meister (James)!
Oskar
P.S I will test this tonight (now for me) and if it doesn't work I might ask for help here.