Tuesday, November 26, 2013

PiKam - Kivy Rasberry Pi camera interface.

Update 2014/01/12 - now with limited live view capability. 

Who could resist a RaspberryPi, certainly not me.  But what to do with it? I still have no real firm ideas, but I thought I'd better do something. I used the Kivy cross platform framework and python-twisted networking framework to create a remote interface to the RaspberryPi Camera Module. Nothing fancy, no live view, but I'm able to take pictures from from Linux desktop, my Android phone, and any other platform supported by Kivy+twisted.  Here's a screenshot where I used my Android phone to remotely command my RaspberryPi to take a selfie of the phone:

A few more details can be be found at the PiKam github wiki. You can browse the code directly on github.

 It was interesting to try out Kivy. It's very easy to get started, going a bit deeper can sometimes exhaust what is in the documentation - it's best to then grep through the examples. You can do a lot quite quickly, but there are definitely limitations - for example, I don't think a PiKam live view via a video stream would be possible. If you just want to do simple cross platform mobile app it's worth a look.


  1. First off great work! Is there a way of just taking the output of the camera and embedding it into a kivy widget. Example no need for streaming. Just a straight connection to the pi from the pi camera and the video being displayed in Kivy? Thanks in advance for any reply. As you are probably aware of the Kivy camera module doesn't recognize the pi camera just USB cams.

    1. At the time I wrote this I think what you describe would only have been possible by using having a Kivy app run a shell command to operate the camera. To avoid the GUI momentarily pausing, running the command might have to be done in a sub-thread or a separate process. It's possible the options for achieving this may have changed and become easier, but I haven't been keeping up with changes to kivy and raspberry pi since 2013.


These days we're only getting spam, so comments are now disabled.

Note: Only a member of this blog may post a comment.