Posts | Comments

Planet Arduino

Archive for the ‘XMPP’ Category

Last week a customer of mine mentioned an issue with a door. This door is inside their server room which leads to a second room. They wanted that this door is closed most of the time because the air conditioning system doesn’t really need to cool down the second room.  The second room is around 15 square meters but goes through to the second floor. It’s seems that this space was supposed to be for a freight elevator in the first place. Now it’s just a giant cable channel and the room a welcome place for the technicians. It’s more cozy to stay there than in the actual server room less noise and their are chairs and tables.

Using a system like NetBotz or similar is out of the question because they are way to expensive just to check the state of a door. It seems a perfect place for an Arduino. I remembered that I wrote a script (arduino-xmpp) which just send a message to an XMPP recipient when something happens. I updated that script that it can work with a digital input instead of an analog value. It’s still messy but works.

Switch which is pressed when the doors is open, an Arduino, an USB cable, a Jabber/XMPP server, and a linux system with python, that’s all what was needed. I was lucky because I only needed a switch (found one in an old computer casing). The customers agreed to connect the Arduino to a Debian machine with a long USB cable and created an account on their Jabber server.

So, this solution is home-made but the overall costs of CHF 40 (around 30 Euro) are a huge advantage. I think that I will port this to the Raspberry Pi. Only one device means more flexibility and the costs are almost the same. Well, with the Arduino it would be very easy to check if the lights in the second room are on and the temperature there. As far as I know is the Raspberry Pi not capable to work with analog sensors directly. A topic for another day…

Below is a screenshot while script is working (sorry, I’m cheating with a standard button that I press with my finger, no door).

The code is hosted at https://gitorious.org/arduino-xmpp.

May
22

Arduino talks XMPP

arduino, General, XMPP Comments Off on Arduino talks XMPP 

The step from the simple HTML output to an other notification system, in this case XMPP (aka Jabber), is simple. The concept behind is the same as in the HTML example. Grab the data from the serial connection over USB and send them to the XMPP recipient.

In this example I'm using xmpppy to send the message to a single recipient (me). It's only working for the temperature but it's easy to extent to your own needs.

git clone http://git.gitorious.org/arduino-xmpp/arduino-xmpp.git

The code is hosted at https://gitorious.org/arduino-xmpp.

I’ve been busy since I last spoke about my lamp.  I’ve added code to put the lamp into various modes – so far I’ve implemented modes for ‘white’ (needs some calibration), randomly changing colours, randomly fading in and out with random colours, and of course just off. Modes are changed by sending characters to the …


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook