the bridge from devices to applications

M2MLabs Mainspring is an open source application framework for building machine to machine (M2M) applications such as remote monitoring, fleet management or smart grid.

It covers common functionalities required by M2M applications

  • flexible modeling of devices, their parts and their characteristics: devices represent a physical device and contains sensors and actors. Each sensor has a set of attributes which correspond to the data sent by the sensor, e.g. temperature sensor may send an indoor and an outdoor attribute. Data for each attribute is time stamped so that one value represents a mesurement at a certain point in time.
  • device configuration: each device holds a set of key-value pairs representing the configuration of the device, e.g. sensor ranges or metadata such as units of measurement for a device
  • communication between device and application: devices send data according to a defined REST webservice, see the Api description. This is fine if the device is developed together with the application. If the device is not modifiable and sends data via arbitrary HTTP GET or POST messages an adaptation script in Groovy translates the message to the standard format.
  • validation and normalization of the data: reception of new data triggers the execution of Groovy scripts to perform boundary checking of data, interpolation or threshold supervision.
  • long term storage of data sent by devices: all measurements are stored as time series of values in a very compact format with minimum overhead. Meta information such as units of measurements are stored seperately in the device and sensor models.
  • data retrieval functions for external applications using REST Api: give the business logic access to the data. Each access provides a set of values for a set of entities and a time interval.

The framework  is written in Java and runs on a standard J2EE6 application servers like glassfish 3.1 and JBoss 6.0. Data storage is provided by the extremely scaleable noSQL database from the Apache Cassandra project.