RPi, Threading & Queue

By: Casper, Frank & Jannick

Introduction

For our IoT Project we have decided to work multi threading and a queue, to manage multiple inquiries and inputs for the pi and it’s components.

Dickbutt
Initial concept for project

The core concept of the project is that each of the monitoring scripts that we have running on seperate threads have a unified queue that will handle the flow of inputs, and redirect the commands to a given destination based on pre-defined logic.

This is done by encoding the commands with XAML such as this:

<xmldoc>
	<component value="rotor">
		<value="int (from -∞ to +∞)"/>
	</component>
</xmldoc>

Where the component value is the destination identifier and the value is the command for the destination to execute.

Wiring & Components

In the picture below you can get an overview of how we connected our components to the Pi unit. We do want to point out that while the project is based on hooking up multiple components to the Pi, we only hooked up one source (rotary encoder), and one destination (Stepper-motor), for our testing purposes.

Wire Layout

Logic Functionality

Graphical overview of the programmed logic

Class Diagram

Project Download

Right Here: Threading_And_Queue.zip

GitHub Link: https://github.com/CasperGuldbechNielsen/ThreadingAndQueue