Technical Articles
Build IoT Applications using WebIDE
UPDATE 12-Feb-2019: HAT will no longer support the functionality described in this blog. There is now an alternative feature in SAP Web IDE Full-Stack called “IoT Enablement”. You can refer to the blog post here: https://blogs.sap.com/2018/01/15/how-to-build-an-iot-app-on-top-of-sap-cloud-platform-iot-application-enablement/
Few weeks back Hybrid Application Toolkit (HAT) version 1.16 was released. This comes with an experimental feature around the Internet of Things. This is currently available only in trial SAP Web IDE instances.
I think it’s a great step in simplifying the consumption of IoT services for developers within Web IDE. We no longer need to switch to IoT service cockpit to manage devices and message types. Everything can be done within your Web IDE.
Ensure that you have enabled the Internet of Things service.
From the IoT service cockpit, create a device type, message type and device.
In the HCP Destinations, add the below two destinations.
URL : https://iotmms<account>trial.hanatrial.ondemand.com/com.sap.iotservices.mms/v1/api/http/
URL: https://iotrdmsiotservices-<account>trial.hanatrial.ondemand.com/com.sap.iotservices.dms/api/
Launch SAP Web IDE and enable the HAT plugin. You will be able to see “SAP HANA Cloud Platform Services” under tools menu.
The system will give you a screen which helps you to manage Device, Device Types and Message types. In the below screen, it shows the existing device type and device created earlier in the IoT service cockpit.
You can add more device types and message types directly from this screen without the need to switch to the IoT service cockpit.
To be able to invoke APIs related to IoT services, right-click on the project and click on “Inject Internet of Things API library”.
The system will generate IOT.js file. You can change the namespace and adapt the code if required.
There are several APIs which have been made available to directly interact with the IoT services. You will be able to find the list of APIs in SAP Help. Go ahead and start consuming IoT services within Web IDE using the above steps.
Another nice one to try! Thanks for all your contributions.
Great blog, thank you.
It seems that you're pretty experienced with HAT 🙂 We've noticed that getting it running and general configuration has been a pain point for a number of users - are you aware of a blog that touches on that?
Thanks Colin,
I agree with you. It took me also couple of hours to get HAT working on my laptop. I am waiting for HAT to be integrated into WebIDE as Cloud Build option.
Please use this blog on how to install & use HAT. BTW, I am no expert on HAT.
Thanks.,
Murali
Awesome, thank you for the resources.
Colin
Hi Murali,
Do you know how to install HAT for webIDE Hana Trail Account ?
stuck at step 3.
BR
Sorry my bad, Got it.
webide->tools->prefferences->plugins->HAT 🙂
cheers,
K
Hi Murali,
My requirement here is converting a IoT application as Hybrid App.
I have consumed all the IoT services and the IoT app is working fine, but now I want it as a Hybrid App.
Could you please help me on this.
Regards,
Mohana
8123263129
Hi Murali,
My requirement here is, I have a IoT application configured with IoT services and there are certain s/4 services also which I'm using it in IoT application. But when I deploy my IoT application to cloud foundry the s/4 services are not getting loaded.
Could you please help me on this.
And also the IoT application has to be converted as Hybrid App. But I'm unable to find the App configuration in Hybrid App Toolkit extension.
Regards,
Mohana