jump to navigation

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

Posted by GuySoft in linux, open source, programming.
Tags: , , ,
trackback
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.

Features

  • 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:
    wifi

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!

 

Comments»

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:
https://www.osadl.org/Single-View.111+M5c03315dc57.0.html

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:

dwc_otg.fiq_enable=0
dwc_otg.fiq_fsm_enable=0

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

2. BruceR - October 14, 2017

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

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:
https://github.com/guysoft/RealtimePi/issues/4


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: