Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - 01ste02

Pages: 1 [2] 3
16
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):

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...  :bonk

I have a weekend now, and what are weekends for (for pupils) but to have free-time... Another programming night! Yay!  :biglaugh

Thanks for all your time Almighty Vox-Meister (James)!  ;D

Oskar

P.S I will test this tonight (now for me) and if it doesn't work I might ask for help here.



17
Sorry, it doesn't work! I will post the code here as soon as I solve it.

Btw, that part I could use some help on that part!

What I think that the problem is is that Vox doesn't get admin rights when the computer boots from hibernate although it had admin rights before the hibernate.

I don't know how to automatically give it admin rights without a popup as soon as the computer boots from hibernate, can someone teach me? Preferably without regedit...

Thanks

Oskar

18
XML Exchange / Alarms (Clocks and home alarms)
« on: March 02, 2016, 02:17:48 PM »
I just wanted to know, I am curious by nature  :biglaugh

19
Oscar,
if you ever need to open the same port by 2 programs you can use something like VSPE (http://www.eterlogic.com/Products.VSPE.html)...
I use it to access XAP800 audiomixer serial port by VC and the software supplied by the manufacturer...

Thank you Sir!

It will be useful to me some day, but not right now. I have an task planned which requires just that!

It was just a simple question of merging the two scripts together (I hope, testing in five minutes).

Thanks anyway

Oskar

20
Thank you James;D

I found out after reading your post that I opened the port from two separate python scripts, which I have now merged!

Now I think it works, it was just a stupid error which anyone could have come up with. It was just one of those times where anyone but you can see the error.  :bonk

And sorry for wasting your time, I had been working on this for over a week!

Best regards and have fun on your trip!

Oskar

Ps. Now I will post the correct command group in the xml exchange folder as soon as I test it!

21
XML Exchange / Re: My current setup/implementation
« on: March 01, 2016, 04:43:01 PM »
It's odd.  I can't see why it would freeze, but if it did, I don't see how adding VC.Pause would prevent the freezing.  All it would do is guarantee that it would freeze for 1/2 second everytime your TTS started.  Maybe you can try it again without the pause to see if it works.  An even better solution would probably be one of the following:

A) When TTS starts talking, mute your microphone.  There is an action for setting the microphone input level.  When TTS stops, reset the input level to whatever you prefer.  This technique will work with almost any microphone.  There are a few microphones that don't actually respond to a change in their input level but they are rare.

B) Select the option in the TTS plugin settings to "disable speech recognition during TTS.SpeakSync" and then use TTS.SpeakSync in most of your commands.  Of course this will freeze VC while it is talking but I've never seen this cause a problem yet.  This will not be a good option for you if you want to use the "Talking Head".

Ah... if only it were as simple as that.  Asynchronous programming in a UI driven program is much more complicated than simply calling wait instead of delay.

Still for longer wait times we do have options.  It is up to you what is an acceptable amount of time to use VC.Pause which will temporarily freeze VoxCommando.  For me, I would say 500 is my limit before I would start looking for other options.

For long delays the best and safest solution is to use an event timer (VC.SetEventTimer) to trigger a command.  You can also pass this new command payloads which is handy and there are ways to cancel the timer too.

But there are occasionally times when you really want to just use VC.Pause anyway and it is possible to do it asynchronously so that VC will not freeze up.  In order to do this you can rename your command so that it starts with ++ (two plus symbols).  My advice to all users, and the reason why this feature is not documented in the wiki, is to only use this when you really need it, in order to avoid the possibility of errors caused from multiple threads interfering with each other.

Have fun and play safe!  :biglaugh

I now remember why I had that pause in, it was because there is a 300 ms input delay to my stereo (due to old audio-processing circuits), so that will continue to talk after VC is done!

Thanks again

Oskar

Ps. Can you maybe take a look at my new post on the support page, since you and your wife has already helped me so much with the AlarmClock command group? I will post a HUGE improvement to that script as soon as that is solved.

22
Hello!

I have this problem where Vox is starting a python file without errors when I click the green arrow in command tree editor, but when I  start the macro by voice it gives me an access denied error.

I made a video about the error, because one picture can tell a thousand words (and with 60 fps and three minutes that is a lot of words  ;) ).

Here is the video link: https://youtu.be/GR8UhhNqK68

Here is the code from the first command that I showed in the video (the process of connecting is exactly the same here as in the second command that I show):
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<command id="440" name="StartHomeAutomation" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Launch.RawParam</cmdType>
    <params>
      <param>D:\My files\Programs\EventGhost\EventGhost.exe</param>
      <param />
      <param>True</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Launch.CMD</cmdType>
    <params>
      <param>sc start "TelldusService"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>PY.ExecFile</cmdType>
    <params>
      <param>D:\My files\Documets\Dokument\PythonScripts\SendToggle.py</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>VC.Loaded</event>
  <event>System.Resume</event>
  <event>WakeupCall</event>
  <phrase>Connect to telldus</phrase>
</command>

Here is the "intestines"  :biglaugh of the second file which is the one that is supposed to connect to the Arduino:

Code: [Select]
import clr
clr.AddReference('System')
from System import *
serialPort = IO.Ports.SerialPort("COM3")
serialPort.BaudRate = 9600
serialPort.DataBits = 8
serialPort.Open()

def arduinoWrite(str):
    serialPort.Write(str)

def CloseSerial():
    serialPort.Close()


Thanks for your time and sorry for my bad pronunciation!

Oskar

23
XML Exchange / Re: My current setup/implementation
« on: February 16, 2016, 03:59:13 AM »
I just made the sound.up(grad) as a new type of command.

I am now using Sound.setVolume() and then VC.setEventTimer and now it works great!

Thanks for all the help and this amazing program!

24
Thanks James!

Will try that out tomorrow!

Do I need to log in to skype on RoboB?

Best regards and thanks for the support!

Oskar

EDIT: Thanks for all the help man! It worked!

25
What is "the FP"?

Sorry, saw you use that in another thread...  :bonk

It is friendly payload...

It looks correct in the logs (it doesn't place a call though), but between skype and VC there is a problem and it ends up trying to call this weird string :(

Thanks for trying, I just thought that anyone else would have the same problem... Just saw that it doesn't even generate the skype events (no calls to contacts or this weird string) :(

Can you give me a download of just the skype plugin, if there is a corrupted file?

Thanks for trying! I know that I am also not the best at asking for help (describing the error for anyone else so that they understand).

Best regards

Oskar

26
Log looks like:

Code: [Select]
23/01/2016 16:42:17 VoxLog created:
23/01/2016 16:42:17 742 guessed text:Call ?? (Skype)
23/01/2016 16:42:17 991 guessed text:Call D ?? (Skype)
23/01/2016 16:42:18 241 guessed text:Call David ?? (Skype)
23/01/2016 16:42:18 618 Something was recognized
23/01/2016 16:42:18 618 Rulename: root # Semantics: 2
23/01/2016 16:42:18 618 Group: Skype Speech: Call David
23/01/2016 16:42:18 618 semanticID: 516
23/01/2016 16:42:18 618 kvp: command | 516
23/01/2016 16:42:18 618 kvp: payload1 | <516:Pelle Persson, David>live:puffelgullig_1
23/01/2016 16:42:18 618 no regex match found
23/01/2016 16:42:18 618 id from payload value: 516
23/01/2016 16:42:18 620 semanticID: 516
23/01/2016 16:42:18 620 kvp: command | 516
23/01/2016 16:42:18 620 kvp: payload1 | <516:Pelle Persson, David>live:puffelgullig_1
23/01/2016 16:42:18 620 no regex match found
23/01/2016 16:42:18 620 id from payload value: 516
23/01/2016 16:42:18 620 alternate:Call David
23/01/2016 16:42:18 626 doCommand:Ring upp...
23/01/2016 16:42:18 626 [plugin] Sending json request:
23/01/2016 16:42:18 626 [plugin] {"jsonrpc": "2.0", "method": "GUI.ShowNotification", "params":{"title":"Call David (96.8)","message":"(1 Ring upp... [Pelle Persson, David]) "},"id": "0"}
23/01/2016 16:42:18 626 action repeat set to: 1
23/01/2016 16:42:18 626 Action:  Skype.CallContact - live:puffelgullig_1
23/01/2016 16:42:18 626 [action] Skype.CallContact:live:puffelgullig_1

23/01/2016 16:42:18 627 [plugin] Skype plugin action received
23/01/2016 16:42:18 638 Action INFO:
23/01/2016 16:42:18 668 [plugin] Skype - duplicate call status event
23/01/2016 16:42:19 627 [plugin] Web Exception while calling JSON RPC:{"jsonrpc": "2.0", "method": "GUI.ShowNotification", "params":{"title":"Call David (96.8)","message":"(1 Ring upp... [Pelle Persson, David]) "},"id": "0"}
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.168.0.118:8080
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
   at System.Net.HttpWebRequest.GetRequestStream()
   at vcPlugin.xJsonHttpCommunicator.PostRequest(String strRequest)
23/01/2016 16:42:25 886 [plugin] Skype plugin action received
23/01/2016 16:42:33 657 Focused: OpenWith
23/01/2016 16:42:33 657 [vcevent] Unfocused.VoxCommando

23/01/2016 16:42:33 659 [vcevent] Focused.OpenWith

Payload:

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<!--A VoxCommando Payload file-->
<PayloadsRoot>
    <payload>
        <value>echo123</value>
        <phrase>Echo / Sound Test Service</phrase>
    </payload>
</PayloadsRoot>

(Edited out my contacts, same thing happens when I call Echo /Sound test service)


Thanks!

27
Sorry!

I am calling for example my brother:

Friendly Payload (Payload phrase)= David

Payload value (Skype-id)= live:********


When I call the skype id using the FP it calls the numbers instead of the value. I tried to use a "manual" payload, the area for testing payloads, but still the same.

28
Hi all!

I was wondering if I might get some help here, my skype won't call from VC.

I have connected it and followed jamesĀ“s tutorial on youtube, but all skype will call is:

(see attached image 1)

Full name: (attached image 2)

It calls different numbers every time and has done so for the last 6 months.

The payload xml is ok, all is set according to James tutorial.

Best regards

Oskar Stenberg

29
XML Exchange / Re: My current setup/implementation
« on: January 10, 2016, 05:03:24 AM »
Thanks!

I will try it without the pause, and I think alternative A :)

The ++ I will try, but school just started, so I have only one hour of programming per week left :(

Thanks for all the help and the great program

Oskar Stenberg

30
XML Exchange / Re: My current setup/implementation
« on: January 09, 2016, 03:15:11 AM »
They are both concerned about it as a fire hazard, and a risk for getting hacked. It is never on when we leave home either  :o

It worked to bring the PC out of sleep and log in, but as you said James VC acted a little strange.

It didn't wake me, it didn't react to the old eventTimer that I set last night, and it didn't set a new timer when I woke it...

Changed the code to the following:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<command id="446" name="CheckForAlarmTime" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Map.Get</cmdType>
    <params>
      <param>AlarmPermaVar</param>
      <param>AlarmTime</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.SetEventTimer</cmdType>
    <params>
      <param>{LastResult}</param>
      <param>WakeupCall</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>VC.Loaded</event>
  <event>VC.RebuildComplete</event>
  <event>Unfocused.Idle</event>
</command>

Wonder if it will work now when I set it to react to Unfocused.Idle (it will try to set a new eventTimer when it wakes). Else I guess that I will have to Restart VC using my task to wake the computer, it sets a new timer then (confirmed)!

@PegLegTV

Solved it! It worked with Windows task scheduler! Thanks for the tip!


Thanks for all the help!

By the way, James... Your wife told me that there was alternative solutions to make a pause instead of VC.Pause. Can you tell me any?

Best Regards and thanks for your time!

Oskar

Pages: 1 [2] 3