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!



1. JAM - October 14, 2017

I went to try it out. For me, Gadget USB-Ethernet seems to crash under mild network traffic on the pi zero.

GuySoft - October 14, 2017

Hey, it might be that you got this known issue:

I haven’t managed to reproduce it, so I didn’t apply the patch given there.
They give a workaround, adding this in the cmdline.txt:


If you can try that and report its success or failure, I’ll know what to fix for the next release.

GuySoft - March 7, 2018

The patch is now part of the release.

2. BruceR - October 14, 2017

Thanks, I’m going to try this with my Pedal-Pi

lifeinlowkey - January 8, 2018

I recently got a Pedal-Pi too, and was thinking of trying this! How did it go for you?


GuySoft - January 8, 2018

Iv’e been reading and it looks like the Pedal-Pi is just a rewrite of the arduino version. If you already have a Pi you should really try guitarix or rackarack, you can have a full real-time padal system like that. I’m looking in to building a distro for this.

lifeinlowkey - January 8, 2018

Thank you, I’ll take a swing at those. I look forward to the distro!

3. JAM - October 17, 2017

I added the above lines. For me, the pi zero was still hanging. I could not get past a ‘sudo apt-get update’. It also crashed for me sometimes while ssh-ing into the device. I tried an external power supply thinking the crashes were due to insufficient power on the OTG port, but that did not seem to solve it. To test if it was the hardware, I went back to a stock raspian sd card and it seemed to be OK.

GuySoft - October 17, 2017
GuySoft - October 21, 2017

Hey, there is an RC of version 0.2 with a patch that might solve your problem now:

4. Yuliya P - February 16, 2018

I have installed it and now I must enter my login data. But I don’t know the default login and password. Can anybody help me?

GuySoft - February 16, 2018

Same as any raspbian image pi/raspberry

5. G - March 7, 2018

I am having trouble setting up wifi and having it automatically come up on boot.

I have separately tried editing realtimepi-wpa-supplicant.txt and realtimepi-network.txt to have my wifi ssid and key. I have also changed both. From reading the comments in realtimepi-network.txt it seems that only thins file needs to be edited for a single ssid setup.

I cannot however get the wlan going – neither automaticall at boot or manually via iwconfig or ifconfig or iw

What i have for the realtimepi-wpa-supplicant.txt, I put identical info to what I used with a standard raspbian install:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev


for realtimepi-network.txt I used:
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wpa-ssid myssid
wpa-psk mypassword

Some help would be greatly appreciated.

Thank you


GuySoft - March 7, 2018

Please open an issue in the github, this a comment section, not a issue tracker.
Just paste it so we can go though troubleshooting there.

6. G - March 8, 2018

I have created an issue in github. I also corrected my code there.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: