Architecture - GerardT/Arro GitHub Wiki

The architecture consists of the components as shown below. Overview

Runtime environment

The runtime environment typically runs (as shown) on a Raspberry Pi. It consists of the following software components:

  • ServerEngine - a thread serving a TCP/IP socket for communicating with Eclipse plug-in on Host. It also downloads the Program as a package of files from Host to Runtime environment, into the "download" folder.
  • NodeDb - the main component that executes the program that is stored in "download".
  • SocketClient - a thread serving a TCP/IP socket for communicating with web server. Socket data is structure as JSON messages that are forwarded to the Browser over web sockets.

The ServerEngine controls (starts / stops) both the ServerEngine and SocketClient. Each time a new 'program' is downloaded, NodeDb is restarted.

Furthermore there is the Python / Autobahn based web server that supports web socket communication.

Host Eclipse Plug-in

The program that is executed in the runtime environment must be developed on a Host computer running Eclipse and a special Arro Eclipse Plug-in. A separate section in this Wiki explains about the program and its components. The Eclipse plug-in is only used for developing a program and downloading it to the runtime environment.

Browser

The HTML5 Browser, usually running on a separate computer, provides the UI for the program. It will read one index.html that is generated by NodeDb and consists of web components (Polymer based) that communicate to the runtime environment over web sockets.


The program

Section The Program describes the program from a user point of view. When downloaded to the runtime environment it consists of the following files:

  • arro.proto
  • arro.xml
  • arro_pgm.py
  • zero or more files .py

Files arro.proto and arro.xml are essential parts of the program, the others are optional.

Arro.proto

Arro.proto describes all Messages that are defined and being used in the program. Messages are passed around using Protocol Buffers as packaging / transport mechanism. Therefore the Messages are declared in the syntax that is understood by the Protocol Buffers compiler.

Arro.xml

Arro.xml contains the full list of program modules. As described in The Program, upon execution this list of modules is expanded into a network of Elementary Blocks.

Again, there are several kinds of Elementary Blocks, that for each type carries a specific URL (class:type):

|| Elementary Block || URL || | Programmable blocks (e.g. Python or C programmable) | "Python":type or "Native":type | | User Input and output blocks | "UiIn":type or "UiOut":type | | Configuration blocks | To be decided.. | | State Machine blocks | "Sfc" |

For each URL there is a sw plug-in into the NodeDb component that implements the behavior as expected by the Elementary Blocks of their type.

arro_pgm.py and .py files

The Python code of a Python Elementary Blocks of a specific type (URL "Python":type) is captured in a single Python class with the same name as the type. One class is stored in one .py file. During execution, the arro_pgm.py files and all .py files are concatenated into one Python program and loaded into the Python interpreter.