The Internet Of Things (IoT) and the SAP Cloud Platform
The internet has revolutionised almost every aspect of modern life, from the way we work to the way we socialise. This, along with many other supporting technologies, has caused massive shifts in how work is conducted and massively increased productivity in a large number of sectors. The internet of things (IoT) is an extension of this process. The internet of things refers to the connection of small low power devices and machines to the internet. These devices could include things like industrial machinery, sensors and smart home devices. In order to leverage the information generated by these devices, data collected by the devices is sent to a centralized location such a company server or a cloud company server such at the SAP Cloud Platform. It’s the job of the cloud platform to collate and analyse the information received from the IoT devices and extract useful information from the data.
The SAP Cloud platform in particular has the vast majority functionality of a cloud platform implemented and this allows developers to quickly deploy a wide variety of IoT applications in a timely fashion. The platform also has built into it analytical tools that make it easy for IoT developers to quickly and efficiently analyse the data they have received from the IoT devices. The platform also allows the extracted information to be forwarded to many other external web services such as social media websites, web applications and mobile applications. The collated data can also be used as input to machine learning algorithms for predictive analysis in a wide variety of applications. A diagram showing how IoT devices can be used together with the SAP platform can be seen in figure 1.
The SAP cloud platform has a wide range of very useful features that help developers build and deploy polished state-of-the-art IoT in a timely manner. These include among other things real- time IoT monitoring, real-time automation and also real-time data processing. These features help business leverage the power of the internet of things in their business in order to increase productivity in the workplace. A IoT-SAP solution can be used, for instance, to monitor industrial sensors in real-time and alert managers to any issues that may arise. This reduces business costs and increases workplace productivity.
SAP can also be used in an IoT setting as a base platform for the coordination and control of remotely located IoT devices which could include lighting, heating and air conditioning, media and security systems. This type of use of an IoT cloud platform is applicable to a wide of emerging IoT application areas such as in automated smart homes, smart cars and real-time wireless sensor networking. The architecture of a full IoT solution is shown in figure 2. The core of an IoT system in a network of small wireless enabled network devices such as wireless sensor network devices, smart home or instrumentation devices. These devices communicate wirelessly to a gateway using a wide variety of underlying radio standards such as 802.15.4 or 802.11 and using embedded net- work stacks.
The protocols that manage this communication are protocols such as MQTT and REST. These protocols just specify the format that messages send back and forth between IoT devices and IoT gateways should be. After data reaches the IoT gateway it is forwarded to a remotely located computer called the cloud server. The server can run the SAP cloud platform and thus provide analysis using the inbuilt SAP Cloud platform analytics tools using the SAP core application programming interfaces (API). The SAP Cloud platform then allows this information to be visualised in a manner which is easily understood by an IoT administrator and then displays this information to the IoT administrator. The formulation of the architecture such as the one detailed above yields a full, highly capable, IoT application which can be used in a wide variety of use cases.
Figure 1: Overview IoT System using SAP Cloud Platform
In SAP, IoT devices are managed via a IoT cockpit which is provided as part of the SAP Leonardo toolset. The SAP Leonardo toolset also provides many other function related to other analytical domains such as machine learning based analytical tools. The IoT cockpit is the central management centre for IoT in SAP and is the main user interface for users to interact with SAP IoT. It is from the IoT cockpit that we add and manage i) users and tenants, ii) IoT components and iii) IoT device security. The manner in which data is delivered from the IoT devices to the IoT cockpit can be via IoT gateway device. So ordinarily all IoT devices communicate with the IoT gateway device and IoT gateway device then communicates with the SAP Platform. In the SAP platform you will have IoT services activated and can appropriately log, analyse and display the data as required.
Figure 2: Architecture IoT System using SAP Cloud Platform
In order to manage an IoT network, one has to first create a tenant in the IoT cockpit. After creating a tenant on the IoT cockpit, gateways can be added to that tenant and for each gateway, several IoT devices can be authorised to communicate with that gateway. A certificate can also be generated and used for end-to-end authentication. Everything is done via a The IoT devices can be any sensor device as long as it communicates using a standard protocol such as MQTT. The general flow is data is from left to right in figure 2, so an IoT device communicates with a gateway via a protocol such as MQTT and the gateway forwards that information via the internet to the SAP Cloud Platform. When that information reaches the SAP Cloud Platform there must be logic created to instruct the SAP IoT platform on how it should deal with that data. This can be done with the IoT cockpit by attaching a service to the data stream. Visualizations can also be seen by clicking on the data visualization tab in under the device sub menu.
At this stage the data can be forwarded out of the SAP platform to some external application, or if a valid subscription is held for a required SAP application/service then the data can be forward for further processing by that SAP application or service. This could be via other services included in SAP Leonardo such as machine learning analytics or by some other analytical service offered by the SAP suite.
In addition to managing devices and specifying settings in the IoT cockpit, a developer can re- motely configure and manage IoT devices programmatically from a remote location using the device management application processing interface (API) and the message processing API. Each one of these APIs is made up several valid REST commands that perform a wide variety of operations such as adding and/or removing capabilities, adding and/or removing devices e.t.c. Details on the list of valid API commands can be seen by under the useful links section of the IoT cockpit. The availability of a Restful API to control and manage an IoT network means that a user does not necessarily have to use the IoT cockpit to monitor and control an IoT application.
Using the RESTful API tools an end user application, such as a mobile phone iOS or android application, can be developed that uses the API to indirectly control and manage the IoT plat- form. The mobile application would send instructions to the SAP Cloud platform over HTTP by making REST API calls. The SAP IoT system would then execute the instructions and then return the corresponding result to the mobile application. The SAP Leonardo platform and the management API can thus be used in this fashion to enable the instrumentation and control of a deployed IoT solution remotely. The application that is used to remotely control the IoT system can be designed using the SAP Web IDE and deployed as a web-based application or an application that is integrated into the SAP web platform.
The SAP Web stack is a set of tools included in the SAP cloud platform that aid in the development of consumer grade web and desktop applications that depend on the SAP cloud tools. The SAP Web stack can be used to design and deploy a web application that works with the SAP Leonardo platform to monitor and control an IoT system. The IoT system would communicate with the SAP platform via the MQTT gateway as usual, and the gateway would then forward the information to the SAP Leonardo cloud platform. The SAP Cloud platform would then forward information to the web application which could, for example, be integrated into a client’s website.
In order to design a web application for the SAP Leonardo platform using the SAP Web Stack tools, a user first needs to navigate to the Web Stack IDE webpage and then click on preferences. After this the user then selects the features tab and then enables the IoT application enablement feature. It is the IoT enablement feature that will allow us to setup the SAP Web application to interface with the SAP Leonardo IoT tools. After enabling the IoT enablement feature, select the option to create a new SAP application from template and pick the template as freestyle IoT application. The freestyle IoT application template will provide a template upon which an SAP IoT application can be built upon. The user interface of the application can be designed in an easy graphical way by dragging and dropping various widgets into the application layout.
In order for an application user to be notified of significant changes in the IoT system alerts can be set to be raised when particular events occur. This could be when particular sensor values pass some threshold or when certain analytic outputs report unexpected outputs. An alert could for instance be sent to a mobile application from the SAP Leonardo platform if the temperate sensed by a group of sensors surpasses a particular value. In order to enable this behaviour, actions have to be enabled for particular events of interest from within the SAP application designer. This can be done by setting the appropriate options from within the thing modeller section of the designer.
In summary setting up an IoT network in the SAP IoT platform follows the following steps
- Set-Up a SAP Account and Open the IoT Cockpit
- Add a User (or users) to the Cockpit and for each user add a Tenant (or tenants)
- Add Devices to each Tenant(s) and for each Device add Capabilities (capabilities are different sensor types) and certificates
- Set-Up the physical IoT network and set it up to route sensed packets to an SAP IoT Gateway via a supported protocol such as MQTT over IP
- The IoT device has to have sensors that correspond to the capabilities that have been set-up in the IoT cockpit
- After the data connection has been set-up, data received from the network can be forwarded elsewhere, visualized in the IoT cockpit or forwarded to be used as input in another SAP service upon which the user has a subscription.