Getting iRule to communicate with Indigo via 2413U

Posted on
Sun Jan 29, 2012 2:35 am
.Capstone offline
Posts: 36
Joined: Sep 21, 2011

Getting iRule to communicate with Indigo via 2413U

For anyone who has experience with integrating iRule and Indigo:

I am having a problem trying to get things to work from iRule on my iPad/iPhone to my Indigo on my MacMini via 2413U. Everything is working fine in terms of opening up Indigo on the MacMini, inputting the device (a switchlinc dimmer in my case) and then clicking the turn off or turn on buttons on the computer screen; everything works like a charm. I just can't seem to make iRule communicate with Indigo. I've read the through some of the posts on this forum and the RESTful Overview, but haven't been able to find success. I have no programming experience at all, so I'm sure I'm just missing something.

Here's a brief summary of what so far has not worked for me - I created a new device in the iRule builder, named it Indigo, and then added a new network code. So here's where things get a little confusing for me. I've tried entering all of the following (in separate groups) into the data field with no luck -
/devices/chandelier?toggle=1&_method=put
devices/chandelier?toggle=1&_method=put
127.0.0.1:8176/devices/chandelier?toggle=1&_method=put
http://127.0.0.1:8176/devices/chande...=1&_method=put
192.168.1.66:8176/devices/chandelier?toggle=1&_method=put
http://192.168.1.66:8176/devices/cha...=1&_method=put
The '127.0.0.1' is the number of the DNS Server on my Mac according to system preferences and '8176' is the port many on these forums reference. The '192.168.1.66' is the IP address according to system pref on the Mac, which is connected to an Airport Express using DHCP (I still don't understand the whole static IP thing). The connection is via ethernet, not WiFi.

Next (more of the iRule part), I set up a new HTTP gateway in the iRule app on my iPhone. I set HTTP method to GET and left the Wake-on-LAN to off. I added the new device (Indigo), which I had created in the iRule builder. I've tried using all of the addresses for the gateway as of now with no luck -
127.0.0.1:8176/
127.0.0.1:8176
127.0.0.1
192.168.1.66
192.168.1.66:8176
192.168.1.66:8176/

As you can see, I'm at the point now where I'm just grasping for anything. I don't know if I'm getting some things right or nothing at all. I think I'm pretty close, but can't get there with just the RESTful Overview. I think the overview requires a basic understanding I just don't have.

I would appreciate any help on where I'm off here.

Thank you.

Posted on
Sun Jan 29, 2012 10:07 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Getting iRule to communicate with Indigo via 2413U

127.0.0.1 is the loopback address - so if you're on the IndigoServer Mac when doing the URLs it will work. The other address is the IP address on your local network.

Open Safari on your IndigoServer Mac and try this:

http://127.0.0.1:8176/devices/chandelie ... method=put

That will tell you if IWS is running correctly. If that doesn't work, make sure that you have "Enable iPhone, iPod touch, and remote Web browser access" enabled on the start local server dialog and that you haven't changed the Web server port. If you have authentication enabled it should prompt you for username/password when you hit the URL above.

Assuming that works, replace the loopback with your IP:

http://192.168.1.66:8176/devices/chande ... method=put

That should work. Now, that means that you've got IWS responding to the RESTful APIs. Unfortunately, the rest I can't help with. Check with the iRule guys (I know at least one of them uses Indigo).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Jan 29, 2012 1:12 pm
.Capstone offline
Posts: 36
Joined: Sep 21, 2011

Re: Getting iRule to communicate with Indigo via 2413U

Jay,

Thanks so much for getting back to me, especially on a Sunday!

I tried what you said and it worked...for the most part. I opened Safari on the Mac running Indigo Server and typed in:
'http://127.0.0.1:8176/devices/chandelier?toggle=1&_method=put'
Everything worked perfectly.

Next I switched out the loopback address for the IP address on my local network. In other words, I typed in:
'http://192.168.1.66:8176/devices/chandelier?toggle=1&_method=put'
This brought me to the same sort of webpage, but the lights did not respond. When I tried typing this into Safari on my laptop (not running Indigo), it worked perfectly!! Same story with Safari on the iPhone. Typing in:
'http://192.168.1.66:8176/devices/chandelier?toggle=1&_method=put'
on any device besides the MacMini running Indigo works like a charm. I'm wondering why the 192.168.1.66 works on everything except the computer running Indigo. Could this be the problem?

And yes, I think I know the individual you're talking about who interfaces iRule with Indigo; he's the one who turned me on to Indigo in the first place. I've sent him a message on one of the threads within AVSforum dedicated to iRule. He should be able to help with the iRule end of things, as I know you guys wouldn't know that part.

Thanks so much for the help so far! Although I'm very early on in my process, this software seems amazing! The possibilities are going to be endless; I've just got to get over this minor hurdle. I know I'm close.

Thanks.

Posted on
Sun Jan 29, 2012 1:52 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Getting iRule to communicate with Indigo via 2413U

.Capstone wrote:
This brought me to the same sort of webpage, but the lights did not respond. When I tried typing this into Safari on my laptop (not running Indigo), it worked perfectly!! Same story with Safari on the iPhone. Typing in:
'http://192.168.1.66:8176/devices/chandelier?toggle=1&_method=put'
on any device besides the MacMini running Indigo works like a charm. I'm wondering why the 192.168.1.66 works on everything except the computer running Indigo. Could this be the problem?


Odd - how many times did you try it? I wonder if it just failed that once because of signal noise or something. If it worked from other devices it should work from Safari on the same Mac.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Jan 29, 2012 2:22 pm
.Capstone offline
Posts: 36
Joined: Sep 21, 2011

Re: Getting iRule to communicate with Indigo via 2413U

Ok..so the IP address over the local network works on the MacMini running Indigo server now. I had swapped an "a" for the "&" in the syntax. Sorry about that. I'm hoping there's a similar explanation (me doing something stupid) on the iRule end as well that's keeping the two from meshing. I'll hope to hear back on that end soon.

Another quick question - I've now set up the Indigo Server to require authentication; this seemed like a good idea. When I now type in the url into Safari, I'm prompted for my username and password. This is fine, but will it change the way I have to enter the code coming form iRule (maybe you don't know the answer, since its partially an iRule question)? I just thought it was a good idea to be requiring the authentication. Was I at risk while the authentication wasn't enabled? I had my IP address on this forum. Could someone have hacked in? I know its a paranoid question, I was just wondering.

Thanks.

Posted on
Sun Jan 29, 2012 5:37 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Getting iRule to communicate with Indigo via 2413U

The IP address you posted on the forum here was for your local net - it wasn't the IP address anyone from out on the internet could use to get in so you're safe.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jan 30, 2012 1:48 pm
.Capstone offline
Posts: 36
Joined: Sep 21, 2011

Re: Getting iRule to communicate with Indigo via 2413U

Thanks for all your great help, Jay!

I thought I'd post back with an update: I was finally successful in getting iRule to communicate with Indigo on my Mac, thanks to the help of an Indigo user, who like me, uses iRule and participates on the iRule forum. For the reference of others I'll post what I did learn from my experience.

First, when adding a new HTTP Gateway in the iRule app, select "GET" under HTTP Method. Second (this is where I screwed up), the address to enter for the gateway address should look like this:
yourusername:yourpassword@yourIPaddress:8176
special note - there is no "/" at the end of 8176..this is the mistake I was making

if you don't use authentication then the address would just look like this:
yourIPaddress:8176

Something else I learned about your username and password - For the longest time I couldn't figure out why everything would work fine with authentication turned off, but would cease to work once I turned authentication on and input my username and password in the address. I finally developed a theory, which I think is accurate after testing. I had a "%" in my password. After reading various posts and seeing that people used "%20" to illustrate a "space" in text, I began to hypothesize the "%" in my password was being read as something else. I believe this is correct, because as soon as I changed my password to not include a "%", I no longer have any issues. Maybe this is common knowledge among this community, but I had no idea about that detail. The moral of the story for any Newbie: do not use "%" in your username or password.

Finally, when adding the code into the iRule builder, it goes under network codes, and should look like this:
devices/yourdevicename?toggle=1&_method=put
there is no "/" at the beginning (this was the mistake I was making)

Hope this helps someone else trying to integrate iRule with Indigo.

Now my real work begins - I've got to install 20+ switches, 5 outletlincs, and 3 thermostats. Extremely excited about all of the possibilities that Indigo presents. I've got a lot to learn, but really looking forward to it.

Posted on
Mon Jan 30, 2012 7:36 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Getting iRule to communicate with Indigo via 2413U

% is a reserved character in URLs - it's fine in a password but when you insert the password in the URL it gets interpreted as a special character. You should also note that when putting your password in an unprotected URL (http vs https) it is sent in the clear over the network so it's possible for it to be sniffed...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jan 31, 2012 7:04 pm
.Capstone offline
Posts: 36
Joined: Sep 21, 2011

Re: Getting iRule to communicate with Indigo via 2413U

Jay,

Good to know; I'll make sure not to be putting it in the address bar as a URL. I'm assuming that when my iPhone is connecting to an HTTP gateway (my MacMini in this case) and needs to know the address (of which I have already entered in with my username:password) this can't be sniffed?

-Wes

Posted on
Tue Jan 31, 2012 7:10 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Getting iRule to communicate with Indigo via 2413U

Any time you enter the username:password as part of the URL it can be sniffed. Now, if you're only doing it on your local network and you have good protection on that network then the chances are reduced.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Aug 17, 2013 8:39 pm
pbaperez offline
User avatar
Posts: 35
Joined: Jun 08, 2011
Location: Austin, TX

Re: Getting iRule to communicate with Indigo via 2413U

I'm just now getting around to incorporating indigo with iRule and this post has been great. Is there more you can do besides toggle though? Can we set fan speed? Brightness?

Let me know!

Thanks,
Paul

Posted on
Wed Aug 21, 2013 7:54 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Getting iRule to communicate with Indigo via 2413U

Hi Paul,

There are Indigo RESTful APIs for setting brightness and fan speed. See the full list here.

Image

Posted on
Tue Sep 24, 2013 1:16 pm
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Re: Getting iRule to communicate with Indigo via 2413U

Any possibilities of at some point being able to get feedback into the iRule app? For example, someone turns on a light manually and the light shows up as on in iRule.

Is this something that is already possible but not supported by iRule or is it a limitation of Indigo or both?

Posted on
Tue Sep 24, 2013 2:34 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Getting iRule to communicate with Indigo via 2413U

It's definitely not a limitation in Indigo. Contact the iRule guys - they were working on an integration several months back but we've not heard anything from them since.

BTW, keep an eye out for information/press releases about Roomie Remote 2.0 over the next several days... ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Sep 24, 2013 3:03 pm
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Re: Getting iRule to communicate with Indigo via 2413U

jay (support) wrote:
It's definitely not a limitation in Indigo. Contact the iRule guys - they were working on an integration several months back but we've not heard anything from them since.

BTW, keep an eye out for information/press releases about Roomie Remote 2.0 over the next several days... ;)


:( You're going to make me regret my four hours of iRule dealer training aren't you?

Who is online

Users browsing this forum: No registered users and 14 guests