PiPurr – The Remote Cat Interaction Server

PiPurr Server

PiPurr Server

All the best hacks and open-source projects come about by scratching personal itches. In fact when asked by friends and acquaintances “How do I start with coding – what should I write?“, that is my usual answer – “Find something you don’t like or would like to improve and do that“.

This brings us to the idea of PiPurr, what I like to call the Remote Cat Interaction Server.

Whenever we go on holiday, we never really get to relax, because Hannah is always asking me things like “Do you think the cats are OK?“, “What do you think the cats are up to?” etc. PiPurr is the solution to this problem.

The goal is not just to be able to keep an eye on what the cats are doing when away from home, but also to interact and play with them remotely too.

PiPurr is a simple client-server solution. The server runs on a Raspberry Pi, for low power consumption and provides the functionality – capturing images, dispensing treats, making sounds play from the speakers etc, and clients connect to this over HTTP and request those actions.

PiPurr for Android

PiPurr for Android

The server is implemented as a small Python web server, using HTTPServer that, instead of serving static files from a directory, exposes a small number of URIs that correspond to those actions. This means that all that is required to access it is a browser. A summary of the actions are:

  • /cats.jpeg – Capture and return a photo from the webcam. Uses OpenCV.
  • /sound – Play the sound out the speakers to entice the cats over.
  • /treat – Dispense a cat treat – Currently in development, and will use a PicoBorg stepper motor to drive a treat dispenser. Keep a look out for another blog post about this in the future.

The decision to use the (rather large and fiddly to get working on Raspberry Pi) OpenCV for image capture is down to the fact that in the future I am going to write a cat detector, and possibly other vision-based functionality.

A neat addition to the server is the LedBorg, which is an RGB LED add-on, set to flash different colours depending on what happens when requests come in. Red for 403s, 500s etc., green for 200 on the image URI and blue for 200 on the sound URI.

Sharing

Sharing

For ease of use, I also developed an Android client that allows easy access to PiPurr whilst out and about. The app also allows for sharing of the captured images over email, Facebook etc.

I will be adding more functionality to the solution as time goes on. Some of the things I have planned are:

  • / – Implement a web UI to control it easier with a web browser.
  • /laser – Move a laser pointer or similar cat to about with motor control.
  • /video – Stream live video.

I plan to talk about this project at BarCamp Canterbury on the 27th April 2013 if you would like to find out more, or have any cool ideas.

About Tris

Tris is a software engineer with a PhD in image analysis. He likes real beer, photography, electric guitar based music and Unix operating systems.
This entry was posted in Hardware, Programming, Software. Bookmark the permalink.

7 Responses to PiPurr – The Remote Cat Interaction Server

  1. This sounds fantastic, can’t wait to see it in action. And I love your writing :)
    I would love to interact with my monkeys whilst being away.

  2. Scott says:

    Awesome work; I built a 2-axis laser pointer connected to the raspberryPi; it allows for IP control (I was working towards a similar project as you have). It works with the lightingPi software I wrote (https://github.com/scottjgibson/lightingPi). 2 Servo channels for X and Y and one PWM for laser brightness. It can be controlled with DMX and openOSC, but you can hack any control into it easily. I need to take a demo video with my cat. :D

  3. M. says:

    Hi,
    Seems like a great project. Have been working on something similar but for monitoring visitors and potential stalkers instead :-) I’ve had limited success with video streaming. In general, setting up a streaming server that streams to a PC isn’t hard, its getting the android tablet to display the stream..would you please share your ideas on that front?

  4. Sounds like a great project :-)

  5. endrju says:

    How did you a streaming video ?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>