Asked — Edited
Resolved Resolved by DJ Sures!

Execute Scripts Or Commands With Http Get Commands

I think this is possible and has been discussed, but I can not find it. Is there a format to execute scripts or commands using an application that can send HTTP GET or POST commands but not be using a web browser, either with the HTTP Server or HTTP Server (custom).

I don't think I can do it with the HTTP Custom because it uses AJAX and I don't know how I would format a request (and unfortunately, the documentation is fairly minimal) but I thought someone was already doing this with the simple HTTP server, embedding the user name and hte request in the URL of the GET.

I also know I can do this with Telnet using the TCP Clients object, and I may use that for my solution, but it is a little more limiting.

I'll explain my goal in case it provides any other thought.

I want to be able to drive my robot from my Android phone or an Android Wear smartwatch. I don't want to use the mobile interface, I want to have an embedded computer running ARC performing a number of tasks, the remote interface just to give additional commands.

I have two applications that can easily send HTTP Get or Post requests and allow me to build custom interfaces. Anymote smart remote, and Tasker. With a Tasker plugin I can also send Telnet requests, and I may wind up going in that direction if I am wrong that this can't be done with one of the web servers, but that isn't really the direction I wanted to go. (I think I could also do it using Eventghost to receive the HTTP requests and then send telnet requests to ARC, and I am sure I could write a plugin or do something with the SDK once my C# skills are up to speed, but I could swear this is existing functionality and I just can't find the right nomenclature for the command).

Alan


ARC Pro

Upgrade to ARC Pro

Experience the transformation – subscribe to Synthiam ARC Pro and watch your robot evolve into a marvel of innovation and intelligence.

PRO
Synthiam
#1  

Create a plugin. It will only be a few lines of code.

Or

Use the telnet server.

The telnet server makes the most sense. Sinply send the command with a terminated \r\n

The plugin would end up reproducing the telnet server. If you're idea is to have the watch control the robot, I could consider what it takes to add the telnet server to the mobile app.

#2  

Thanks DJ.

I must have been mis-remembering that this could be done via HTTP.

I explicitly don't want this in the mobile app (although others might). It is for providing remote control of a robot that will have an embedded Windows computer.

Short term, I can use the Tasker plugin to create buttons for the Telnet commands, and I will add this to my list of things I want to do with the plugin when I finally have time to learn a little C#. In fact, it fits perfectly with my plans to make an IFTTT plugin, so I might be able to kill two birds with one stone.

Alan

PRO
Synthiam
#3  

Is Tasker the name of the plugin you want to create?

Is the idea to not send ezscript commands and send other commands instead? Is this because ezscript commands are too lengthy? Ie forward() or stop()? Would your commands be shorter in length or something?

I'd like to get a better understanding of the initiative to use a plugin instead of the telnet server.

#4  

Tasker is an Android app that can do many many things based on many many triggers. It also has a plugin architecture. One of its plugins is a Telnet client, where I can set up specific sequences of tenet commands (a built in function is Get URL, which is where I was starting).

You can use Tasker to create simple Android apps that execute these tasks, or trigger them from any number of other events that Android can see.

There is also an Android Wear Smartwatch plugin for Tasker that can make simple UI's.

So what I am going to build with this, is a simple UI similar to what you did for the Apple Watch that sends forward, reverse, left, right, and stop commands (and maybe some others) to my robot from my new LG Urbane smartwatch (that was just delivered 30 minutes ago).

I probably don't need to make a plugin for this capability except for the fact that Tasker and the two Tasker plugins needed to make this work are all paid apps, and on the more expensive side for Android, and takes a bit of configuration to set up, so if others want to do the same, it will be more complex than if I can write a plugin and an Android Wear app.

I have also been thinking of how to best do an IFTTT plugin. It is easy using the IFTTT Maker channel to have a robot send events, but more difficult to make it respond. If I ARC could take actions based on GET requests without opening a web page, then the Maker channel could be used for both directions of communication, so building a integration web service plugin would be a nice challenge for me.

Alan

Alan

PRO
Synthiam
#5  

Ah i see.

The ifft I have looked into. I was so frustrated with their terrible api that I wasn't able to continue developing.

If you were to make one, the plugin would only be difficult because their api is so terrible. Thinking about reading their api pages again gives me the shakes!

#6  

That is why I wanted to take advantage of the existing Maker channel. As long as I can make the web page "internet visible" which is not difficult in my environment since I have my own domain and Dynamic DNS service, the Maker channel can do a GET or POST request. So all I would be to create a web interface that can pass credentials and script commands from a single GET or POST.

Would not be easy for all ARC users, but with good documentation I think it could be useful.

It can also be done with EventGhost hosting the web commands and sending to ARC with the telnet interface, but that adds another layer that can break, and more to configure.

Alan

#7  

I use IFTTT a lot to trigger some actions in and by ARC, but I have to follow complex paths for that. I use recipes with Dropbox: I make ARC write files/take pictures in Dropbox to trigger external actions by IFTTT and the other way I make Dropbox write .txt files and ARC read them in scripts.

I would love to see an IFTTT plugin (no pressure Alan ;)) and it's a shame their api is so terrible. (It is also a shame I am not capable of writing a plugin, but that's another story :D)

Fred

#8  

At this point, I think you are as capable of writing a plugin as I am. I need to learn C#. I am a fairly accomplished VB6 developer, but VB6 is so old it can't even be installed on anything newer than WindowsXP, and the new languages are completely different, so I am pretty much starting from scratch.

Alan