WiFi Attachment

Related to the development libraries, released by Curt Binder
Post Reply
thekameleon
Posts: 137
Joined: Sat Feb 16, 2013 7:44 am

WiFi Attachment

Post 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?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: WiFi Attachment

Post 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.
Roberto.
thekameleon
Posts: 137
Joined: Sat Feb 16, 2013 7:44 am

Re: WiFi Attachment

Post 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?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: WiFi Attachment

Post by rimai »

I think you can do that.
Roberto.
thekameleon
Posts: 137
Joined: Sat Feb 16, 2013 7:44 am

Re: WiFi Attachment

Post 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?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: WiFi Attachment

Post 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 :(
Roberto.
thekameleon
Posts: 137
Joined: Sat Feb 16, 2013 7:44 am

Re: WiFi Attachment

Post 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.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: WiFi Attachment

Post 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?
Roberto.
thekameleon
Posts: 137
Joined: Sat Feb 16, 2013 7:44 am

Re: WiFi Attachment

Post by thekameleon »

I am thinking real time weather and notification services
Post Reply