Author Topic: TCP Plugin  (Read 33864 times)

0 Members and 1 Guest are viewing this topic.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TCP Plugin
« Reply #15 on: September 13, 2013, 05:19:59 PM »
Cheers. We look forward to hearing how you fare. If we can help in the interim, let us know.

- N.
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)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TCP Plugin
« Reply #16 on: September 13, 2013, 09:17:00 PM »
In case it helps, <cr><lf> would be represented as \x0d\x0a with the TCP plugin

So you could try the TCP.Single.Write action with the message

#DEVICE,4,1,3\x0d\x0a

For "press button 1"

If you want to perform queries, you'll need to use the client actions, not single.


Crunchie

  • $upporter
  • Jr. Member
  • *****
  • Posts: 33
  • Karma: 0
    • View Profile
Re: TCP Plugin
« Reply #17 on: September 14, 2013, 12:09:27 PM »
Thank you sir...

what thing on my mind before even hooking up to try this is the fact that it (the system processor) will be looking from credentials (username and password) prior to even being in a state to accept my text strings. Would I set up the strings to automatically send username first and password second prior to any voice driven text commands?

On a side note; what would be the best reading/code to learn for me to understand the whole concept/framework of this great piece of software? The possibilities of this application in my mind are endless but I would love for it to not be such a struggle for me to understand.. I have been reading the wikis and watching the videos and see that it is very powerful if one fully understands the mechanics of it.

L.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TCP Plugin
« Reply #18 on: September 14, 2013, 01:14:13 PM »
On a side note; what would be the best reading/code to learn for me to understand the whole concept/framework of this great piece of software? The possibilities of this application in my mind are endless but I would love for it to not be such a struggle for me to understand.. I have been reading the wikis and watching the videos and see that it is very powerful if one fully understands the mechanics of it.

Hopefully others can pipe in here too. If you've already watched some demos and the consulted the wiki, I strongly recommend the video tutorial "VoxCommando Tutorial 1A Editing and Building Commands" (
).

You could follow-up with the video, "VoxCommando Tutorial 1B more about payloads and the command editor," but I would actually suggest not watching that video until you've really explored VoxCommando yourself, opening up existing commands to try to dissect how they are structured, modifying commands yourself, etc.

This program has *so many* different features and possibilities (in part because it is designed to collaborate with a broad range of 3rd party software and devices). For most new users the best approach is probably "learning by doing," using the wiki documentation, forum, and videos to help resolve questions as you go along.
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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TCP Plugin
« Reply #19 on: September 14, 2013, 01:30:20 PM »
In general, I recommend for new users the following wiki starting points (especially for fairly fluent English readers and those who can handle text longer than a tweet).

Customizing Commands (in terms of understanding the fundamental command concept, which is the backbone of the program) http://voxcommando.com/mediawiki/index.php?title=Customizing_Commands

And for those who are still setting up their system, figuring out microphone issues and language settings etc.:
Getting Started http://voxcommando.com/mediawiki/index.php?title=How_to_use_VoxCommando
FAQ http://voxcommando.com/mediawiki/index.php?title=FAQ
« Last Edit: September 24, 2013, 10:37:52 AM by nime5ter »
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)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TCP Plugin
« Reply #20 on: September 14, 2013, 02:38:15 PM »
Thank you sir...

what thing on my mind before even hooking up to try this is the fact that it (the system processor) will be looking from credentials (username and password) prior to even being in a state to accept my text strings. Would I set up the strings to automatically send username first and password second prior to any voice driven text commands?

I'm away from a real computer until Tuesday so I can't experiment, and in any case I don't have access to a lutron, but if you are correct, and this login procedure is required, then it may be possible using the TCP client approach, where you create a client, connect, and then send credentials.  After that the client should be able to hold the connection, so you won't need to log in again, unless the connection is cut for some reason.  It might be necessary to use VC.pause to wait between connecting, sending the username and sending the password.  It will probably require some trial and error.  After Tuesday I can collaborate with you on this.
« Last Edit: September 14, 2013, 02:55:03 PM by nime5ter »

Crunchie

  • $upporter
  • Jr. Member
  • *****
  • Posts: 33
  • Karma: 0
    • View Profile
Re: TCP Plugin
« Reply #21 on: September 14, 2013, 02:56:12 PM »
hi again,.


thank you for you valuable input. I will be installing a few switches, dimmers and a keypad today and attempting to communicate to the processor later tonight/tommorrow. I will test the telnet hook up first doing telnet directly to the unit and ensure that i have connection success that way prior to banging my head over VC telenetting so I know that i will not be hacking in vain  :biglaugh :bonk


Will track my success and failures and report accordingly.

L.

Crunchie

  • $upporter
  • Jr. Member
  • *****
  • Posts: 33
  • Karma: 0
    • View Profile
Re: TCP Plugin
« Reply #22 on: September 15, 2013, 08:21:47 PM »
Hello,

I managed to install a small portion of devices, programmed them and got my processor on my network with a static IP address. I have installed the manufacurer's Android application and proved integration and control over the network of the lightng system with their application. I have also installed hyperterminal and telneted commands to the processor and proved that his method works. The processor will not allow concurrent connections by the same user, but allows different users to connect concurrently. I have therefore made separate log in IDs for the Hyper-terminal login and the log in that I am attempting with VOX.

In VOX, I created a custom group for two commands. I have entered a command called "connect" and a command called "living room lights". I have not tried to do anything fancy at this point with voice control of either of these commands and have so far only tried manually executing them. In the connect command, I have entered an action to connect, an action to pause for 2 seconds, an action to send a single line of text for the username, another action to pause for 2 seconds and finally a second write line action to send password.

Under the living room lights command I have entered only one action and that is to send a single line that is a device button press string that i have proved works in hyperterminal.


I have tried many incarnations of the actions such as TCP.Client.Write.Ln, TCP.Client.Write, ,TCP.single.Write, TCP.Single.Write.Ln etc and have alos tried using carriage returns as <CR> and as \x0d and line feeds as both <LF> and \x0a. I have used them together, alone and without them at all.

Here is a link to some screenshots that show my commands tree, the commands actions setup, the history log showing what happens as i manually send the connect and living room commands to the processor. I have also showed the hyperterminal screen showing the construct of my #device command works and shows feed back from the processor that shows two button presses and associated return of device and LED states (the button that i am pressing is programmed with toggle logic in it's native software so one press is lights off, a subsequent press is lights on). THis proves that i have interfaced successfully with the same command that i am trying in VOX.

I cannot get the commands to work in VOX however and I am uncertain if i am even getting past the login in the processor based on my actions under the connect command.

Here is the link to the screenshots mentioned above.

https://www.dropbox.com/sh/xmcz41n99j99d4h/mgB1PY9VKW

do let me know what your thoughts are when you get a chance.

Sincerely,

L.



jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TCP Plugin
« Reply #23 on: September 15, 2013, 09:24:39 PM »
I think you should try using TCP.client.write and terminate each with \x0d\x0a for every action including the username and password.  If you are not sure what delay to use, err on the side of a longer pause until you get it working and then try making it shorter.
« Last Edit: September 15, 2013, 09:28:33 PM by nime5ter »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TCP Plugin
« Reply #24 on: September 15, 2013, 09:30:38 PM »
Also you need to use client write for everything.  Don't bother with single, because you need to use the client that you previously logged in with.
« Last Edit: September 15, 2013, 09:55:43 PM by nime5ter »

Crunchie

  • $upporter
  • Jr. Member
  • *****
  • Posts: 33
  • Karma: 0
    • View Profile
Re: TCP Plugin
« Reply #25 on: September 16, 2013, 08:16:32 AM »
Hi Jitterjames,


I have got it  ;D. Following your advice it seems that the missing key to getting my server connection authorized was to enter the carriage return and line feed into the terminator box in the TCP.Client.Connect command per the attached screen shot:

https://www.dropbox.com/s/e8n0n17h022mtix/Telnet%20session%20successful%20connect%20settings.jpg

This then verifies that i can ouput commands to the Lutron Radio Ra2 Main Repeater using the commands published in their integration protocol. The next question is can VOX monitor the feed back from the system and what would i do with same?

thanks for you help!



« Last Edit: September 16, 2013, 08:21:22 AM by lootrondealer »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TCP Plugin
« Reply #26 on: September 16, 2013, 10:08:00 AM »
Exciting. Is your living room light command working as well?
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)

Crunchie

  • $upporter
  • Jr. Member
  • *****
  • Posts: 33
  • Karma: 0
    • View Profile
Re: TCP Plugin
« Reply #27 on: September 16, 2013, 10:23:41 AM »
It is absolutely! When i get home tonight I will write some voice commands to test. I don't think i will be able to add payloads such as 1-10 for brightness or even 0,2.5,5,7.5,10 as i don't see these types of integration commands in the published integration guide; however there are programmable "phantom" buttons in the processor that can be programmed to affect single lights or groups (scenes) of lights that I can program for everything that I am looking to do. IE I could write logic on the processor side that associates a button press to "all lights in living room to 50%" and another for 25% and another for 75% etc. It could also be a single button press for "table lamps to 10%, Ceiling fan off, ceiling light off, wall sconce 50%" and the command could be "TV Lighting Scene" in VOX to activate the text string that pushes the button that does same.


Looking forward to more testing!

L

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TCP Plugin
« Reply #28 on: September 16, 2013, 11:37:43 AM »
It should be fun to see how you progress. I'm sure once James is back he'll have some thoughts on different ways to creatively/usefully interact with your system, though it sounds like you're making steady progress on your own.

Can I ask, is this the documentation you're using: http://www.lutron.com/TechnicalDocumentLibrary/040249.pdf?

And if so, can you tell us some of the specific devices you're controlling in your set-up? Is it primarily lights, or also blinds? I can imagine that setting up scenes to customize all the relevant lights and venetian blinds for night-time TV viewing, morning and afternoon viewing could be pretty sweet, for example.
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)

Crunchie

  • $upporter
  • Jr. Member
  • *****
  • Posts: 33
  • Karma: 0
    • View Profile
Re: TCP Plugin
« Reply #29 on: September 16, 2013, 11:47:52 AM »
Yes that is the correct document and yes blinds are available in scenes. With the right setup and equipment you could even start the hot air popcorn maker to turn on as you set the stage for a movie