Buzz about IoT
Technology is evolving everyday. Businesses are throwing challenges on technology and now technology is also challenging businesses in different ways.These days one can hear lots of buzz words like Cloud, Cloud Foundry, Cloud Platform, Industry 4.0, SAP IoT, Machine Learning, Artificial Intelligence, SAP Leonardo, SAP Co-pilot, SAP chatbot etc. All these buzz words are music to some people’s ears but there are still some people who are trying to connect dots and trying to understand how all these fit in context with SAP.
In this blog I would like to pick up one of those words which is SAP IoT and will try to put some context around it. I am sure most of people have heard word IoT in one way or another. If you end up on this blog while your search there is a big chance you were searching for SAP + IoT or something along same lines.
IoT stands for ‘Internet of Things’. To familiarize yourself with general concept you can search internet for this term or for a quick read you can refer to Wikipedia about IoT.
SAP has provided with plenty of information on SAP IoT. Here on SAP blogs site you can read numerous blogs to get yourself familiarize with SAP IoT concept and some fantastic ideas around SAP IoT.
How about SAP IoT without SAP IoT Platform??!!!
Although SAP IoT platform provides comprehensive sets of tools to get you up and running with your business specific scenarios but WHAT IF:
- It’s too expensive to use SAP IoT Platform
- The business case for SAP IoT is too small
- Business needs to evaluate IoT options with existing SAP infrastructure
The answer to WHAT IF in all above cases along with numerous other cases where you would want to take small steps towards the world of IoT lies in your core SAP ECC on-premise system. Yes you can utilize your current SAP ECC system and mimic some of IoT functions.In SAP Application Server ABAP 7.40 Support Package 05 a new concept was introduced via infrastructure for event based communication. The new concept is called ABAP channels created in SAP NetWeaver Application Server ABAP. Now with SAP Netweaver Application Server ABAP 7.51 there is improved support of Industrial IoT scenarios. You can see SAP official roadmap for SAP Netweaver Appliacation Server ABAP which talks about industrial IoT with ABAP channels.
A. Simple Example of Temperature Sensor WITH SAP IoT Platform
There are numerous blogs available on this simple example case for SAP IoT. If you are SAP Developer/Architect/Consultant and would like to try your hands on following are pre-requisties:
Internet of Things Service in SAP Cloud Platform
Before you can use SAP Cloud Platform Internet of Things you have to enable it in your SAP Cloud Platform Cockpit.
In your SAP Cloud Platform Cockpit navigate to “Services” section and click on “Internet of Things” tile.Please click on ‘Enable’ if it’s not already ‘enabled’.
For next step please click on “Go to Service” .
Internet of Things Cockpit
The following steps in internet of things cockpit will show you how to create a Device Type and Message Types associated with it as well as a Device instance. In below screen-shot you can see I have one message type, one device type and one device registered.
Create Message Type
Click on Message Types tile in your Internet of Things Cockpit.
Click on the + button and this will open screen to create new message type.
I have created following message type with field name as temperature.
- temperature : float
Please make note of the Message ID. We will need that later
Create New Device Type
Please click on Device Types tile in your Internet of Things Cockpit.
Please click on + button to add a new device type.
On screen add following data:
- Enter the Name “TemperatureSensor”
- Choose the message type you just created
- Choose the message direction “Bidirectional”
Create New Device
Click on Devices tile in your Internet of Things Cockpit.
Click on the + button to add a new device.
Please fill in following information on the screen-shown
- Enter a Name
- Choose the device type you just created
Please make a note of the Device ID. We will need that later.
Deploy the Message Management Service (MMS)
The deployment of the Message Management Service (MMS) is done from the “Deploy Message Management Service” tile in the Internet of Things Cockpit.
You need to assign Role IoT-MMS-User for the newly deployed iotmms Application (otherwise you will be denied access to the iotmms Application URL with an HTTP Status 403 Error). To do so:
- In your SAP Cloud Platform Cockpit go to JAVA applications
- Choose the iotmms application
- Choose the Security tab of the Application details and then select Roles
Do the assignment of the role to your user.
Once MMS is deployed and you have correctly done role assignment you can click on the iotmms Java application URL in your SAP Cloud Platform Cockpit and get to the MMS Cockpit as shown below. It provides access to the MMS API as well as a “Display stored messages” tile for the access to data received from IoT Devices.
Configure the Message Management Service
I will be publishing data via MQTT over TCP. I am using public and free MQTT provider iot.eclipse.org, you can use any other MQTT provider if you like.
To store data being provided by MQTT provider, we must also connect the MMS service to the MQTT broker.
Click on “Configuration the Message Management Service” tile:
- Enter the MQTT Broker Endpoint, for my application I have entered tcp://iot.eclipse.org:1883
- Enable the MQTT Connection
- Enter the Password: sapcloud
- Enter the User Name: sapcloud
Click on “Messaging through MQTT over TCP” tile.
Enter the Device ID and click Connect. To publish the message please use the message type id which in my case was id associated with mqtt and compose message as following:
I have send 10 different temperature readings one by one by changing temperature value. These temperature values are same which I used in my SAP ABAP channels application.
Output of Application
You can see output of this application by going to tile ‘All Registered Device’ from your Internet of Things Service Cockpit:
B. Simple Example of Temperature Sensor WITHOUT SAP IoT Platform
There are lots of really informative blogs available from Olga Dolinskaja for SAP Netweaver. I have followed following blog step by step which shows how to achieve same result as in above SAP IoT example WITHOUT SAP Cloud platform and using SAP ABAP channels.
Once you have followed all steps mentioned in Olga’s post you will end up with an SAPUI5 application which is also showing temperature sensor data on a graph.
I have followed steps from Olga’s post but to do that I needed access to SAP Netweaver AS 7.51 system. If you have access to system then it’s fine if not you can follow steps from Open SAP course ‘Extending SAP S/4HANA with SAP HANA Cloud Platform’ available at this link.
I am myself not a basis person but the steps to install your own SAP Netweaver AS ABAP 7.51 innovation package defined in above mentioned link are very detailed and straight forward. Once you have installed the system in virtual box, you will end up with a virtual machine box as below. However depending on when you decide to take snapshots of your virtual machine, your screen-shot may vary.
In below screen-shot you can see I have started my virtual machine.
Once you have finished up with Olga’s blog you can see SAPUI5 application installed on your own SAP Netweaver AS 7.51 system. Here is how my application looks like:
Time to launch your application and feed some data as mentioned in above blog. I have created a video recording which shows data being sent to UI5 application in real time:
As you compare result A and B, both graphs show temperature sensor data. We achieved Result A using SAP IoT Platform which uses MQTT over TCP to send signals to SAP Cloud platform and we achieved Result B using SAP ABAP Channels. Both results are same( graph looks almost similar ).
So, when you compare your approach to tackle IoT approach. Above evaluation can help you in taking up right approach. Few examples where you can use SAP ABAP channels :
- Collecting data from hardware devices such as RFID scanner, warehouse equipment which are equipped with IoT sensors can send data to SAP ECC system over ABAP channels and can provide you with a quick way of achieving a real team UI application running on your SAP ECC system
- A stock inventory scenario where multiple users work with same set of data i.e stock levels, This scenario can be made more efficient with use of IoT sensors and SAP ABAP channels
- Manufacturing industry where multiple conveyor belts are running. Having IoT sensors on conveyor belts and with SAP ABAP channels can provide real time insights to UI applications and so on.