The Core of the Revolution – RevPi Core (Part II)

Revolution Pi Core Glas Design

We will continue explaining RevPi Core and today this will be a summary of all software components. At the end of this newsletter we explain why some of the original Raspberry Pi connectors can’t be found on a RevPi Core module.

Basic Concept

First of all RevPi Core is an open platform allowing you to install software of your choice including everything from operating system up to applications. As long as it is compatible with a Raspberry Pi it will run on RevPi Core in most cases. By default, RevPi Core comes with a pre-installed Linux operating system and driver for RevPi IO modules and gateway modules. You may additionally buy the soft PLC from logi.cals and the SCADA software SpiderControl from iniNet which both will be available in our online shop. Using these components you end up with a complete and ready to run PLC. You prefer to write your own software using Linux and Python? Just use the pre-installed driver and optimized operating system distribution to have access to process data in RAM via the central process image managed by the driver. Simply use Linux character oriented device file access commands of your programming language.

Operating System

We’ve decided to pre-install RASBIAN (a Debian variant), using version Wheezy and an RT patch of kernel 4.1.13. From our point of view this has been the best compromise to stay as close as possible to the original Raspberry Pi and still get full control over task priorities used by the scheduler. The scheduler of this patched kernel which does control interleaved execution of all running tasks can be configured in a much more flexible way. This helps avoiding any delays in task execution normally experienced during network or other IO access. When using our soft PLC solution there is no need for you to get involved with such configurations. But if you’re a programmer running you own software we will support you with technical documents to understand the scheduler’s configuration options in order to get best results for your own application.

PiControl

Using just the operating system you may install any third party software written for Raspberry Pi systems. In future blog articles you will find examples for experiments with third party software we have been testing (e.g. FHEM and Cayenne App). But of course you may also write your own application software using Python or other languages. In order to give your application full access to all IO- and gateway modules of the RevPi family it should use our driver called PiControl (PiCon). This driver does cyclically exchange data with other modules using the PiBridge data channels. This data is kept in a memory section of RevPi Core called central process image. PiCon does run as a high priority task controlled by the Linux scheduler. This will guarantee a maximum cycle time. The current version does have a cycle time between 5 and 10 ms when using up to two IO Modules.

PiCon does more than just exchanging data. During startup PiCon does detect any connected module and its physical position in a system using a special protocol and certain PiBridge channels. PiCon may check the module constellation against a configuration file which has been generated using our graphical editor called PiCtory (more about this powerful and yet easy to use editor will be revealed in a future newsletter). The configuration file may also contain specific configuration values for each module of the system which will be send to the modules during startup to set up their behavior.

Process Image

All cyclically exchanged process values are read from or written to a central process image resting in a memory section of RevPi Core at predefined addresses. This exchange is controlled by PiCon, a pre-installed driver we deliver with every RevPi Core. Process values may not only be exchanged using the PiBridge channels but also USB, Ethernet or GPIO pins of the Compute Module. Software developers may use simple Linux character based device file access commands to access the central processing image. This is the way you simply fit your own programs into our modular hardware concept.

Apart from PiCon and together with our community we will publish more drivers. E.g. you will get a driver for data exchange between an MQTT broker and the central process image. Another driver will enable you to exchange data via an USB serial channel with which you may exchange data between RevPi Core and an Arduino or an EnOcean USB transceiver.

Own Software

Using Python, C or any other programming langue or tool suited for Raspberry Pi you will be able to write your own applications. Using Linux functions you get access to the process data. Alternatively you simply buy a ready to use soft PLC. In our online shop we will offer an EN61131-3 compliant editor logi.CAD 3 (running on any PC) developed by logi.cals together with the runtime system logi.RTS which will execute any PLC program you’ve written using logi.CAD 3. The HMI-software SpiderConrol plus the soft PLC will be available for less money than a tankful of gasoline.

logi.CAD 3

If you install the runtime system logi.RTS on your RevPi Core, it will cyclically exchange data with the central processing image and execute any control tasks which have been programmed using any PC with logi.CAD 3 software as an EN61131-3 compliant PLC editor. Logi.CAD 3 uses the basic framework “Eclipse”. Therefore you will have a long-term availability and it can be used on Windows, Mac OS X or any common Linux distribution. Because the editor is compliant to EN61131-3 any PLC programmer will be able to immediately write PLC programs with logi.CAD 3 and newbies will have an easy start with it. The editor is designed in order to support efficient and effective teamwork. Code changes are traceable and you get integrated QA- and management tools or immediate feedback of detected coding errors to name just some of the central features. In order to make work easy you do not need to calculate any offsets to access certain process values of the process image. You may simply use symbolic names instead. Matching between symbolic names and addresses is done by the above mentioned configuration file written by our PiCtory editor. Just as PiCon the logi.CAD 3 editor also reads this file during startup and extracts all addresses and symbolic names.

PiCtory

The configuration file can be edited using the graphical editor PiCtory which is an easy to use web application accessible by any browser. PiCtory may run on a RevPi itself or on any PC. We will continuously expand the functions of PiCtory and you too may add own modules or virtual modules (driver which run under Linux and do exchange data with the central processing image) as new list items. We designed PiCtory as an open platform too which can be continuously expanded by our community. We will take a closer look at PiCtory in a future blog article.

SpiderControl

SpiderControl by iniNet is a HMI software you can use to visualize data. It runs a web server (SCADA Server) on RevPi Core and is connected to the central processing image. Using an integrated editor you can create web pages containing visual elements to display process data or set process values. These web pages can be accessed by any standard browser connected to this server (e.g. over the internet) . There is even a possibility for you to use an integrated Basic interpreter and add own code to realize solutions like a recipe management. More about logi.CAD 3 and SpiderControl can be found in a future blog article.

Cloud Services

We have started and will continue implementing cloud services for Revolution Pi. These services will provide you a secure environment for realizing your IoT visions. We will present solutions for customers who are looking for a “click and run” ready to go service as well as for power users who want to get access to every configuration possibility. So as a user of our soft PLC solution you can simply relax: We will take care and solve all technical challenges so you can securely connect to your RevPi core from all over the world. We will especially keep an eye on well designed and transparent concepts for data security. This is a showcase of services we have realized or plan to realize over the next 12 months:

  • KUNBUS DynDNS server solving the problem of changing IP addresses of RevPi Cores.
  • Data security by hardware encryption (a chip which does securely provide certificates and keys) which guarantees that only authorized people will have access to the specific device and that the data exchange is protected from being accessed by third parties.
  • SMS and text-to-speech (TTS) gateways with high accessibility and minimum reaction time, e.g. for messaging system alarms.
  • Hosting of MQTT brokers and providing secure tap-proof point to point connections of multiple RevPi Cores.
  • Implementation of big data gateways e.g. to AWS or other services.
  • Asset management tool for clients who have installed multiple RevPi systems, realized as web application.

 

There will be many more ideas coming from our community which will be discussed and if they make any sense will be realized step by step.

We’ve promised to explain why we don`t include some of the original Raspberry connectors in our RevPi core design. So here are our arguments:

DSI und CSI

After a good deal of thought we have decided not to supply these short range and somehow uncommon interfaces for cameras and LCD panels. In an industrial environment such highly sensible high speed data lines would make no sense if used outside a protective housing. And there is a cheap alternative to these interfaces: Simply use USB cameras or HDMI displays which have signal stability over much longer range even in an industrial environment. Our tests have shown that real time high resolution image processing (irrespective of the chosen interface) does bring the Broadcom CPU to its limits. Therefore the small transmission bandwidth of USB cameras would be sufficient and perfectly fit to the computing power of the CPU. We are open to be convinced otherwise.

Raspberry Pi Expansion Pin Header

The typical Raspberry pin header with all its GPIO, I2C, UART and SPI connectors does not really work in an industrial environment as theses lines would not be compliant to noise immunity and switching thresholds defined in norms to be applied. All digital and analog in- and outputs are provided through special norm compliant RevPi modules connected to the RevPi core. But you can re-direct by software any unused GPIO output signal of the Compute Module to set or reset output lines of RevPi modules. This way many programs written for Raspberry Pi which do use GPIOs may be used too on a RevPi Core without changes.