ZeroMQ on Raspberry Pi to bind your systems

Warning : This article has been automatically translated by Bing Translate

We already saw how install the message broker RabbitMQ. Here you will be able to install the broker that goes, multi platform : ZeroMQ.

The objectives of a provider of messages, There is a beautiful theory :

Simplify transport

Deliver a message to one or more recipients

Request information from a remote server

Subscribe to publications

Transform messages for the interoperability of systems

What is nice with ZeroMQ is that in addition to offer these features, It is cross-platform (Windows, Mac, Linux, iOS, Android, etc.), can be used in most of 40 programming languages, is quick and can run on systems with little memory. So the Raspberry Pi ! And it is far worth the price of an IBM Websphere Integration Bus since it is Open Source !

To fully understand all the features offered by ZeroMQ, I invite you to watch This link which explains the main features.

I therefore propose to set up a client-server simple to illustrate the use of ZeroMQ. So let's install the broker on the Raspberry Pi initially. It will be our server :

Update the system

apt-get update && apt-get upgrade -y

Install the packages needed for compiling

apt - get install –y g make autoconf automake libtool

Download the latest version (4.0.3 at the time of writing)

wget http://Download.zeromq.org/zeromq-4.0.3.tar.gz

Unpack the archive

tar zxvf zeromq - 4.0.3.tar.gz

Compile and install ZeroMQ

cd zeromq-4.0.3 ./configure make make install ldconfig

You here with your ready to use ZeroMQ. Or almost. Remains to implement the program to manage your trade.

I propose a simple server in Python

Side Raspberry Pi, the server, We will install the “binding” in Python, so in fact the library which will allow you to use ZeroMQ via Python programs.

apt - get install python-pip pip install pyzmq python-all-dev

Here's the source of the program which will be the server. Alors j’espère que les commentaires sont assez clairs :

PI Home Server uses cookies with pieces of raspberries to guarantee you the best experience in the world nothing that. If you continue to come here (I hope), vous acceptez l'utilisation des cookies.OK I want !