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

  1. Log on the SAP Cloud Platform cockpit:
  2. Go to the Services tab.
  3. Select the Internet of Things Service entry.

         

 

  1. Choose Enable.

  • 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.

 

  1. Choose Go to Service for the Internet of Things services subscription.
  2. The Internet of Things Service Cockpit is displayed.

     /wp-content/uploads/2015/04/2016_07_17_21_40_45_996730.png

 

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.

 

  1. Go to the Internet of Things Service Cockpit.
  2. Choose the Deploy Message Management Service tile which opens the MMS deployment tooling.

     /wp-content/uploads/2015/04/2016_07_17_21_40_46_996731.png

  1. Fill in the target consumer Account ID (pre-filled) from the SAP Cloud Platform Cockpit, and enter your User Name (pre-filled) and Password.

     Deploy_MMS.png

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.

To report this post you need to login first.

106 Comments

You must be Logged on to comment or reply to a post.

  1. Emmanuel Dacosta

    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

    (0) 
      1. Emmanuel Dacosta

        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

        (0) 
  2. Tobias Bettmann

    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

    (0) 
  3. Beata Ciepiel

    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

    (0) 
    1. Ralf Ackermann

      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

      (0) 
  4. sridevi garapati

    Hi,

    As you mentioned above I successfully installed Message management Service and assigned role to user.

    Successfully installed Message management service like below.

    /wp-content/uploads/2015/05/mms_708567.png

    Assigned IoT-User  Role to User like below.

    /wp-content/uploads/2015/05/user_708571.png

    Similarly I assigned IoT-MMS-User role to the user like below.

    /wp-content/uploads/2015/05/mms_user_708578.png

    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

    (0) 
      1. Venkatesh Gopalarathnam

        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.

        (0) 
        1. Anton Levin

          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

          (1) 
            1. Anton Levin

              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

              (0) 
  5. Helmut Grimm

    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

    (0) 
    1. Ralf Ackermann

      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

      • either start sending data upstream (by moving the slider to 100) or
      • sending a message to the device with the other Python example (the one for push)

      and check whether the “warning” disappears. The root cause for it will be fixed.

      (0) 
      1. Helmut Grimm

        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

        (0) 
        1. Peter Corthouts

          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

          (0) 
  6. Guillaume GARCIA

    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?

    IoT.png

    Settings look OK

    IoT settings.PNG

    But no table…

    IoT tables.PNG

    Event though they do share the same schema

    IoT Schema.PNG

    Thanks in advance.

    Best regards,

    Guillaume

    (0) 
    1. Anton Levin

      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

      (0) 
      1. Guillaume GARCIA

        Hi Anton,

        Thanks.

        After a first attempt (RDMS needed to be synchronized?), the message went through.

        IoT stored message.PNG

        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

        (0) 
          1. Brice Chou

            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

            (0) 
  7. Shing Trinh

    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.

    (0) 
    1. Thomas Janke

      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

      (0) 
  8. Nicolas Picot

    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 ?

    Capture d’écran 2015-05-25 à 23.52.51.png

    Regards

    Nicolas

    (0) 
    1. Ralf Ackermann

      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

      (0) 
  9. Sadanand Bhat

    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

    (0) 
    1. Anton Levin

      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

      (0) 
  10. SARATH GOPAL

    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.

    (0) 
    1. Sven Horn

      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

      (0) 
  11. Jose G

    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.

    (0) 
      1. Jose G

        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.


        (0) 
  12. Joseph BERTHE

    Hello,

    I have some trouble accessing to my cockpit :

    /wp-content/uploads/2015/06/iot_issue_731637.png

    I have already setup devices and messages types and send some data to IoT Services. You can see the tables here ;

    /wp-content/uploads/2015/06/iot_tables_731652.png

    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 ?

    (0) 
          1. Joseph BERTHE

            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 😕

            (0) 
                1. Bernhard Wolf

                  Hi Joseph,

                  the infrastructure team changed some settings for your account. Can you please test again. Sorry, for the inconvenience.

                  Regards,

                  Bernhard

                  (0) 
                  1. Jorge Weiss

                    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

                    (0) 
                    1. Bernhard Wolf

                      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

                      (0) 
                  2. Joseph BERTHE

                    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 🙂

                    /wp-content/uploads/2015/06/iot_issue3_735901.png

                    Regards,

                    (0) 
  13. Supriya Mayank Umbarkar

    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

    (0) 
    1. Thomas Janke

      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

      (0) 
  14. Robert Eijpe

    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

    (0) 
    1. Guillaume GARCIA

      Hi Robert,

      Try changing the permissions of the iotmms Java application using the following:

      Permissions.PNG

      If I can remember correctly, this solved my problem.

      Best regards,

      Guillaume

      (0) 
      1. Anton Levin

        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

        (0) 
    2. Anton Levin

      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

      (0) 
      1. Robert Eijpe

        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.

        (0) 
        1. Anton Levin

          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

          (0) 
  15. Peter Corthouts

    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

    (0) 
    1. Sven Horn

      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…

      (0) 
      1. Divyaman Singh Rawat

        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.

        Capture2.JPG

        Capture3.JPG

        Thanks in advance.

        Regards,
        Divyaman

        (0) 
        1. Anton Levin

          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

          (0) 
          1. Divyaman Singh Rawat

            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

            (0) 
  16. Maximilian Lenkeit

    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

    (0) 
    1. Anton Levin

      Hi Maximilian,

      an issue if fixed now. You may model your device types, message types and devices. Thanks for reporting.

      Regards,

      Anton

      (0) 
  17. Shibaji Chandra

    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=&quot;’+encodeURIComponent(url)+’&quot;’;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=”PEF1dGhuUmVxdWVzdCB4bWxucz0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIiB4bWxuczpuczI9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOm5zMz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyIgeG1sbnM6bnM0PSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGVuYyMiIEFzc2VydGlvbkNvbnN1bWVyU2VydmljZVVSTD0iaHR0cHM6Ly9pb3RtbXNpMzA0Mjk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mVsb3BlZC1zaWduYXR1cmUiLz48ZHM6VHJhbnNmb3JtIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8xMC94bWwtZXhjLWMxNG4jIi8+PC9kczpUcmFuc2Zvcm1zPjxkczpEaWdlc3RNZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjc2hhMSIvPjxkczpEaWdlc3RWYWx1ZT45bW5ZWDFBeXZRWmNWNTgyY3pYYk1XNzc0WXM9PC9kczpEaWdlc3RWYWx1ZT48L2RzOlJlZmVyZW5jZT48L2RzOlNpZ25lZEluZm8+PGRzOlNpZ25hdHVyZVZhbHVlPkxqTnY5RzdoVWtvOGlpdFlaWS83VEVPdFkyR2RxcWhseCtLSzNtSUx3RDFmdTcyd2Y3aG4zbkxQMmJvWHNaQ3FOK3g2SzBJZmVaUXgyUGFBV2hCZDVWdnE0WmxUU0pveUIwODhBWC8xWEFieXlLOHgxMGVQY1R6czhudEFNc1dYTDRRbnJhaDUweEx6RlpHWFllWkxyOTRvTEN1MEFQVExJcW05U0J4VDl5UWdYZU54VzFlME1hb3ZQK09WZHFyYStBZ1hGVURINUdHeVYxUFhjVDBCNFAzWTdtOWtmS1Y2RUd2OXNEK1BEOG1pQkIwbXY3bmlxMXlUWERNaDg0NUtYOFlOeG9NUmFsZmNKekVzSmU5aWZWY0VrbWxMSTBRSDliTkNmQjA5SlRQZGRrYy91N1hVTnZBOFAzam5IMWtEZlB3TDdKQ1k3TEJ5d1pHK0xtT2hoUT09PC9kczpTaWduYXR1cmVWYWx1ZT48L2RzOlNpZ25hdHVyZT48L0F1dGhuUmVxdWVzdD4=”/>

                <input type=”hidden” name=”RelayState” value=”oucrsbxakwpguqzuhlckbttsz”/>

                <noscript>

                    <input type=”submit” value=”Continue”/>

                </noscript>

            </form>

        </body>

    </html>

    (0) 
      1. Shibaji Chandra

        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.

        (0) 
  18. Shibaji Chandra

    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

    (0) 
    1. Thomas Janke

      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

      (0) 
    2. Shibaji Chandra

      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!!

      (0) 
  19. Abhishek Kaul

    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=&quot;’+encodeURIComponent(url)+’&quot;’;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=”PEF1dGhuUmVxdWVzdCB4bWxucz0idXJu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EaUFLN01GVGZIR0hFTVBIUEJ4OUE4U0lZZ3puSDZSVTF5THEwT3d6YWJqMnVnTkJKMzd6KzFhZFM2QT09PC9kczpTaWduYXR1cmVWYWx1ZT48L2RzOlNpZ25hdHVyZT48L0F1dGhuUmVxdWVzdD4=”/>

                <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…………………………

    (0) 
    1. Anton Levin

      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

      (0) 
        1. Anton Levin

          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

          (1) 
  20. Chetan Vasudev

    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

    (0) 
    1. Anton Levin

      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

      (0) 
  21. Daniel Huser

    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…

    (0) 
    1. Vladimir Pavlov

      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)

      (0) 
  22. Felix Hoehn

    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

    Error_mms.PNG

    Error_mms2.PNG

    (0) 
  23. Athanasios Athanasiadis

    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?

    (0) 
    1. Anton Levin

      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

      (0) 
  24. Guilherme Lahr

    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.

                                    var sUrl = "/destinations/iotmms/v1/api/http/push/MY_DEVICE_ID";
    			
                                  jQuery.ajax({
    				type: 'GET',
    				contentType: "application/json;charset=utf-8",
    				dataType: "json",
    				url: sUrl,
    				xhrFields: {
    					withCredentials: true
    				},
    				beforeSend: function(request) {
    					request.setRequestHeader('Authorization', 'Bearer MY_TOKEN');
    				},
    				error: function(jqXHR, textStatus, errorThrown) {
    					if (jqXHR.status !== 0) {
    						sap.m.MessageToast.show("[".concat(jqXHR.status, "] ", jqXHR.statusText, " ", jqXHR.responseText));
    					}
    				},
    				success: function(oData, textStatus, jqXHR) {
    					if (oData === null || oData === undefined) {
    						sap.m.MessageToast.show("[WARNING] Received a null or undefined response object");
    						return;
    					}
    				}
    			});

    Thanks and regards,
    Guilherme

    (0) 
    1. Anton Levin

      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

      (1) 
      1. Guilherme Lahr

        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.

        			var sUrl = "/destinations/iotmms/v1/api/http/push/c77dffb7-9........"
        			jQuery.ajax({
        				type: 'POST',
        				contentType: "application/json;charset=utf-8",
        				dataType: "json",
        				url: sUrl,
        				data: oData,
        				beforeSend: function(request) {
        					request.setRequestHeader('Authorization', 'Bearer f145cce.......');
        				},
        				error: fnError,
        				success: fnSuccess
        			});

        Thanks and regards,

        Guilherme

        (0) 
        1. Guilherme Lahr

          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

          (0) 
          1. Anton Levin

            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) 

            (0) 
  25. Narasimha Murthy Balla

    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

     

    (0) 
    1. Anton Levin

      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

       

      (0) 

Leave a Reply