Author Topic: arduino issues  (Read 4983 times)

0 Members and 1 Guest are viewing this topic.

chilliman

  • Jr. Member
  • **
  • Posts: 30
  • Karma: 1
    • View Profile
arduino issues
« on: July 30, 2015, 01:28:52 PM »
Hi Guys.
i was trying the Arduino controlling 4 relays which i thinks James wrote the code for and a short video i followed all instructions the Voxcommando part worked fine calling the correct codes but fro some reason it was not opening the port (com12) not sure why, here is the log from voxcommando.
 
Code: [Select]
7/30/2015 12:08:48 PM VoxLog created / UAC test passed.
7/30/2015 12:08:48 PM 855 OS: Microsoft Windows NT 6.1.7601 Service Pack 1
7/30/2015 12:08:48 PM 855 Build: 7601
7/30/2015 12:08:48 PM 856 .Net version: 4.0.30319.17929
7/30/2015 12:13:59 PM 626 Kinect object is null, using default input
7/30/2015 12:13:59 PM 653 [vcevent] VC.On

7/30/2015 12:14:02 PM 206 guessed text:Load playlist ?? (JRiver load playlist)
7/30/2015 12:14:04 PM 578 guessed text:Load playlist Image ?? (JRiver load playlist)
7/30/2015 12:14:05 PM 76 guessed text:Load playlist Recently ?? (JRiver load playlist)
7/30/2015 12:14:06 PM 513 Rulename: root # Semantics: 2
7/30/2015 12:14:06 PM 513 Group: JRiver load playlist Speech: Load playlist Recently Played
7/30/2015 12:14:06 PM 514 semanticID: 1206
7/30/2015 12:14:06 PM 514 command ID: 1206
7/30/2015 12:14:06 PM 514 semanticID: 1206
7/30/2015 12:14:06 PM 514 kvp: command | 1206
7/30/2015 12:14:06 PM 514 kvp: payload1 | <1206:Recently Played>-1002
7/30/2015 12:14:06 PM 514 id from payload: 1206
7/30/2015 12:14:06 PM 515 semanticID: 1206
7/30/2015 12:14:06 PM 515 kvp: command | 1206
7/30/2015 12:14:06 PM 515 kvp: payload1 | <1206:Recently Played>-1002
7/30/2015 12:14:06 PM 515 id from payload: 1206
7/30/2015 12:14:06 PM 515 alternate:Load playlist Recently Played
7/30/2015 12:14:06 PM 582 doCommand:Load playlist {1}
7/30/2015 12:14:06 PM 582 action repeat set to: 1
7/30/2015 12:14:06 PM 582 Action:  JRiver.Raw - Playlist/Files?PlaylistType=ID&Action=Play&Playlist=-1002
7/30/2015 12:14:06 PM 582 [action] JRiver.Raw:Playlist/Files?PlaylistType=ID&Action=Play&Playlist=-1002

7/30/2015 12:14:07 PM 589 Action RESULT:
7/30/2015 12:14:07 PM 590 guessed text:set ?? (JRiver basic UI)
7/30/2015 12:14:09 PM 819 guessed text:Show me ?? (Show Help)
7/30/2015 12:14:10 PM 68 guessed text:Turn relay ?? (ArduinoRelays)
7/30/2015 12:14:10 PM 568 guessed text:Turn relay 2 ?? (ArduinoRelays)
7/30/2015 12:14:11 PM 316 guessed text:Turn relay 2 off ?? (ArduinoRelays)
7/30/2015 12:14:12 PM 568 Rulename: root # Semantics: 2
7/30/2015 12:14:12 PM 568 Group: ArduinoRelays Speech: Turn relay 2 off
7/30/2015 12:14:12 PM 569 semanticID: 305
7/30/2015 12:14:12 PM 569 command ID: 305
7/30/2015 12:14:12 PM 569 semanticID: 305
7/30/2015 12:14:12 PM 569 kvp: command | 305
7/30/2015 12:14:12 PM 569 kvp: p305d1 | 2
7/30/2015 12:14:12 PM 570 semanticID: 305
7/30/2015 12:14:12 PM 570 kvp: command | 305
7/30/2015 12:14:12 PM 570 kvp: p305d1 | 2
7/30/2015 12:14:12 PM 570 alternate:Turn relay 2 off
7/30/2015 12:14:12 PM 637 doCommand:Turn Relay {1} off
7/30/2015 12:14:12 PM 637 action repeat set to: 1
7/30/2015 12:14:12 PM 637 Action:  PY.ExecString - arduinoWrite("20")
7/30/2015 12:14:12 PM 637 [action] PY.ExecString:arduinoWrite("20")

7/30/2015 12:14:12 PM 643 [plugin] Python Error:Line: 10 >>
SystemError: The port is closed.

7/30/2015 12:14:12 PM 643 [plugin] System.InvalidOperationException: The port is closed.
   at System.IO.Ports.SerialPort.Write(String text)
   at Microsoft.Scripting.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at Microsoft.Scripting.Interpreter.DynamicInstruction`4.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.Runtime.FunctionCaller`1.Call1(CallSite site, CodeContext context, Object func, T0 arg0)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at Microsoft.Scripting.Interpreter.DynamicInstruction`4.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)
7/30/2015 12:14:12 PM 643 Action ERROR: Line: 10 >>
SystemError: The port is closed.

7/30/2015 12:14:14 PM 812 guessed text:Play disc Has ?? (JRiver play album)
7/30/2015 12:14:16 PM 312 [vcevent] VC.NotRecognized

7/30/2015 12:14:20 PM 52 guessed text:Load playlist ?? (JRiver load playlist)
7/30/2015 12:14:21 PM 800 [vcevent] VC.NotRecognized

7/30/2015 12:14:22 PM 360 guessed text:ignore ?? (Vox Commands)
7/30/2015 12:14:22 PM 549 guessed text:ignore me ?? (Vox Commands)
7/30/2015 12:14:22 PM 923 Rulename: root # Semantics: 1
7/30/2015 12:14:22 PM 923 Group: Vox Commands Speech: ignore me
7/30/2015 12:14:22 PM 924 semanticID: 8
7/30/2015 12:14:22 PM 924 command ID: 8
7/30/2015 12:14:22 PM 924 semanticID: 8
7/30/2015 12:14:22 PM 924 kvp: command | 8
7/30/2015 12:14:22 PM 925 semanticID: 8
7/30/2015 12:14:22 PM 925 kvp: command | 8
7/30/2015 12:14:22 PM 925 alternate:ignore me
7/30/2015 12:14:22 PM 989 doCommand:Don't Listen
7/30/2015 12:14:22 PM 989 action repeat set to: 1
7/30/2015 12:14:22 PM 989 Action:  VC.Standby -
7/30/2015 12:14:22 PM 989 [action] VC.Standby:

7/30/2015 12:14:23 PM 0 [vcevent] VC.Standby

7/30/2015 12:14:23 PM 7 Action INFO:
7/30/2015 12:14:24 PM 733 guessed text:vox off ?? (Vox Commands)
7/30/2015 12:14:25 PM 61 SR Engine stopped
7/30/2015 12:14:25 PM 62 [vcevent] VC.Off

7/30/2015 12:14:25 PM 66 Rulename: root # Semantics: 1
7/30/2015 12:14:25 PM 66 Group: Vox Commands Speech: vox off
7/30/2015 12:14:25 PM 67 semanticID: 43
7/30/2015 12:14:25 PM 67 command ID: 43
7/30/2015 12:14:25 PM 67 semanticID: 43
7/30/2015 12:14:25 PM 67 kvp: command | 43
7/30/2015 12:14:25 PM 68 semanticID: 43
7/30/2015 12:14:25 PM 68 kvp: command | 43
7/30/2015 12:14:25 PM 68 alternate:vox off
7/30/2015 12:14:25 PM 73 A prefix is required to execute this command.
7/30/2015 12:14:25 PM 129 [vcevent] VC.Reco.Ignored

7/30/2015 12:14:25 PM 135 [info] Ignoring command: Standby mode

any ideas.

thanks
chilliman

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: arduino issues
« Reply #1 on: July 30, 2015, 01:46:52 PM »
It is difficult to be sure because you have only posted a portion of your log.  Nowhere in your log file does it show the python code running which opens the port.


My guess is that your problem is caused by one of the following:

1 - You have never executed the python code which opens the port.
Note: the xml that I provide on the wiki for this Arduino sample should automatically execute the python code for you when you start VoxCommando.  Maybe you did not restart VoxCommando, or maybe you did not save the python file in the correct location.

2 - Perhaps you did not adjust the com port to the correct one for your Arduino before saving the python code.  Keep in mind also that if you unplug your Arduino and plug it back into a different USB port the com port will often change.

3 - VoxCommando is unable to open the port because it is already open in some other program such as the serial monitor in the Arduino IDE

I suppose there could be other reasons but these are the most likely ones I can think of.

chilliman

  • Jr. Member
  • **
  • Posts: 30
  • Karma: 1
    • View Profile
Re: arduino issues
« Reply #2 on: July 30, 2015, 06:04:12 PM »
Hi James.
i have checked most things please see attachments .

hope you can fined out what i have done wrong

thanks
chilliman

chilliman

  • Jr. Member
  • **
  • Posts: 30
  • Karma: 1
    • View Profile
Re: arduino issues
« Reply #3 on: July 30, 2015, 06:34:41 PM »
and the arduino file

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: arduino issues
« Reply #4 on: July 30, 2015, 07:12:18 PM »
Your problem is here:
Code: [Select]
7/30/2015 4:51:09 PM 73 [plugin] System.UnauthorizedAccessException: Access to the port 'COM12' is denied.
   at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
  ...
  ...
   at vcPlugin.iPy.execString(String strCode)
7/30/2015 4:51:09 PM 74 Action ERROR: Line: 7 >> serialPort.Open()
SystemError: Access to the port 'COM12' is denied.

Please see my post above, item #2.

Either your are using the wrong com port, or the port is already open for some reason.

Are you sure that your Arduino is connected to your computer using COM port 12?

Are you sure that you don't have another program connected to the Arduino?
To be sure the port is not already open, make sure that no other programs are running.

chilliman

  • Jr. Member
  • **
  • Posts: 30
  • Karma: 1
    • View Profile
Re: arduino issues
« Reply #5 on: July 30, 2015, 08:49:22 PM »
Hi James.
i was using Com 12 i now having it working correctly the problem was me, the Led's on my Arduino shield there on when i through they should be off changed the arduino sketch to swap the outputs rebooted my a couple of time now working with not errors.
sorry i had to get you involved with such a simple thing i think i need to check things more before coming to the forum.
thanks for your help on this one

still on that learning curve 

chilliman   

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: arduino issues
« Reply #6 on: July 30, 2015, 09:26:31 PM »
It's OK. Learning is part of the fun. :)

chilliman

  • Jr. Member
  • **
  • Posts: 30
  • Karma: 1
    • View Profile
Re: arduino issues
« Reply #7 on: July 30, 2015, 09:44:35 PM »
just one other thing is there a list of the Arduino commands used in Python i.e. arduinoWrite("{1}1")

thanks again
chilliman

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2318
  • Karma: 47
    • View Profile
Re: arduino issues
« Reply #8 on: July 31, 2015, 05:56:41 AM »
Hi chilliman,
there is only one python action for arduino available, because it is the only one which is defined as a function in the python script (writing data to the serial port). Other actions for Arduino are not needed (James, please correct me if I'm wrong  ;) )
***********  get excited and make things  **********

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: arduino issues
« Reply #9 on: July 31, 2015, 02:56:11 PM »
not totally on topic... but how about creating a forum for arduino VC dev. in the support section ...

like this we all can find stuff easily
When Voice command gets tough, use hand gestures

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Re: arduino issues
« Reply #10 on: July 31, 2015, 03:19:20 PM »
Kalle, you're right.  ;) The only thing the python script does, is sending the payloads of arduinoWrite() to the serial port of the arduino. If you want to do other stuff with your arduino, you have to change sketch. There are no other python functions needed.

I like the idea to have a special arduino(+MySensors) forum!

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: arduino issues
« Reply #11 on: July 31, 2015, 04:09:15 PM »
The boss has approved your request.  :biglaugh
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: arduino issues
« Reply #12 on: August 01, 2015, 06:46:59 PM »
The boss has approved your request.  :biglaugh

Gooooood boss indeed !!!!
When Voice command gets tough, use hand gestures