jump to navigation

RealtimePi – out of the box real-time RaspberryPi Raspbian October 9, 2017

Posted by GuySoft in linux, open source, programming.
Tags: , , ,
RealtimePi logo

RealtimePi logo

Hey all,
So it started as a curiosity, and it looks like its working. I made a Raspbian-based distro that ships with a realtime kernel called RealtimePi. You can download the latest here.  It’s open source, sources are here.

A realtime system means its deterministic, it means you should know how long things take to run. They way to do is is to apply a patch to the linux kernel that makes it non-preemptible. To explain – Preemption is the act of temporarily interrupting a task being carried out by a computer system, without requiring its cooperation, and with the intention of resuming the task later.

This is useful for building hardware and robotics, low latency audio and other gpio because there are no surprises when it comes to timing. It seems like something good to try out with the RaspberryPi, because of the GPIO and IOT capabilities.

Bundled with CustomPiOS you can build your customized realtime-kernel device.


  • Both armv6 and arm v7 are supported! Aka all versions of RaspberryPi to date!
  • 4.9.52-rt37-v7 with PREEMPT kernel
  • Easy way to set up the network using realtimepi_wpa_supplicant.txt in the boot partition

Steps to install

  1. Download the image here
  2. Unzip and flash it to an SD card (small enough to fit a 2GB card)
  3. Open newly flashed image and edit two files, one for the wifi, and one for the bot token:
  4. Put in realtimepi-wpa-supplicant.txt your wifi address (skip if using Ethernet cable). Here is how it should look:

You can test the realtime kernel is enabled, by running in the commandline

uname -a

You should see something like this, note PREEMPT RT which indicates its realtime:

 Linux realtimepi 4.9.52-rt37 #1 PREEMPT RT Fri Oct 6 22:29:28 UTC 2017 armv6l GNU/Linux

The line should  look a little different for armv7

I am not an expert with actually building realtime systems, so input on how it preforms, and examples would be appreciated!