Pi good for nothing?

I'm confused by some statement I did read today. Its the first time i want to interface relays and temp sensors (1Wire) directly to a Pi (Banana). I find out you need RPi.GPIO and there you can read:

Note that this module is unsuitable for real-time or timing critical applications. This is because you can not predict when Python will be busy garbage collecting. It also runs under the Linux kernel which is not suitable for real time applications - it is multitasking O/S and another process may be given priority over the CPU, causing jitter in your program.


I wonder because there are so many books about that topic and people do it all the time. This statement is not just about Python - it's about computers, software, OS in general.

People run there whole home automation on computers and do the logic (if this than do that) on them. There is openHAB, Node-RED and all this stuff. People use Python, Java, Javascript, PHP... Isn't a PBX (Asterisk) also realtime and running under a OS?

What are the GPIO's good for if you look at them from this statement? What about MQTT? It also needs a server (Broker) that is running under a OS.

The kind of "real time" they are talking about is for applications where microseconds matter - like controlling a missile defense system or flying an airliner. For 99.999% of all applications this kind of precision is not required and a general purpose multi-tasking OS like linux is fine. If you are using internet-based applications such as those you mention then network delays will be many orders of magnitude greater than any variability at the OS level.

If you are interested then search for "raspberry pi rtos" for ports of real time operating systems to the pi.

controlling a missile defense system

That’s exactly what I’m after to defend my property.
But its not so easy cause i can’t find a schematic for that old Russian missile i got from eBay.
:slight_smile: :slight_smile:

For me “real time” is = i push the button and the light goes on :slight_smile:

But now i learned something new. Never heard of Real Time Operating System (RTOS) before.
This will get me started to fire that big old missile connected to the PIR sensor.
Only downside with my system is that you have to build a new house after every intruder alert :slight_smile:

The Arduino can be considered to have a "real time operating system". It loads one program and runs it. The only hesitations are the occasional timer interrupt.

Linux and Windows might have 50-150 programs/processes running at any one time.

I dont think RTOS is neccessary for turning on some bulbs, just check by yourself the gpio speed of the rpi, youll be satisfied.

But its not so easy cause i can’t find a schematic for that old Russian missile i got from eBay.
:slight_smile: :slight_smile:

I wondered who outbid me for that… Did you have any trouble getting it through customs?