views:

1661

answers:

7

I am trying to setup a system for automating certain tasks in my home.

I am thinking of a solution wherein a server side application would be able to send/receive commands/data to Arduino (attached with Arduino Ethernet Shield) via the web.

Here the Arduino may both act as a sensor interface to the server application or command executor interface for the server app.

E.g. (user story):

  1. The overhead water tank in my house has a water level sensor attached with Arduino (attached with Arduino Ethernet Shield).

  2. Another Arduino (attached with Arduino Ethernet Shield) is attached with a relay/latch. This relay/latch is then connected to a water pump.

  3. Now the server side application on the web is able to get/receive water level information from the Arduino on the water tank.

  4. Depending on the water level information received, the web application should send suitable signals/commands to Arduino on water pump to switch 'ON' or switch 'OFF' the water pump.

Now for such a system to work across the web, I am thinking of using one of the type of solutions in order of my priority:

  1. Using XMPP for communication between server application and Arduino.

  2. Using HTTP polling.

  3. Using HTTP hanging GET.

For solution number 1, I need to implement a XMPP client that would reside on Arduino.

Is it possible to write a XMPP client small enough to reside on an Arduino?

If yes what are the minimum possible XMPP client functionality that I need to write for Arduino, so that it would be able to contact XMPP servers solutions like GTalk, etc.?

For solution number 2 and 3 I need guidance in implementation.

Also which solution would be cost effective and easily extendable?

+1  A: 

I don't think I'd look for any of those for what you're trying to do.

Just feed the sensor data out of the Arduino on a given interval and have the other side do the smarts.

Also, for these types of projects, I've been looking to avoid the Ethernet shields and use either XBee or RFM12B. These would guide you in that direction, but more importantly, make it far easier to have lots more devices doing both telemetry and control.

If there were something like XMPP that ran on the Arduino, it'd be a really stripped down presence protocol proxied through a smarter server-side process. That is, it'd be a similar amount of work. Though it may be possible, XMPP in 1 KB of RAM alongside your application code sounds really painful.

Dustin
Dustin, I looked into your suggestions and agree that xmpp on 1k of RAM will be painful,but also using xbee or rfm12b will restrict the availability of my solution. Here actually i am looking for a web service(server side) like architecture to communicate with my arduino so that later on i could integrate and communicate with the arduino with the REST api deployed on a remote server from a variety of platforms.
Ashish
In my experience, TCP/IP on Arduino or PICs is possible, but as not much more than toy examples. A better way would be to run another type of interface (Ethernet+UDP, serial, USB, one-wire) up to a server (or WRT54g-type router) which translates this to the heavier HTTP/XMPP. Also, plan for failures! If your server is down, your water tank will overflow. If one Arduino can autonomously monitor the tank and control the pump, and send status to the server, you have a much more robust solution.
Wim
Good idea Wim, Since I am already working on the solution now a days, therefore I will definitely try to integrate and address the issues raised by you.
Ashish
A: 

After looking into all of the available options I was not satisfied with any.

Currently I am working on to put my own solution to the problem that i defined above.

The solution is on the lines of the comment that i replied to 'Dustin' above.

Will post the project URL as soon as i come up with the first release of my solution here.

Ashish
+1  A: 

We're working on an open source relay infrastructure to make Arduinos (and any other device supporting TCP/IP sockets) accessible over the Web. Your application could then call the Arduinos through a simple REST API. See http://www.yaler.org/ for more info and a live demo.

Regards, tamberg

tamberg
when is it going to be available and can i contribute on it?
Ashish
+1  A: 

There is a project in development, has policies and data recorder capabilities. (sensors/any_data_source over xmpp) http://middlewaresensing.wordpress.com/

salvador
A: 

Why not use the good old RS485 to reach the sensor actuators? Just invent some simple protocol (address, command, data). If you need something more complex, use another guy as a RS485/ethernet bridge.

Marcelo MD
+1  A: 

Open source project

Manage sensors and networks | record sensor data | charts | policies | history/date/sensor rules | sms/email/url/twitter/xmpp notifications | event logging | Google Maps | and much more

demo at http://dev.hci.uma.pt/sawa

wiki at dev.hci.uma.pt/mediawiki/index.php

blog at middlewaresensing.wordpress.com

You can use send data to server using HTTP Post, then sensor data is published via XMPP. HTTP Post (for resource limited devices, such as arduino) and sox_tools a xmpp client for publish via xmpp on this system

+2  A: 

You can take a look at MQTT, it has an arduino library, its a simple publisher-subscriber message broker.

Salvador