New and Noteworthy in SiteWhere Community Edition 1.0.1

//New and Noteworthy in SiteWhere Community Edition 1.0.1

New and Noteworthy in SiteWhere Community Edition 1.0.1

SiteWhere 1.0.1 introduces many new features as well as improvements to the existing functionality. A few of the key features are discussed below.

Batch Operations

In previous versions of SiteWhere, the only method for sending commands to multiple devices was to manually create a command invocation for each device. SiteWhere 1.0.1 introduces the concept of batch operations which enable actions to target many devices at the same time. When a batch operation is submitted to the batch operation manager, an entry is created for each device and the manager proceeds to execute the desired action on each of them. The REST APIs allow the status of each operation element to be tracked, allowing for progress monitoring. Since an operation may affect millions of devices, the default batch operation manager also allows for throttling the events created by batch operations so that system traffic is not spiked when an operation is executing. For more information on batch operations, see the documentation.

The first functionality using the new batch operation APIs is for invoking commands in batch. Commands can be sent to many devices at once as long as all devices use the same device specification. Batch command invocations are supported both in the REST APIs and via the administrative console. To execute a batch command in the console, apply a device specification filter to the device list and a Batch Command button will appear in the tool bar. Click on the button and fill in command details exactly as if targeting a single device. The command will be issued to all of the devices that meet the given criteria. See the Device Filter Criteria section below to learn more about choosing which devices are targeted.

More types of batch operations are on the drawing board for future versions of SiteWhere. In particular, batch firmware updates are a common request from our users and will soon be on the roadmap.

Device Filter Criteria

Since SiteWhere is capable of managing thousands or even millions of devices, it is important to be able to filter the list of devices to find ones that meet certain criteria. SiteWhere 1.0.1 introduces advanced device filtering so that users can find devices they are interested in. This is particularly important for batch operations since a user must be able to choose the list of devices to target for an operation.

Examples of the new criteria include:

  • Including devices that implement a given device specification
  • Including devices that belong to a device group
  • Including devices that were added to the system in a given time period
  • Including devices that are not assigned to an asset

The filter criteria can be combined for queries such as ‘List all devices of specification Android that belong to the group employee tablets which were added to the system in the last week and have not been assigned to an employee’. The resulting list can be used to issue a batch command that affects all of the matching devices. For a more complete discussion of device filter criteria, see the documentation.

Simpler Device Command Implementation for Android Devices

Previously, commands sent to Java-capable platforms such as Android had to be encoded using a protocol such as Google Protocol Buffers. This imposed a requirement that adding a command to the device specification also required adding unmarshaling code on the device. SiteWhere 1.0.1 now supports dynamic commands for Java devices. The command name and parameters assigned in the device specification are used to infer a corresponding method to execute on the device implementation. The previous workflow was:

  • Copy updated proto from device specification into device project
  • Generate Java code from updated proto
  • Add unmarshal code that uses the generated Java code
  • Invoke method that executes command logic

The new workflow is:

  • Add method with name and parameters that match device specification and execute command logic within the method.

To use the new encoding scheme, the should be used on your command destination. Also, for Android, a separate sample project has been added to illustrate the new functionality.


The SiteWhere Team

By | 2017-10-17T22:09:26+00:00 June 1st, 2015|Developer Blog|0 Comments