Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Home automation using Arduino / XMPP client for Arduino

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?

like image 912
Ashish Sharma Avatar asked Jan 22 '23 22:01

Ashish Sharma


2 Answers

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

like image 67
Salvador Avatar answered Jan 26 '23 17:01

Salvador


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.

like image 34
Dustin Avatar answered Jan 26 '23 18:01

Dustin