Kivy Pie

Kivy onRaspberry PI

Kivy is a Python framework for multitouch apps.
Developers can boot Kivy Pie to start working straight in!

Frequently Asked Questions

Q: Why KivyPie, and why pipaOS?

A: To make the installation steps simple to Kivy developers. KivyPie integrates all software needed and boots directly on the Raspberry PI, no extra configuration is needed. pipaOS is a minimalist Raspbian OS version. KivyPie 0.6 comes with a small X desktop that you can start manually at any time with startx.

Adding more features and fixing bugs to Kivy Pie should make the development experience more agile. You are very welcome to help, submit suggestions, and report problems at the discussion group.

Q: How do I upgrade to the latest system software and RaspberryPI Firmware?

A: KivyPie is bundled inside PipaOS, which is based on Raspbian. You can use sudo update / upgrade to keep your system up to date,
and you can also call sudo rpi-update to upgrade to the latest RaspberryPI firmware.
There is an overall recipe here.

Q: How do I upgrade to the latest Kivy framework?

A: sudo apt-get update; sudo apt-get install python2-kivypie python3-kivypie python-kivypie-examples
Note that kivy points to Python3, whereas python runs Python2.
The packages are submitted to the pipaos repository each
time I build a new release image.

A: The PiTFT display needs a specially crafted linux kernel. You should get it running by following the steps in the DIY Installer script section. I recommend you do a backup of the /boot directory in case you need to rollback.

Q: Can I take a screenshot of my Kivy apps while they run?

A: Yes, type raspi2png on the command line, a file called snapshot.png will appear. Thanks to Andrew Duncan.

Q: Is there a new version coming up?

I work on KivyPie on my spare time for fun, so yes new versions will continue to arise,
but I have no deadlines :-)

It seems this library had a few issues on the the RaspberryPI.
As of KivyPie version 0.6 it comes with python-rpi.gpio,
raspi-gpio and wiringpi official Python packages.

Q: Can I have an HDMI display and the RaspberryPI touch screen at the same time?

A: Yes. Enable the flag display_default_lcd=0 on the file /boot/config.txt, set your user's environment variable KIVY_BCM_DISPMANX_ID="4" to run Kivy apps on the touch screen. The way around does also work, set KIVY_BCM_DISPMANX_ID=5 instead.

Q: Everything on my screen is upside down!

A: Add this in your /boot/config.txt: lcd_rotate=2, then reboot.

Q: Is there a X11 graphical desktop?

A: Yes there is, login with sysop from the console and type startx. You should get a Fluxbox desktop on your display.

Q: Can Kivy apps run as the superuser?

A: This issue has been fixed on KivyPie v0.6. It is possible to run kivy apps via sudo, or through systemd profile scripts. The Kivy framework configuration file is different and is located at /root/.kivy/config.ini.

Q: What is the password of the superuser?

A: thor.

Q: I cannot see anything on my display after booting up.

A: Have a look at the file /boot/config.txt. The default settings should work on most displays but some might not work, or show black margins on the sides (overscan). There is a good step-through process to match your display.

Q: How can I start a kivy app immediately after boot?

A: Easiest way is to add /usr/bin/kivy /path/to/my/app.py & to your /etc/rc.local file.
Keep in mind that kivypie boots really fast, you might not get the app networked until a bit after.
Also, you won't be able to switch to a different tty when a kivy app is running,
either ssh into it, or provide a hotkey escape option to your app.

Q: Can I specify the dispmanx layer for my Kivy apps?

A: Kivy on RaspberryPI relies on SDL2 to get access to DispmanX,
and there is a patch to specify
the layer number using a Hint or an environment variable.

Q: How can I quantify resources used by my kivy apps?

A: Install the rpi-monitor debian package, and run rpi-monitor &.
It will visualize on top of your kivy apps in real time, so you can detect
GPU memory constraints, or other resources you choose to peek at.

Q: Is it possible to run Kivy apps remotely?

A: Yes, execute sudo dispman_vncserver.
Open a RealVNC Viewer from a remote device
and connect to Kivypie IP address, port 5900.
It is not 100% reliable, and it seems you cannot send keyboard/mouse input from the VNC client to the app,
but it's fairly usable. Thanks to Peter Hanzel.

Q: My Python2 based apps do not run on KivyPie 0.9b!

A: I mistakenly built Python3 alone on this release, sorry about that!
You can quickly fix it like so:

I haven't tested these packages on a real RaspberryPI running Raspbian, and they depend on core functionality only.
It's very likely some features will not work.
Help in tracking down issues is greatly welcome. Please report findings at the
discussion group.