I'm trying to work out how to issue commands to vc from irule. I've read the wiki and searched the article but can't quite work it out..
from my understanding I should setup a network gateway in Irule with the IP address of my voxcommando machine and port 3300 and then simply have buttons to send the commands I want to voxcommando and these will execute.
however the network gateway in irule never seems to connect.
I'd love any advice on how to do this as I've just found voxcommando after building a whole house automation system based around Irule, and Global Cache Itache's and plan to move my entire irule system to run through vox commando combined with multiple conference call devices in each room.
I've managed to get Voxcommando working with all my gear and voice commands nicely, however I'm stuck at getting irule to issue commands to vc..
You should create a UDP gateway and the port should be 33000, unless you have changed the listen port in VoxCommando settings.
I don't know if you only made a typo when posting but you are missing a 0
Maybe this will help...
Please ignore the name of the gateway, which is misleading!
thanks for your help, I was setting the IP address of the gateway as the ip of my vc machine. Your screen shot solved my problem :)
I'm now having trouble setting this up to work from outside my network.
I can obviously setup a port forwarding rule on my router to forward external port 33000 to any address, and setup irule to connect to my external IP, but what IP address do I forward the port to?
The ip address of the computer running VoxCommando.
Eg: 192.168.1.103
I'm not 100% sure but I don't think you can use this method with UDP. You would probably need to switch to sending commands using HTTP or TCP.
so I got this all working however can't seem to get it working through my dynamic dns service... it only works when I actually specifiy my external ip address in irule for the gateway.
I'm guessing this must mean something about udp not working through my ddns service.
how should i configure irule http gateway and commands to issue http request to voxcommando?
I've tried creating at http gateway with address myadress.no-ip.net and port 26408 and configure commands in irule as "vc.tellvox&&turn%on%television" however this ins't working..
any suggestions?
Yes. I think I already mentioned that UDP probably won't work across a WAN interface.
Have you already read this?
http://voxcommando.com/mediawiki/index.php?title=API_Application_Programming_Interface#HTTP
Well I guess not, based on the syntax you are using. Check it out and then let us know if you still have a specific issue.
Quote from: JoshK on September 07, 2014, 11:56:16 AM
so I got this all working however can't seem to get it working through my dynamic dns service... it only works when I actually specifiy my external ip address in irule for the gateway.
Is it possible that iRule only works with an ip address and not a domain name?
I thought that may be the case. but I've got irule communicating directly with an itach through dns address.
I can't seem to get communication via http working even using my vox's internal network IP address..
http gateway in irule set to local vox ip address, port 26408, set to POST.
buttons in irule send "/api/tellvox&&blah"
am i doing something there?
I'm convinced once i've got irule send http requests to vox that this will work with the dynamic dns.
Did you enable the tcp plugin and then enable the simple web server and set the port to 26408?
It should not be set to post, use get.
The first step would normally to get it working on the LAN and then try to get it working when away from home.
yep tcp plugin working, simple webserver enabled on port 26408.
am successfully sending http requests to vox by typing them into the address bar in a browser, just not from irule, whether it be on my local lan, or outside it.
commands in irule definitely just need to be formated as "/api/vc.tellvox&&blah" there isn't anythign else needed?
I can't work out why it wouldn't be working..
One reason would be that you have set iRule to POST.
Does VC show anything in the history window when you try to send commands?
You should not put the slash before api, because irule is already adding that.
You might also need to manually url encode things like spaces if iRule is not doing it for you.
I got it to work, but there seems to be some kind of problem with iRule sending the same message over and over again. I think it is because it doesn't like the response it gets back, or it is not terminating the communication correctly.
I'm going to play around with the TCP plugin it a bit to see if I can make it better. I might also try to make it handle POST as well as GET.
have got it working now that I dropped the / before api :)
although I only seem to be able to send short messages, with no spaces i.e "api/vc.tellvox&&heat" works but "api/vc.tellvox&&turn on heating" doesn't...
i'm not sure how i should be formatting them in irule.
any chance you could try getting a command like "api/vc.tellvox&&turn on lounge heating" working and show me what syntax you use?
noticed that it sends the request 3 times as well. This also seems to happen if you use safari on ios to access the url (i use this to send visitors links for opening visitor parking doors etc). would be great if this could be solved.
thanks for your help - the same question on the irule forum has been sitting idle for 4 days now ::)
I did mention this:
Quote from: jitterjames on September 09, 2014, 01:31:35 PM
You might also need to manually url encode things like spaces if iRule is not doing it for you.
try to google search for: url encode spaces
you will find the solution in 2 seconds.
As for the repeats, I'm working on it. Should have a new version of the TCP plugin out soon, with a better simple-web-server.
thankyou! finally all working nicely now through dns.
am using an if statement at the begining of my commands followed by seteventtimer statement at the end of the commands to act as a timer to only allow them to run once every 3 seconds. it's a temporary work around for the mulitple requests issue until it's updated.
Thanks again!
thanks for the update to the tcp client. issue of multiple actions\events is fixed :)