Page 1 of 1
WiFi Attachment
Posted: Sat Feb 16, 2013 6:54 pm
by thekameleon
if we can use the wifi attachment module like a http server. Can we use it like a client as well? Say to communicate with a web service and return data?
Re: WiFi Attachment
Posted: Sat Feb 16, 2013 6:59 pm
by rimai
Well, you will need to implement the http response parsing.
We don't have anything implemented for that yet.
When the controller sends data to the Portal, it acts as a client. It connects to
www.reefangel.com and sends data.
The server, then responds with OK, which the controller just ignores and doesn't do anything.
The only problem is that the wifi attachment is a single host client, which means it can only connect to a single host and it is configured to
www.reefangel.com by default. You can certainly change it to whatever you wish, but to change it, you must connect to the wifi attachment, enter command mode, change the host and exit command mode.
Easy to do it with a serial terminal, but many things can happen if you want to do it with the controller.
Re: WiFi Attachment
Posted: Sat Feb 16, 2013 7:40 pm
by thekameleon
So much for that idea. I take it though I can create some type of external kron job that can query the Wifi attachment get the data process and submit command based on that data. Or am I wrong?
Re: WiFi Attachment
Posted: Sat Feb 16, 2013 8:13 pm
by rimai
I think you can do that.
Re: WiFi Attachment
Posted: Sun Feb 17, 2013 7:48 am
by thekameleon
Just thinking about this... I am still stuck on a great way to get data from a web service into the controller. While the above idea could work configure and setting it up is painful. Most users would need DynDNS plus the config. It would be great if the controller could make simple REST endpoint calls. What are the odds of creating a Proxy page at
www.reefangel.com? This page would allow the module to make a http request through your site. Implementation is pretty easy. An example of one is here:
http://www.sharepointjohn.com/aspnet-pr ... avascript/
Thoughts?
Re: WiFi Attachment
Posted: Sun Feb 17, 2013 9:50 am
by rimai
Not difficult.
I already have a proxy page that the portal app uses to connect to the controller, but it is not advertised.
It's an aspx page that I could copy to the
www.reefangel.com server to be used as well.
My only concern is for hackers to start using it as well

Re: WiFi Attachment
Posted: Sun Feb 17, 2013 4:03 pm
by thekameleon
That is a concern... I have an idea how to solve it though. Have a proxy request page that allows a developer to register the domain of an endpoint and assigns them a key. Any request being made from the controller must have a valid user id (which I think you have used the forum id before) and the proxy key that will authorize the calls for a specific domain. Ideally if you can submit everything via a post with https to the proxy page that is ideal but I am unsure if the wifi attachment can handle that.
Re: WiFi Attachment
Posted: Sun Feb 17, 2013 8:00 pm
by rimai
I know what you mean and it should work, but it just seems a lot of work for little benefit.
Maybe I'm not seeing the big picture.
What do you intend to do?
Is the endpoint your server?
Re: WiFi Attachment
Posted: Mon Feb 18, 2013 2:27 am
by thekameleon
I am thinking real time weather and notification services