Try out the SAP Cloud Platform Internet of Things
What do you need to try out the Internet of Things (IoT Service)?
You need a free SAP Cloud Platform developer account (trial instance): Signing Up for a Developer Account.
Note: We recommend that you use the Firefox or Chrome Web Browser.
How to Subscribe to the IoT Service?
Enabling the IoT service
- Log on the SAP Cloud Platform cockpit:
- Access for trial accounts: https://account.hanatrial.ondemand.com/cockpit.
- Access for productive accounts: https://account.hana.ondemand.com/cockpit.
- Go to the Services tab.
- Select the Internet of Things Service entry.
- A subscription of the IoT Service will be automatically assigned to your account. This subscription includes Remote Device Management Service (including IoT Cockpit) and Message Management Service capabilities.
- The “IoT-User” role is automatically assigned to your user. The role is required to access the Internet of Things Services Cockpit.
Further documentation: https://help.hana.ondemand.com/iot > Getting Started > Enabling the Internet of Things Services
How to Get Started?
Accessing the IoT service cockpit
The Internet of Things services Cockpit allows you to register devices in a secure manner. Every device must have a certain device type which is specified by its supported message types. You can define both types in the IoT Cockpit as well.
- Choose Go to Service for the Internet of Things services subscription.
- The Internet of Things Service Cockpit is displayed.
Deploying Message Management Service
The deployment of the Message Management Service (MMS) is necessary to be able to send data from a device to your consumer account.
- Go to the Internet of Things Service Cockpit.
- Choose the Deploy Message Management Service tile which opens the MMS deployment tooling.
- Fill in the target consumer Account ID (pre-filled) from the SAP Cloud Platform Cockpit, and enter your User Name (pre-filled) and Password.
Further documentation: https://help.hana.ondemand.com/iot > Getting Started > Deploying the Message Management Service (MMS)
You can now start creating Message Types, Device Types and Devices in the Internet of Things Services Cockpit and send data from a device. The following section describes an example.
How to connect my first device?
The Starter Kit for the SAP Cloud Platform IoT Services includes a documentation, and code snippets, which provide a complete end-to-end example of how to use the IoT services. You will learn how to enable the services as well as how to send messages and how to receive push messages. Moreover, a sample data consumption UI is provided. Further tutorials and blogs can be found on our SAP Cloud Platform IoT Service Jump Page.
Questions and Feedback?
We highly appreciate your questions or feedback. Please add your comments below. Furthermore we have a section FAQ in the documentation with a collection of frequently asked questions and provided solutions.
Additionally, you can keep yourself up to date by visiting the Release Notes page for the SAP HANA Cloud Platform, Internet of Things services regularly.
Hello,
I am trying IoT on HCP but I have some problems:
-> I do not have the java application IotRDMS in the java applications dashboard. I have only the IoTservices IoTcockpit application
-> When I try to deploy MMS, I have a message 409 or 403 when I enter my credentials.
Could you help me ?
Best regards
Emmanuel
Dear Emmanuel,
can you check if you have stopped any existing JAVA application which is running in your trial account . and once the iotmms is running do not forget to assign role to your user.
SAP HANA Cloud Platform Internet of Things (IoT) Services (BETA)
I stopped my running JAVA application and tried and it worked fine for me .,
Regards
Arun
Thanks Arun.
I have stopped all the Java and HTML5 apps, but I have the following error:
409 Conflict Unexpected application status UNKNOWN
Please find below my subscribed applications
Regards
It's done.
It seems I had a problem with my credentials.
Thanks for help.
Hi,
is it possible to analyse the incoming data directly?
E.g. if the temperature is to high -> send an service technican
Or is it necessary to poll the data with an external application and trigger events from outside?
Can i see the sources somewhere?
Regards
Tobias
Hi Tobias,
Currently you need to work on the data directly. An example how to consume the data is described in the Starter Kit for the SAP HANA Cloud Platform Internet of Things (IoT) Services. There you will find even a sample Java Application for the consumption of the acquired data (Basic Consumption and User Interface Alternatives).
Best regards,
Michael
Hi Michael,
Good blog: Thank you.
I have problems with github part. I do not know how to implement the chapter " Code snippets for IoT Devices" with Python files.
Is there any place where I could find more detailed instruction how to cope with github and the files? A kind of step-by-step instruction.
Best regards
Beata
Hello Beata,
You can use your web browser to go to the GitHub pages at SAP/iot-starterkit · GitHub. If you are not familiar with a git IDE or command line client - you may either want to use the "Download ZIP" button for the whole repository content or follow the links (starting with src) in the upper section till you finally reach the code snippets or the 2 .py files (program and config) of an integrated example.
In addition to code for a Raspberry Pi there is an integrated example (simulating an IoT Device) for usage on your PC or Mac that you may want to start with. To use it, just install Python (e.g. from Welcome to Python.org) and urllib3 (e.g. with the pip package manager that comes with the Python installation: pip install urllib3).
The integrated example (that makes use of the listed code snippets) shows you how the APIs for interacting with the HCP IoT Services are used. If you are more comfortable with e.g. Java, just have a look at which GET / POST requests via https are made - and do the same with Java. Hope that helps.
best regards and feel free to get back to us with further questions or feedback
Ralf
Hi Ralf,
Thank you for the suggestions. I will try them. In case I still have problems, I will get back.
Best regards
Beata
Hi,
As you mentioned above I successfully installed Message management Service and assigned role to user.
Successfully installed Message management service like below.
Assigned IoT-User Role to User like below.
Similarly I assigned IoT-MMS-User role to the user like below.
But when I am accessing the Java application I am getting the below error message.
HTTP Status 403 - Access to the requested resource has been denied
Can anyone please help.
Regards
Sridevi
Hi Sridevi,
I think you have to give your user id instead of demouser. Try this.
Regards,
Prashanth
Hi Prashanth,
Thanks for your quick reply.
I tried with User ID. It's working fine.
Thank You.
Regards
Sridevi
Hi Prashanth,
I am facing the same issue. I have tried giving my User ID, but still the error persists.
"Access to the requested resource is forbidden (HTTP 403)."
Any suggestions ?
Regards,
Venkatesh.
Hello Venkatesh,
please ensure about two points:
- (if you are on Trial) you have assigned your user ID 'pXXX' to IoT-User role and not your account ID 'pXXXtrial'
- you start with a new browser session (role assignment takes an effect with new session only)
Regards,
Anton
Hi Anton,
Thanks.
The second point worked.
Regards,
Venkatesh.
Hi Anton,
In the code snippet insert.py, how do I specify the device ID ? I have never done this. Could you please help ?
Regards,
Venkatesh.
Unless you are asking for clarification/correction of some part of the Blog or Document, please create a new thread by "Asking a Question". The Comments section of a Blog (or Document) is not the right vehicle for asking questions as the results are not easily searchable. Once your issue is solved, a Discussion with the solution (and marked with Correct Answer) makes the results visible to others experiencing a similar problem. If a Blog or Document is related, put in a link to it in the Discussion. Read the rules of engagements http://go.sap.com/community/about/rules-of-engagement.html
Regards,
Anton (Moderator)
P.S. https://github.com/SAP/iot-starterkit/blob/master/src/code-snippets/python/hcp-iot-services/https/insert.py -> line #19 -> Device ID is a part of the URL
I'm sorry about this.
Regards,
Venkatesh.
Hi All,
I was able to configure all details. Unfortunately when I want to simulate the device via the iot_starterkit_desktop.py I receive the following error:
"Problem decoding the message {"msg":"Error. Device 0d8ef208-823a-4a45-8b3a-b6bf9
2c6f4d7 not found in registry."} retrieved with poll_from_hcp()! Can and will co
ntinue though."
I checked the device ID as well as the OAUTH token several times. I even recreated another device. Unfortunately it does not work either. Can anybody help??
Thanks and best regards
Helmut
Hello Helmut,
can you please print out the raw message that causes this (by adding a print statement in the Python code).
This happens in the "poll for messages that may have been pushed to the device" part - that starts immediately with the program start - when there have been no such pushed messages yet and there has been no "upstream" data POST yet. Please
and check whether the "warning" disappears. The root cause for it will be fixed.
Hi Ralf,
thank you so much for the immediate reply. I tried your proposed solution but the warning unfortunately does not disappear.
I'm not a Python guru but I found the print statement (actually there are a lot 🙂 ). The error message looks now like that:
"poll_from_hcp():404
Problem decoding the message {"msg":"Error. Device 5419f2ff-0e07-450e-9915-951f0
e9f4254 not found in registry."} retrieved with poll_from_hcp()! Can and will co
ntinue though."
Am I on the right paths?
Thanks and best regards
Helmut
Hi Helmut,
I had exactly the same problem. Cause was wrong entries in config.py for the message type ID's
It should be something like
message_type_id_From_device='1'
message_type_id_To_device='2'
Hope this helps
Peter
Hi,
I set up the application as explained on GitHub.
Yet, it seems the table used for storing messages (and which follows the naming conventiion T_IOT_<DeviceTypeID>_<MessageTypeID>) are not created.
Am I missing something?
Settings look OK
But no table...
Event though they do share the same schema
Thanks in advance.
Best regards,
Guillaume
Hello Guillaume,
a table T_IOT_<device_type_id>_<message_type_id> will be only created after you sent some data to MMS on behalf of the respective Device. You may use the sample HTTP client available in MMS or a python script from the Starter Kit, for example.
Hopefully, it helps.
Regards,
Anton
Hi Anton,
Thanks.
After a first attempt (RDMS needed to be synchronized?), the message went through.
Unfortunately, I was expected to see the result with a new table T_IOT_xxx but I can only see it (kind of "unprocessed") in the T_IOT_HTTP_PUSH table
Oups, didn't use the right "simple HTTP client"
And now the table is populated.
Works WAY better now.
Thx thx thx!
Hello Guillaume,
Can you give me the code ? I want to program a JAVA application with IOT service,but I can't understand the code from Github.
So,I want to refer to your code.Can you help me ?
Regards,
Brice
I'm trying to get this example running in node.js using the websocket node.js library.
I'm setting the OAuth token in the HTTP header:
Authorization: Bearer 94f41e9d281f50927d1aa7dfcff0569
Path is:
/com.sap.iotservices.mms/v1/api/ws/data/ab32a5b8-7497-493f-8f99-f55616263598
I've checked the device ID in the URL and the OAuth token is correct.
When it makes the request the server is returning HTTP 200 response with HTML body rather than the HTTP 101 response expected by websocket. The HTML response contains JavaScript code to post a form to accounts.sap.com. So it seems like the token is wrong or the header isn't sent correctly. I've tried making raw HTTP request to the websocket address and manually putting in the web socket headers and it's getting the same result.
I ran the Python websocket sample and I get the same result.
The same code going against HTTP instead of websocket works fine so the problem seems to be specific to websocket interface.
Hi Shing,
thanks for the hint. There was a bug we fixed in the current dev version already. The new release (1.1) will be available next week.
BR,
Thomas
Dear All,
I have an issue on the Rapsberry side. The only change I made in your code is about the sensor (I plug the temperature sensor).
I have an error message saying that urllib3 is not able to send the data in https.
It doesn't come form the network because I'm able to ping google from the raspberry but it could come from the last release of urllib3 (I saw some forum post about issues with HTTPS).
What do you think ?
Regards
Nicolas
Hello Nicolas,
let's check the connectivity first. Did you configure (in your config.py) a proxy or are you working without one?
You may also try to use wget or a browser to check whether you can access the service URL. This will give you an authorization error (because you don't use the OAuth token this way) - but at least you can check whether the target URL is reachable.
Finally, if you have a monitor connected to your Pi or login via ssh with X forwarding - you can also run the Python desktop simulator examples.
Feel free to get back to me if you keep stuck.
best regards
Ralf
You were right Ralf, it was a network issue. Thanks
Nicolas
Hi,
I am using SAP SSO and not sure about my trial account details. This is prohibiting me to deploy MMS, saying wrong credentials! How do i reset my account? Pleas help
Regards,
Saddy
Hi Sadanand, if you do not have or know your SCN password, please select "Cancel" when the client authentication pop-up window appears or use another browser (without certificates imported), this will show you a logon page where you can reset your password.
Regards,
Anton
Thanks Anton. Solved my problem
Saddy
I have written a python script for continuously polling the MMS for recieving input to device.
If polling occurs then the MMS stalls, that is the PUSH does not work at all.
I am using POSTMAN for testing the same.
Hi,
could you post (or email me) the name of your account and the name of your application ? Are you working on trial ? Maybe we can find out something scanning the log files ...
Thanks in advance,
Sven Horn
Hi,
Has anyone been able to use the Remote Device Management Service API as described in the documentation? I would like to register devices outside the cockpit as mentioned in the api it should be accessible through
<protocol>://<host>/com.sap.iotservices.dms/api/<entity>
However, all I get is service unavaialbe.
Regards,
Jose.
Hi Jose,
which URL exactly you try? It should be your tenant specific. I just checked the https://iotrdmsiotservices-<USER_ID>trial.hanatrial.ondemand.com/com.sap.iotservices.dms/api/devices (<USER_ID> is your P-user) and it worked.
Regards,
Anton
Hi Anton,
That worked!! I had the wrong url as you suggested, I had followed the one in the doc:
For getting the host you can replace "//iotcockpit..." with "//iotrdms..." of your iotcockpit URL
Thanks again,
Jose.
Since the api is updated the ulr is outadated. Use the url for new api:
https://iotrdmsiotservices<USER_ID>trial.hanatrial.ondemand.com/com.sap.iotservices.dms/v2/api/deviceTypes/
Hello,
I have some trouble accessing to my cockpit :
I have already setup devices and messages types and send some data to IoT Services. You can see the tables here ;
Since I send data to the services I cannot access anymore to the cockpit. The JavaScript error is :
Uncaught TypeError: Cannot read property 'length' of undefinedD
Any idea ?
Hi Joseph, can you pls try to clear the browser cache or open the page in incognito window?
Anton
I have already done it many times.
Thanks
HI,
Could you please check if the error still occurs for you?
Regards,
Matthias
Still the same 🙁 even after deleted all cache and executed inside Private mode.
BTW, I have moved from MaxDB to HANA database, but I'm not sure it is a big deal 😕
HI,Could you please test again and in case you experience the same issue again please let me know the time of your request.
Regards,
Matthias
Hi,
Same 🙁
Here is the time : 2:57 PM (Paris Time UTC+2).
Edit : 15:04
If it can helps you :
Regards
Hi,
Infrastructure team is working on resolving this issue. We will inform you about the progress.
Kind regards,
Matthias
Hi Joseph,
the infrastructure team changed some settings for your account. Can you please test again. Sorry, for the inconvenience.
Regards,
Bernhard
Hello Bernhard,
I am getting the same issue reported by Joseph Berthe.
When accessing the link to the IOT Services (https://iotcockpitiotservices-s0#########trial.hanatrial.ondemand.com/com.sap.iotservices.cockpit/) comes a dark grey screen with messages saying : "Could not load devices", Could not load setting" and "Could not load data types".
And I have already cleared my Chrome cache as well. Even tried to use Firefox without success to fix it.
Any idea?
Jorge Weiss
Hi Jorge,
Could you please check the trust settings of your account. You can see it in the HCP Cockpit > select your account > select Trust in the left menu. The option Principal Propagation should be enabled. If this is the case and your IoT Cockpit is still not working please contact me via email (see profile). Thank you.
Regards,
Bernhard
Hello Bernhard,
thank you very much.
Problem Solved.
Best Regards,
/Weiss
Hello,
Thanks for the effort, but unfortunatly it still doesn't works.
Even after clearing the browser caches. The difference is about the line of error 🙂
Regards,
Hi Joseph,
Could you please contact me via email (see profile).
Regards,
Bernhard
Hi,
I am using the trial account for HANA Cloud Platform. If I deploy the IoTMMS application, can I still deploy another JAVA application or does the IoTMMS application use up the single compute unit that HCP trial account comes with as default?
Best, Supriya
Hi Supriya,
you will automatically get a second compute unit after enabling the IoT Services. You can check by clicking on the "Resources" tab in the HCP cockpit.
BR,
Thomas
Thanks Thomas
Will there be a API to access the data like you did in your own application:
/com.sap.iotservices.mms/v1/internal/http/app/tables/T_IOT_<deviceTypeId>_<messageTypeId>
I can use the API for creating sensor data in my SAPUI5 WebIDE project, but if I follow the same approach for reading the tables (replace internal by api in the url and add the authentification header to the request), this will fail. I can do the request but the response is a logon html page.
Robert
Hi Robert,
Try changing the permissions of the iotmms Java application using the following:
If I can remember correctly, this solved my problem.
Best regards,
Guillaume
Hello Guillaume,
just a remark. This is a very important configuration step which makes it possible to use MMS Push API (to send data to the device).
Regards,
Anton
Hi Robert,
the internal API you described is used by MMS Cockpit only and provides a quick access to the data you sent from the devices. For consumption please use either the HCP Persistence API (an example is there in the IoT Starterter Kit) or XSJS/OData approach (all necessary steps are listed in post #3 by the follwoing link Using the SAP HCP IoT Services)
Regards,
Anton
Hi Anton,
This example is not working for me. My iotservices has a MAXDB database and I want to use the WebIDE for UI5 not WebIDE for HANA.
Please can you make a API available for reading the table.
Hi Robert,
Thanks for your feedback. At the moment there are no plans to provide an additional consumption API but rely on the services (Persistence service, OData, XS etc) that are available in HCP already. For MaxDB, the best option would be to access the DB via JDBC and expose the respective service to your SAPUI5 application.
Regards,
Anton
Hi,
I am trying to to send and receive messages via HTTP but it doesn't work.
The post returns 202 and the get returns a 400 code .... I do not see any correcponding table in HCP:
Can you please help?
[202] {"msg":"https://iotmmsixxxxxxtrial.hanatrial.ondemand.com/com.sap.iotservices.mms/v1/api/http/ack/84b4cc20-0174-4c2a-9508-0089d78a87a6/1c12ba8e-479f-47fa-88b6-2850879ccdc3"}
[200] [{"code":400,"sequences":["1c12ba8e-479f-47fa-88b6-2850879ccdc3"]}]
Thanks
Peter
Hi Peter,
could you send me your account name by email - then I can check the log files....
Thanks in advance, and thanks for the feedback...
Hello Sven,
Do you know if this issue has this issue been resolved yet?
I created a device 'RaspberryPi_1' and was trying to post messages to it via HTTP. I do get a 200 response. However, I don't see any table corressponding to my device either.
Please look at the screen-shot I have attached.
Thanks in advance.
Regards,
Divyaman
Hello Divyaman,
can you please check with the embedded UI in MMS (Application Data tile) if it shows your table? (you might need to click on refresh control on top)
Regards,
Anton
Hello Anton,
I was checking this in MMS itself. And I still could not see my table. However, I closed the MMS cockpit and started it again. I could then see my DB table.
Thanks for your help!
Regards,
Divyaman
Hi Michael Ameling,
Thanks for all your affort.
Cheers
Sharma
Hi,
I'm already stuck on one of the first steps: creating a device type. It always fails with a generic "could not create device type" error. When looking into the network traffic, the backend service is also not providing any detailed error message.
I verified that the IoT-User role is assigned to my user in the IoT Cockpit service and that IoT-MMS-User is assigned in the IoT MMS app.
Any idea what's missing? Any help would be much appreciated.
Thanks, Max
Hi Maximilian,
we will update you with the status once a problem is fixed. Sorry for the inconvenience.
Regards,
Anton
Hi Maximilian,
an issue if fixed now. You may model your device types, message types and devices. Thanks for reporting.
Regards,
Anton
I just confirmed it. Thanks for making my day 🙂
I have successfully enabled IoT service and was able to post message from MMS cockpit. However when I try to post message from the demo java application given in Github, it's giving a HTTP-200. However the data is not reflected in IOT table T_IOT_HTTP_PUSH. Also the response body is comprising following error message:
<html>
<head>
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
</head>
<body style="background-color:#FFFFFF" onload="var url=window.location.hash;if(url&&0!==url.length){var anchorCookie='oucrsbxakwpguqzuhlckbttsz_anchor="'+encodeURIComponent(url)+'"';document.cookie=anchorCookie}document.forms[0].submit()">
<p>
<script language="javascript">document.write("Please wait ...");</script>
</p>
<noscript>
<p>Note: Your browser does not support JavaScript or it is turned off. Press the button to proceed.</p>
</noscript>
<form method="post" action="https://accounts.sap.com/saml2/idp/sso/accounts.sap.com">
<input type="hidden" name="SAMLRequest" value="PEF1dGhuUmVxdWVzdCB4bWxucz0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIiB4bWxuczpuczI9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOm5zMz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyIgeG1sbnM6bnM0PSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGVuYyMiIEFzc2VydGlvbkNvbnN1bWVyU2VydmljZVVSTD0iaHR0cHM6Ly9pb3RtbXNpMzA0Mjk2dHJpYWwuaGFuYXRyaWFsLm9uZGVtYW5kLmNvbS9jb20uc2FwLmlvdHNlcnZpY2VzLm1tcy92MS9hcGkvaHR0cC9wdXNoLzEzN2VkYzBlLTAzOWItNGUwOS05YTQxLTFmZDVmNGQxNzAyMiIgRGVzdGluYXRpb249Imh0dHBzOi8vYWNjb3VudHMuc2FwLmNvbS9zYW1sMi9pZHAvc3NvL2FjY291bnRzLnNhcC5jb20iIEZvcmNlQXV0aG49ImZhbHNlIiBJRD0iUzliNzdlNjY1LWFkM2QtNDJjYy1hZjExLTUxNDU1ZTZiZTQ1YS1SZWE2dXZXcHkxZE9PYllPMlZaSWNWY2FNemVHZjhLaHpnWGQ1Ylg4emk0IiBJc3N1ZUluc3RhbnQ9IjIwMTUtMDgtMTdUMDQ6NDk6NDMuOTM4WiIgVmVyc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3aG4zbkxQMmJvWHNaQ3FOK3g2SzBJZmVaUXgyUGFBV2hCZDVWdnE0WmxUU0pveUIwODhBWC8xWEFieXlLOHgxMGVQY1R6czhudEFNc1dYTDRRbnJhaDUweEx6RlpHWFllWkxyOTRvTEN1MEFQVExJcW05U0J4VDl5UWdYZU54VzFlME1hb3ZQK09WZHFyYStBZ1hGVURINUdHeVYxUFhjVDBCNFAzWTdtOWtmS1Y2RUd2OXNEK1BEOG1pQkIwbXY3bmlxMXlUWERNaDg0NUtYOFlOeG9NUmFsZmNKekVzSmU5aWZWY0VrbWxMSTBRSDliTkNmQjA5SlRQZGRrYy91N1hVTnZBOFAzam5IMWtEZlB3TDdKQ1k3TEJ5d1pHK0xtT2hoUT09PC9kczpTaWduYXR1cmVWYWx1ZT48L2RzOlNpZ25hdHVyZT48L0F1dGhuUmVxdWVzdD4="/>
<input type="hidden" name="RelayState" value="oucrsbxakwpguqzuhlckbttsz"/>
<noscript>
<input type="submit" value="Continue"/>
</noscript>
</form>
</body>
</html>
Hi Shibaji,
your request is forwarded to the HCP login page. That is why you get a 200 response. In order to be able to use the push API you need to enable Basic Auth for MMS and add the respective header to your HTTP request: https://github.com/SAP/iot-starterkit/tree/master/src/prerequisites/mms
Regards,
Thomas
Thanks Thomas!! I changed the authentication setting and now that issue is resolved. However I am now getting HTTP-500: Failed to forward a POST response from the destination to an origin.
Hi,
I changed the authentication setting and now I am getting the following error:
HTTP-500: Failed to forward a POST response from the destination to an origin.
BR
Shibaji
Hi,
I guess you are using the sample consumption UI from the starter kit. Are you sure you set up the destinations to MMS and RDMS correctly in your HCP account: https://github.com/SAP/iot-starterkit/tree/master/src/apps/java/consumption
The exception you get is fired from here: https://github.com/SAP/iot-starterkit/blob/master/src/apps/java/consumption/com.sap.iot.starterkit.ui/src/main/java/com/sap/iot/starterkit/ui/DataServlet.java
This means that you request could not be forwarded to MMS. It would be interesting to see what the IOException contains.
Regards,
Thomas
Thanks a lot Thomas!! Now my Java application is working fine.
Next, I would like to test if the same IoT APIs can be consumed (GET/POST) from an HTML5 application.
All I needed to do is to put the destinations iotmms and iotrdms on the account level and the application is working fine!!
Hi
I have been able to test message sending via Send & Receive messages HTTP in HCP data services.
However I am not able to send any data from outside ... tried using HTTP Push services of Chrome Postman, Hurl it and even Python.
I get the same error as below ... "Note: Your browser does not support Javascript or it is turned off. Press the button to proceed" ... if you have any idea on how to solve this error it will be great
Example from Postman
<head>
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
</head>
<body style="background-color:#FFFFFF" onload="var url=window.location.hash;if(url&&0!==url.length){var anchorCookie='oucrsowphuomgvylxblcaoyad_anchor="'+encodeURIComponent(url)+'"';document.cookie=anchorCookie}document.forms[0].submit()">
<p>
<script language="javascript">document.write("Please wait ...");</script>
</p>
<noscript>
<p>Note: Your browser does not support JavaScript or it is turned off. Press the button to proceed.</p>
</noscript>
<form method="post" action="https://accounts.sap.com/saml2/idp/sso/accounts.sap.com">
<input type="hidden" name="SAMLRequest" value="PEF1dGhuUmVxdWVzdCB4bWxucz0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIiB4bWxuczpuczI9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOm5zMz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyIgeG1sbnM6bnM0PSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGVuYyMiIEFzc2VydGlvbkNvbnN1bWVyU2VydmljZVVSTD0iaHR0cHM6Ly9pb3RtbXNzMDAxMTA1NzcyMHRyaWFsLmhhbmF0cmlhbC5vbmRlbWFuZC5jb20vY29tLnNhcC5pb3RzZXJ2aWNlcy5tbXMvdjEvaW50ZXJuYWwvaHR0cC9kYXRhLzc1NTZmODBiLTIxMmYtNDNlMi05ZTBjLTdlYjQ0NzA4NWQ5MSIgRGVzdGluYXRpb249Imh0dHBzOi8vYWN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vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjc2hhMSIvPjxkczpEaWdlc3RWYWx1ZT5ySkVEM0Z2NWRzV0VGWUZPUyt0dHpNNXd5RDQ9PC9kczpEaWdlc3RWYWx1ZT48L2RzOlJlZmVyZW5jZT48L2RzOlNpZ25lZEluZm8+PGRzOlNpZ25hdHVyZVZhbHVlPlgyeFlxb3FNM3M5Qi9EeFd3NnJJQ002VU1DYXVwdkJydVhHYktvc25oZUJHdjVDbFJXNGV1Q3Nka2pqbUgybUhGZGU1eU1XbFBjYk9JdjBiQ3hIYUVhYlFzQmtFMXdacFJWQWllaitXYU5mKzBEM1J1SVdoVTdldndFYXROaFdWakNXaDlIakQwNWVIWHpXck0yRWlpMFBKYnpoK0c3UVVUbVRwdDlDanZlbmtrNkxjZ2hxSUw5cnpSLy9CNVFpbWxIQjZkZlRFazdwZjhqRXJmdStseGhQdWtKeHlnZDQzWXNhbCt3dnQwSlZPejE0bGQxRWtNUTY2MWZsKzB1WFNuRmhFNUp3LzBUMi9vbFpqLzdkMkNaRzdBSzhEaUFLN01GVGZIR0hFTVBIUEJ4OUE4U0lZZ3puSDZSVTF5THEwT3d6YWJqMnVnTkJKMzd6KzFhZFM2QT09PC9kczpTaWduYXR1cmVWYWx1ZT48L2RzOlNpZ25hdHVyZT48L0F1dGhuUmVxdWVzdD4="/>
<input type="hidden" name="RelayState" value="oucrsowphuomgvylxblcaoyad"/>
<noscript>
<input type="submit" value="Continue"/>
</noscript>
</form>
</body>
</html>
Example from Python
I have added my user to MMS group and also changed the authorization
Request help..............................
Hi Abhishek, you are using ../v1/internal/.. endpoint in your example. Please use ../v1/api/.. instead protected with oauth.
Thanks Anton a lot ..
It works now ... and I am able to send data from python to HCP 🙂
The latest release note for HCP says IoT now support binary data type: Release Notes for SAP HANA Cloud Platform
Are there any code samples available for using this binary data type? Thank you.
Hi Witalij,
IoT Starter Kit will be extended soon.
Regards,
Anton
When enabling the IoT service I get this
Any ideas?
Hi Gunnlaugur,
I would assume you are on Trial, right? Maybe some detailed message is there when you click on that tile? Or some output in browser console?
Regards,
Anton
Hi Anton and thanks for reply-ing.
Yes on Trial.
No on the detailed messages and no message in the console for both IE and crome.
Regards,
Gunnlaugur
Hi Gunnlaugur,
would you mind to share your HCP (p- / s- user) either in here or privately by sending a SCN message to me (you need to follow me for a while to do that)? I will then forward your issue internally.
Sorry for inconvenience,
Anton
Hi,
I have setup the IOT service and was able to send messages from the client on the cockpit. I can create message types and devices as well. I tried to post a message to a device and the data was sent to the IOT_HTTP_PUSH table.
Now when i tried to receive this message through a HTTP GET call as described in the demo. I keep getting a HTTP 401 error.
So in "Authentication Configuration" in the cockpit for my iot java application i enabled the different kinds of authentication. And yet i still receive the same error. I did ofcourse append user id and password in authorization for HTTP GET call.
How do i resolve this?
Regards,
Chetan Vasudev
Hi Chetan,
a minor remark first. If your MMS is of version 2.4 or higher then setting a "Custom" Authentication Configuration is not necessary anymore.
Regarding your issue. You speak here about getting messages pushed to the device, right? So, executing a HTTP GET against ../com.sap.iotservices.mms/v1/api/http/data/[device id]
That endpoint is protected with OAuth. Use your device token (Bearer: token) to authenticate and not the username:password (Basic u:p).
Regards,
Anton
Thanks Anton. That worked,
Regards,
Chetan
Hi there!
I'm using IOTMMS on the Europe HCP (not the trial HCP), but still there is a limit for devices (50!).
By creating devices via RDMS, I managed to squeeze in 67, but after that I always receive the error message, saying the limit is 50.
Why is the limit there and how can I deactivate it?
Thanks and regards,
Daniel
P.S:
The only information I can find is this:
"Please be aware that the number of devices is limited (refer to section Device)."
But under "Device" there is no mentioning of it...
Hi Daniel,
Unless you are asking for clarification/correction of some part of the Blog or Document, please create a new Discussion marked as a Question. The Comments section of a Blog (or Document) is not the right vehicle for asking questions as the results are not easily searchable. Once your issue is solved, a Discussion with the solution (and marked with Correct Answer) makes the results visible to others experiencing a similar problem. If a Blog or Document is related, put in a link to it in the Discussion. Read the Getting Started documents (link at the top right of each SCN page) including The SCN Rules of Engagement.
Thanks,
--Vlado (Moderator)
Hello,
I got a problem with deploying the Message Management Service.
The deployment of the Message Management Service in the Internet of Things Cockpit is successfully, but the java app iotmms is very long in the starting mode and is on failed after a few minutes.
I'm using IoTMMS on the Europe HCP (not the trail HCP).
Any idea what I did wrong?
Thanks for your help,
Felix
First Picture: Status summary of the iotmms app
Second Picture: Current metrics of the iotmms app
Please, refer to MMS FAQ SAP HANA Cloud Platform Internet of Things Services
"..In Factory landscapes, you must create a binding manually. For more information, refer to section Managing Databases."
Thanks for your quick response!!
It's started now 🙂
Hello,
I am trying to run this demo but I came across a weird problem.
Problem occurs in HCP, with my trial account.
There seems to be a problem when trying to access the service of IoT, within the Services available in HCP.
Every time I try to access the service cockpit ("Go to service" link) I get 6 errors, such as "Could not load hierarchies", "Could not load data types" etc.
Due to the above errors and as far as I understand, I am not able to add new message types or device types etc...
Any ideas about a solution?

Replied in this duplicated thread https://blogs.sap.com/2015/06/09/using-the-sap-hcp-iot-services/#comment-349899
P.S. Please, read rules of engagements http://go.sap.com/community/about/rules-of-engagement.html and do not cross-post
Hello.
Is it possible send data from SAPUI5 application to device without use Java? I saw starter kit but just found consuming using UI5.
Sending data from device to HCP is working well and i can consume it using OData API in UI5 application.
Sending data from IoT cockpit to device is working very well too, but now, i would like to send data from my UI5 application.
Is it possible? How can i do it?
I tried the code bellow but didn't work.
Thanks and regards,
Guilherme
Hello Guilherme,
yes, you can do it since UI5 speaks JavaScript and HTTP. According to online documentation [1], you have to create and send the HTTP POST (and not HTTP GET) with the respective JSON body content (see example in the docu as well)
Regards,
Anton
[1] https://help.hana.ondemand.com/iot/frameset.htm?9da1c18f6ab947c58052f4d07498a654.html
Hello Anton.
I am sorry, i just copy and past the code here and forgot to change GET by POST.
The correct code, using POST, i have been receiving response 403 using the code bellow.
Thanks and regards,
Guilherme
It’s working fine now!
Changed the authorization to basic, like bellow:
Body:
{
“sender”:”IoT application”,
“messageType”:”5266d8603d6″,
“method”: “http”,
“messages”:[{
“estado”: “false”
}]
}
——
Another question now. Will the OAuth access token expire automatically? Is there any way the device receive it automatically or just manually?
Thanks and regars,
Guilherme
Hello Guilherme,
yes, Push Service API is protected with both Basic and Oauth authentication types. I would guess, when using Oauth you were getting HTTP 403 Forbidden, because the device token was used to authenticate. This is wrong. There is a separate procedure of requesting a token for Push Services like APIs. Please, follow the online documentation [1].
Regarding your last question - no there is no lifetime for a device token. If it has been lost or needs to be changed, the one could request for it from the IoT Cockpit [2]
P.S. Unless you are asking for clarification/correction of some part of the Blog Post, please create a new "Question". The Comments section of a Blog is not the right vehicle for asking questions as the results are not easily searchable. Once your issue is solved, a "Question" with the "Accepted" answer makes the results visible to others experiencing a similar problem. If a Blog is related, put in a link to it in the "Question". Please, read the "About SAP Community" and familiarise yourself with the "Community Rules of Engagements" [4].
[1] https://help.hana.ondemand.com/iot/frameset.htm?44572dbd32dc4649aa5fdfe99e418bcf.html
[2] https://help.hana.ondemand.com/iot/frameset.htm?885084d556844246a5a49c2a06eb2281.html
[3] http://www.sap.com/community/about.html
[4] http://www.sap.com/community/about/rules-of-engagement.html
Regards,
Anton (Moderator)
Hi All,
I am facing the 401 Unauthorized response when trying to post data to the device
URL : https://webidetesting566566-<mytrialaccount>trial.dispatcher.hanatrial.ondemand.com/iotmms/data/5749dadc-d077-410b-9444-6eabd631213a
IOT.postData(
sDeviceId,
"sync"
,
sMessageTypeId,oMessage,
successCallBack,
errorCallBack,
headers: {
"Authorization"
:
"Bearer "
+ oAuthToken
}
}
);
Where as IOT.pushData working without any issues.
I have maintained the destination properly in HCP cockpit.
when I am using the same auth token on the direct URL (other than destination) https://iotmms<mytiralaccount>trial.hanatrial.ondemand.com/com.sap.iotservices.mms/v1/api/http/data/5749dadc-d077-410b-9444-6eabd631213a
in postman plugin POST call was successfull.
Please advise where else the error would be.
Regards
Murthy
Hello Murthy,
please familiarise yourself with the Rules of Engagements [1] and especially #9 - Do not create multiple copies of the same question in different threads. You have already asked the same question in here [2]. Moreover, this particular blog does not describe Web IDE and Destinations setup.
Regards,
Anton (Moderator)
[1] https://www.sap.com/community/about/rules-of-engagement.html
[2] https://blogs.sap.com/2016/04/10/communicate-with-iot-in-your-webide-project/comment-page-1/#comment-365741
Hi Experts,
Instead of using IoT service cockpit, is there an API for creating message types, device types and registering devices?
Yes, please look up in the documentation [1] "Remote Device Management Service API"
[1] https://help.sap.com/viewer/7436c3125dd5491f939689f18954b1e9/Cloud/en-US/c4477ad35f1c405fb9364f279f24d973.html
Hello friends.
I signed up to the cloud platform and started a free trial, I want to use the iot service, but I can't find the service when I look at the services.
Please help me.
I wanted to use SAP Cloud Platform IoT Cockpit (HTTP or MQTT protocol) to connect and stream the data to cloud. I wanted to use IoT Freestyle template from SAP WebIDE to build the UI. To use this template I must have SAP Leonardo IoT license and access. I Could not find how to activate the SAP Leonardo IoT features in the Test account that I created.