Skip to content

OLPC Spy Cam

So now that I have my XO OLPC computer I wanted to find something to do with it. As I said before its the web cam that really impressed me and so I decided to start playing with that. After jumping onto the #OLPC freenode irc room and asking them a few questions I was quickly able to write this python program.

Set it up as a cron job and upload pictures from outside my apartment window every hour. I’m not sure how long ill be keeping it running and if I play with the laptop and dont turn off the script I guess it will upload pictures of me.

Well for anyone interested the important code to take a picture is: [sourcecode language="python"]os.system(‘gst-launch-0.10 v4l2src ! ffmpegcolorspace ! pngenc ! filesink location=’ + filename)[/sourcecode] and I would love to hear what you have been doing with your XO.


  1. I don’t have an XO, but I think this is wonderful stuff: good for the kids, and a wonderful opportunity for Linux evangelism.

    I had two calls this week from new XO owners who needed a little help.. I have never seen one of the darn things so I couldn’t do much, but at least I explained some basics (like, no, you aren’t connecting to a special “Linux Internet” – it’s the same World Wide Web you already go to).

  2. earobinson says:

    @Anthony Lawrence You should get them on freenode they have great support there :)

  3. Anon says:

    I’d love to tell you, but unfortunately my OLPC’s one of the lagging few thousands who are burning 400 bucks and have no XO so far *sigh*

  4. Ian says:

    Next time put a shirt on when you take a pic of yourself. :S

  5. Eve says:

    Hey. Ok so this is driving me insane! I would like to upload pics onto my myspace. I did it once before, but i have no clue what i did. Can you help?

  6. ThePete says:

    Hey Eve, you might want to stop by the and have a look around. There are a lot of great threads there.

    As for how to upload pictures to MySpace, I’d say you would probably have to pull up MySpace in the XO’s browser and, when you go to your upload page and click the “browse” button, you’ll see the Journal appear. Find the picture you took with the XO’s cam and then select it.

    To make it easier to find the pictures you take, you might want to go into Journal and click on the picture entries and change the names of each one. This way when you go to upload them you’ll know which one is which. Otherwise each one will just be called “picture by Eve”.

    Hope that helps! Please feel free to contact me if you have any other questions. I’m at thepetecomATgmail.

  7. Taylor says:

    I’m eager to try out your (awesome looking) timelapse software on my XO, but I keep getting the error:

    “Import Error: no module named Image”

    Where is the image module that it needs?

    Do I need any other software or libraries installed on a stock XO?


  8. earobinson says:

    Taylor I dont think so, but it does use the pil library, try:

    yum install python- imaging … i hope thats the command ill check it when I get home

  9. ThePete says:

    I’m getting the error where it says “No module named imageFilter” even after I yum installed python-imaging. :(

    Any ideas?

  10. earobinson says:

    imageFilter is the second file if you do an “ls” you should have two files and

  11. Bob Smith says:

    Hey I am a brand new linux newbie, what are the step by step instructions for setting this up? Sounds way cool!

  12. Taylor says:

    earobinson – I wanted to drop you a quick “Thank you” for filling me in on the missing “sudo yum install python-imaging” command. It’s working like a charm!

Leave a Reply