Autoremote: Direct Messages and Notifications Via URL......using LAN?

728 views
Skip to first unread message

piz...@gmail.com

unread,
May 3, 2014, 6:06:17 AM5/3/14
to joao...@googlegroups.com
I really love Autoremote's simple Direct Message via URL function (outlined here: http://joaoapps.com/autoremote/direct/) but is there a way to send a Direct Message to Autoremote LOCALLY, using the device's local ip? (Not going through http://autoremotejoaomgcd.appspot.com at all?)

I know this is possible using the EventGhost plugin, and I even looked around in the source of that but I can't quite figure it out...even if it's not possible through a simple URL...can it be done with HTTP POST or something like that?

Thanks!

João Dias

unread,
May 4, 2014, 10:30:59 AM5/4/14
to joao...@googlegroups.com
yes, it can be done with HTTP post. :)

It's not as direct as the direct URL though. To see what you need to post, install the chrome extension, go to Settings->Extensions->AutoRemote->autoremote.html and check the console. Then send a message to chrome and look at the json text that shows up corresponding to the message. That's the text that needs to be POSTed to the android local ip :)

Let me know if you need more help.



--
You received this message because you are subscribed to the Google Groups "joaomgcd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joaomgcd+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

piz...@gmail.com

unread,
May 5, 2014, 5:05:18 AM5/5/14
to joao...@googlegroups.com
Awesome!

I took a look at the console, saw the JSON that shows up in the console (URLEncoded) and tried just copy and pasting that and POSTing it to my Android's local ip (using cURL on Windows)....and I haven't had any success yet...so, a few questions:

1) The local ip is just the IP of the Android device, right? Any specific port?

2) in the Chrome console the format seems to be:

key=[MY KEY HERE]&sender=[NAME OF SENDER]&
request=[WHOLE BUNCH OF JSON]

so I have to send that entire thing or JUST the JSON that appears at the end?


Thanks you SO MUCH for your help! You make some GREAT apps I couldn't live without them!

João Dias

unread,
May 5, 2014, 5:14:40 AM5/5/14
to joao...@googlegroups.com
Hi again! :) Sorry for the incomplete response before.

1) It's the local IP with port 1817. No path required.
2) Just the json and set content type to application/json

BTW I'm planning on making this API public in the future so anyone can build their own AutoRemote clients in the future on any platform :)

Thanks again!
João

piz...@gmail.com

unread,
May 9, 2014, 4:35:16 AM5/9/14
to joao...@googlegroups.com
Awesome!

This is exciting!

Okay I'm giving it a shot and not getting anywhere (this may be because I', VERY new at using CURL)

i'm using this on the commandline:

curl -X POST -d @json.txt http://[LOCAL IP]:1817 --header "Content-Type:application/json"

(Where [LOCAL IP] is the local LAN ip of my android device)

(and json.txt is just the json, URLDecoded, copied from the Chrome console)

and i keep getting "curl: (56) Recv failure: COnnection was rest"

Did I leave out a step?

Thanks again!

João Dias

unread,
May 9, 2014, 4:52:06 AM5/9/14
to joao...@googlegroups.com
Did you enable the wifi service on your device?


Reply all
Reply to author
Forward
0 new messages