Chosen Project Report: Cooperative Hybrid Objects Sensor Networks
Chosen Project Report: Cooperative Hybrid Objects Sensor Networks
CHOSeN
Project Report
DELIVERABLE NO D4.3.3
Table of Contents
1 Abstract.............................................................................................................................................3
2 Concepts............................................................................................................................................3
2.1 Software Architecture of the Middleware Node.................................................. 4
2.2 Distributed Middleware .......................................................................................................... 4
3 Hardware Reference ....................................................................................................................5
3.1 Middleware Node ......................................................................................................................... 5
3.2 CHOSeN RF Interface ............................................................................................................... 6
4 Middleware Software...................................................................................................................6
4.1 Program Core.................................................................................................................................. 6
4.2 FAT Driver.......................................................................................................................................... 6
4.3 Ethernet Bridge to Aeronautics Application Software .............................. 6
4.4 Graceful Reboot ............................................................................................................................ 7
4.5 BASIC Interpreter....................................................................................................................... 8
4.6 Web Server ....................................................................................................................................... 8
4.7 Subscription Management & QoS Control................................................................ 9
5 Distributed Middleware..............................................................................................................9
5.1 Distributed Command Protocol ........................................................................................ 9
6 Conclusion.....................................................................................................................................11
1 Abstract
This report describes the current implementation and integration status of the CHOSeN
Middleware Application for the system prototype. The task of the middleware is partitioned into
special hardware (the Middleware Node), Middleware Software (on the Middleware Node) and
Distributed Middleware (on all CHOSeN Nodes). This concept is further explained in the next
chapter.
The first part focuses on the Middleware Node, which provides gateway functionality between
the onboard networks in the aeronautic and automotive domain and the CHOSeN network. In
addition it is host to the central part of the Middleware software, which is responsible for data
stream management. The second part describes all software modules of the Middleware and
Distributed Software that were already implemented on the hardware. Most of these modules
are drivers for the hardware interfaces and network protocols. The last chapter delivers an
overview on the implemented part of the Distributed Command Protocol. This protocol is used
for communication between the Middleware Node and the Distributed Middleware.
2 Concepts
This chapter will give a short overview on the concepts of the CHOSeN Middleware Application
and protocols. As depicted in Figure 1, the middleware solution for the CHOSeN project is a
distributed embedded software/hardware application running on dedicated node extensions.
The middleware application is distributed over these middleware nodes, but is also distributed
to the wireless sensor nodes where smaller code-portions implement the necessary operations
for the middleware application.
The middleware nodes will interface with the wireless sensor network under development within
the project, as well as the preexisting vehicle communication systems of the respective
industrial partner. In this fashion they also serve as network bridges within the automobile,
allowing seamless communication between the different modules of the CHOSeN aeronautic
and automotive applications. For more details, please refer to the complete specification in the
CHOSeN Deliverable 2.4 Software and Middleware System Integration.
The middleware platform is present in several instances per demonstrator, where each
middleware node represents the bridge between a wireless sensor node cluster and the system
bus, and also a distributed instance of the middleware software. Of these instances, one of
these boards will provide access to the CRF ALIX processing board which does not interface
with the bus, but only has access to the system through a middleware node directly. This
connection is implemented serially and bridges packets in a proprietary CHOSeN data format.
The middleware communicates with a wireless cluster using a chosen receiver which is
connected to the board serially over UART. The transceiver functions as the cluster head for
the cluster and dictates the network parameters based on input from the middleware. For this
reason two separate communication interfaces are necessary over the serial line, one for
forwarding data packets in both directions and another for configuring the wireless
communication stack using the configuration interface on the node (See Deliverable 2.4
Software and Middleware System Integration for more information).
Finally, these middleware nodes provide an interface to the on-board bus systems of the two
demonstrators. Although these are shown as being a single unit in Figure 2, they are actually
two separate hardware modules, one for each of the buses respectively. Each bus interface is
also supported by a software driver, providing a layer of abstraction to the middleware over a
bus-independent interface.
and the configuration of the lower communication layers. For this purpose, the Distributed
Middleware will exchange information with the main middleware service using the wireless
network and proprietary communication protocol. Therefore only the generic UART interface
driver is needed for communication with and over the CHOSeN Transceiver.
3 Hardware Reference
This chapter will give a short overview on the hardware platform used for the central
middleware nodes. The nodes will host the Middleware Software Application and provide
gateway functionality between the CHOSeN RF Network and the network to the central
processing unit in the plane and the car respectively.
The specific drivers needed for all parts of the board have been implemented for the current
version of the hardware. Further work will focus on the integration of the new RF frontend and
the addition of a CAN Interface for automotive application.
4 Middleware Software
The Middleware Software running on the middleware node is based on different distinct
modules, grouped around the main program core. The functionality of the core modules is
described in the next chapters.
The user defined interrupt handling functions are also found in this code, the processor
supports prioritized interrupts, with either high or low priorities. The interrupt handling functions
for both interrupt priorities analyze the interrupt to determine its origin before passing execution
to the specific modules needed to process that interrupt.
General hardware initialization occurs before the main loop within the main program code. The
software-programmable oscillator is set to 41.666667MHz. Global variables are also initialized,
and hardware modules are configured.
The file system provides easy access to a persistent storage, which is especially needed for the
web server described in chapter 4.6. Apart from that, the SD card can also be used as
intermediate buffer for all data that cannot be delivered immediately.
Microchip. The stack is essentially the heart of the bridge between the CHOSeN middleware
node and the aircraft application software based on AFDX. To reduce the size of the binary
loaded onto the PIC32 only the features described in the following list, are compiled in. The full
feature list is available on the Microchip website.
PHY&MAC:
The lowest two layers (ISO/OSI layers 1 and 2) of the network stack provide Ethernet
according to IEEE 802.3. In the current configuration of the gateway, these layers are
provided by the ENC28J60 Ethernet controller instead of software running on the PIC32MX.
The node offers a Client API for different interfaces to the interpreter. All commands that cannot
be handled locally by the client are sent to the gateway. The API is defined by a set of Common
Gateway Interface (CGI) files on the web server. Clients can issue HTTP POST requests to the
web server to send data to it and affect its internal state, whereby the Uniform Resource
Locator (URL) in each request has to point to the proper CGI handler file for the request. Any
data given to the web server have to be properly encoded as parameters in the POST request
according to HTTP. The bridge acts as requested in the following and afterwards sends any
output data back via an HTTP response. For simplicity and runtime performance, the
interpreter's output data is handed back in plain format instead of facilitating a data description
language, e.g. XML, JSON or YAML. The client may also issue HTTP GET requests to the
Client API to only retrieve a resource specified by the included URL. With regard to the POST
and GET request semantics, the Client API conforms to REST semantics put on top of HTTP.
When abstracting from the HTTP-based Client API to web services, this concept is commonly
called RESTful Web Services.
console is implemented in a single-threaded Java Applet which connects to the bridge via
HTTP on top of TCP/IP. This means that client and bridge can be remotely connected when
both parties have access (either direct or indirect, e.g. via Network Address Translation
(NAT), a proxy or a Virtual Private Network (VPN) solution) to the Internet. The user interface
of the console is depicted in Figure 6.
The BASICs console's core is a parser based on the JavaCC parser generator which
analyses console input based on a context-free grammar. The console supports issuing of
single statements or a complete BASIC program which is kept in local memory of the applet.
Programs are immediately launched after transmission to the CHOSeN gateway and are
subsequently executed until they terminate. Any output of the interpreter is immediately
transferred back to the console and displayed on the user interface.
These services provided by the middleware, as defined in CHOSeN Deliverable 2.4, are
currently in testing state. The next step will be the implementation and integration into the given
platform.
5 Distributed Middleware
The Distributed Middleware will run on the sensor nodes in the network and will communicate
with the central portion of the software to manage the subscription and publication of the sensor
values, as well as the optimization of the network parameters. Therefore a specialized
command protocol is needed for communication between the two software parts.
The tuples specified above are composed to messages. Their order is not fixed, exept for the
message type which should go first in the set. In general all tuples can be used in all message
types, although they may have different meanings depending on the source. This includes the
possibility that a piece of data can be ignored if there is no behavior defined.
6 Conclusion
This document provided a functional overview and a status report on the implementation of the
Middleware and its three major components. These are the special hardware (the Middleware
Node), the Middleware Software (on the Middleware Node) and the Distributed Middleware (on
all CHOSeN Nodes).
So far the hardware for the Middlware Node is almost finished concerning the essential parts
and the overall layout. These are the central processing unit, Ethernet and wireless network
interfaces, mass storage and power supply. The next revision will only add minor points,
including connectors for the platform specific communication busses. This will also influence the
further development of the firmware running on this node, called the Middleware Software. The
current implementation includes drivers for all peripherals on the board, as well as a web server
for HTTP communication and debugging. Mass storage is also included via file system drivers
for the microSD-card interface. The counterpart to the central Middleware Software is the
Distributed Middleware installed on all nodes in the network. A specialized Distributed
Command Protocol was designed and implemented. The protocol is used to disseminate the
network and node status information in the network, as well as issuing commands to the
Distributed Middleware. The details for the different parts can be found in the corresponding
chapters of this document. Further information on the overall concept is described in the
associated deliverables of the CHOSeN Project.