Skip to Content

What do you need to send data with an iOS device to the IoT Services?

 

 

Optional:

 

 

How to Send Data with the IoT Sensor App by itelligence AG?

 

Create a device model via IoT Service Cockpit

  1. Open the IoT Service Cockpit.
  2. Choose the Message Types tile.
  3. Create a new Message Type by clicking ( + ).
  4. Enter a name, e.g. “iOS Data”.
  5. Change the Data Type for timestamp to long.
  6. Enter the following fields depending on the device you are targeting (all fields are optional):
    • iOS Device: timestamp (long) / accX (double) / accY (double) / accZ (double) / altitude (double) / locLat (double) / locLong (double) / pressure (double)
    • TI Sensor Tag: timestamp (long) / sensorGyroX (double) / sensorGyroY (double) / sensorGyroZ (double), sensorAccX (double) / sensorAccY (double) / sensorAccZ (double) / sensorBarometric (double)
    • ublox OLP: timestamp (long) / sensorTemp (double) / sensorGyroX (double) / sensorGyroY (double) / sensorGyroZ (double)Screen Shot 2016-08-07 at 12.47.30.png
  7. Copy the displayed Message Type ID to your Clipboard.
  8. Go back to the IoT Service Cockpit.
  9. Choose the Device Types tile.
  10. Create a new Device Type by clicking ( + ).
  11. Enter a name, e.g.: “iOSDevice”, “TI CC2650” or “OLP 425” (depending on your available hardware).
  12. Add the Message Type that was previously created (here: “iOS Data”).Screen Shot 2016-08-07 at 12.51.40.png
  13. Copy the displayed Device Type ID and Device Registration Token to your Clipboard.Screen Shot 2016-08-07 at 12.55.52.png

 

You can now start sending data with a client using the created Message Type and Device Type.

 

Download and configure IoT Sensor App

 

  1. Install on your mobile device: IoTSensor on the App Store (iOS only)
  2. Configure the app with by calling the following custom URL on your device:
    • iot-create://&/accountName&/[Account ID]&/name&/[Connection Name]&/dataCenter&/[Data Center]&/deviceName&/[Device Name]&/deviceTypeID&/[Device Type ID]&/deviceReg&/[Device Registration Token]&/messageTypeID&/[Message Type ID]
    • Parameters:
      • [Account ID] => your account ID, e.g., “p1234567trail” (remark: not your user name)
      • [Data Center] => your account data center, e.g., “hanatrial” / “hana” / “us1.hana” / “us2.hana” / “ap1.hana”
      • [Connection Name] => any name for a connection, e.g., “myConnection”
      • [Device Name] => any name for the device, e.g., “iPhone Michael” / “Sensor Tag 1”
      • [Device Type ID] => the Device Type ID you copied previously to your clipboard
      • [Device Registration Token] => the Device Registration Token you copied previously to your clipboard
      • [Message Type ID] => the Message Type ID you copied previously to your clipboard
    • Sample: iot-create://&/accountName&/p000000trial&/name&/myTrialConnection&/dataCenter&/hanatrial&/deviceName&/iPhoneMichael&/deviceTypeID&/f807b43597e44cf1fc4b&/deviceReg&/ce89c5cfe7fdb25b381eff51136b97&/messageTypeID&/9208dd4b8cc54bc1fb1b
  3. Once the custom URL is launched the app starts and account will be configured.
  4. Press on Registration.
    Screen Shot 2016-03-22 at 10.34.59.png
  5. The “Device” gets registered and is ready to send Data. Press OK.
    Screen Shot 2016-03-22 at 10.35.28.png
  6. The “Connection” is now coloured red.
    Screen Shot 2016-03-22 at 10.52.44.png

 

Select Device and Send Data

 

  1. Press on Sensor.
    Screen Shot 2016-03-22 at 10.52.44.png
  2. Select a device (vor BLE device connection press refresh).
    Screen Shot 2016-03-22 at 10.54.08.png
  3. The device is not connect. Go back by pressing Select Source.
  4. Press Back. (Sensor and Connection are coloured red.)
  5. Press Record Button.
    Screen Shot 2016-03-22 at 10.54.23.png
  6. Data is sent according to sending interval (values that are not defined in the message type are ignored.)
    IMG_6740.png

 

Where do I see my Incoming Data?

 

IoT Message Management Cockpit

 

You can see your incoming data immediately via the MMS Cockpit.

  1. Open the IoT Service Cockpit.
  2. Choose the Send and view messages, or perform other actions tile. (The MMS Cockpit opens.)
  3. Choose the Display stored messages tile. (All tables of incoming data are listed.)
  4. Select the table that is named after the Message Type ID that you created previously (“T_IOT_<MESSAGE TYPE ID>”).
    Screen Shot 2016-03-23 at 12.32.58.png
  5. Press refresh to update the table. The latest values are on top.
    Screen Shot 2016-03-23 at 12.32.01.png

 

OData Consumption

 

The Message Management Service exposes the tables via OData as well (Documentation: SAP HANA Cloud Platform Internet of Things (IoT) Services).

 

  1. Open any browser.
  2. Copy the targeted table name to your clipboard. (see previous step)
  3. Enter the URL as follows:
  4. Remove the parameter “?$format=json” in case you want to consume the OData API in application, e.g., HTML5 Applications.

 

You can now start to consume the data in other applications.

 

 

How to write your own iOS App?

 

 

Additional Material?

 

 

Questions and Feedback?

We highly appreciate your questions or feedback. Please add your comments below.

To report this post you need to login first.

47 Comments

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

  1. Mayank Gera

    Hi Michael,

    Thanks for this blog. This is nice way to simulate if you don’t have hardware available with you.

    I tried this but i am stuck at the registration step. It says Registration failed. This is the URL i launched. I am using hanatrail account.

    >iot-create://&/accountName&/p1941830575&/name&/myConnection&/dataCenter&/hanatrial&/deviceName&/iPhoneMayank&/deviceTypeID&/95a52fac0054f9dfc8f7&/deviceReg&/ab93c551c623cc048fa9412a942c7a&/messageTypeID&/ae475c6ceda8a38d4dab

    (0) 
    1. Michael Ameling Post author

      Thanks for the feedback. The account ID you used is not correct. Please always look in the HCP Cockpit for the correct account ID. In your case it should be “p1941830575trial”.

      (0) 
          1. Mayank Gera

            Hi Micheal,

            Apologies for getting back late. Yes I can see a registered device with your Name in IoT Cockpit under Devices. I tired again now,but still I get the same “Registration Failed”. I even deleted the app and re configured.

            iot-create://&/accountName&/p1941830575trial&/name&/myConnection&/dataCenter&/hanatrial&/deviceName&/iPhoneMayank&/deviceTypeID&/95a52fac0054f9dfc8f7&/deviceReg&/ab93c551c623cc048fa9412a942c7a&/messageTypeID&/ae475c6ceda8a38d4dab

            (0) 
            1. Michael Ameling Post author

              Hi Mayank,

              I just tried with your configuration and it works great when you change the device name. The error I get with you configuration is that you already created a device with this name. Therefore, you should either change the name or delete the device via the IoT Cockpit in the device tile. Please make sure that you have the latest version of the IoT sensor app as well.

              Best regards,

              Michael

              (0) 
              1. Mayank Gera

                Yes that was the problem, I changed the name and it got registered.

                This work perfectly fine now. I can see the data pushed to HCP from iPhone.

                Thanks a lot,

                Mayank

                (0) 
  2. Pavan Hampi

    Hello Michael Ameling

    I have created Device Type & Message Type as per above article, Installed app ” IoTSensor” on iPad, There are two options on the app Sensor and Connection. By clicking on Connection, New Connection opened. I filled the details as details got from cockpit on creating Device Type & Message Type respectively,i don’t know why i am getting ” Registration Failed” error. Could you please help me out.

    Thanks in advance.

    Regards,

    Pavan 

    (0) 
    1. Michael Ameling Post author

      Hi Pavan,

      can you please try again. There was an issue that got fixed. In case it still does not work please drop me an e-mail.

      Best regards,

      Michael

      (0) 
      1. Pavan Hampi

        Hello Michael,

        I tried as you told, bit it could not resolved problem. Still it showing “Registraion Failed ” . Could you please help me out ?

        Regards,

        Pavan

        (0) 
        1. Michael Ameling Post author

          Hi Pavan,

          it seems that the Registration Token or the account is not setup properly. Can you please share a screenshot of your settings via mail (in order not to share any credentials via SCN).

          Thanks, Michael

          (0) 
            1. Michael Ameling Post author

              Hi Pavan,

              yes, you need to create an according link with your account configuration. Please find the description how to configure your account in the article. The configuration is necessary in order to tell the app where to send what data.

              Best regards,

              Michael

              (0) 
              1. Pavan Hampi

                Hello Micheal,

                I have created Message Type,Device Type.Below is the link , i entered in Safari tab.

                iot-create://&/accountName&/S0015414084&/name&/Connect&/dataCenter&/hana.us1&/deviceName&/P1Device&/deviceTypeID&/3511f69da8f73fa2e95b&/deviceReg&/e280629261bb27bca629453bb1c7ef4d&/messageTypeID&/5d35df15cab913bf4918

                Still i am facing  “Registration Failed”. I don’t know what i am missing ? Please help me out

                Regards,

                Pavan

                (0) 
                1. Pavan Hampi

                  Hello ,

                  could you help me out , Still i am facing Registration Failed error on SensorTag app after entering above URL in Safari browser .

                  (0) 
  3. Matthias Steiner

    Thanks Michael for this great and straight-forward example! I recently went through this again as I was collecting resources for a Hackathon and noticed that on my device (TI SimpleLink SensorTag CC2650) I had to prefix the properties/fields of the MessageType with ‘sensor’ (e.g. sensorTemp) in order for it to work properly:

    Just FYI for those that may also run into issues with 0.0 values …

    (0) 
  4. Michael Ameling Post author

    Just updated the field names for the message type of the SensorTag and iOS device. Please check your device model that the new names match.

    (0) 
  5. Emmanuel Da Costa

    Hello

    I am trying the tutorial and I am facing two problems :

    -> in the message type configuration screen, I do not have the 3 fields but only 1

    Message type.PNG

    -> In the Display stored Data, I have only 3 tables

    data store.PNG

    I have the DB created and running. I am using the hana trial

    iotmms.PNG

    Any clues

    Regards

    Emmanuel

    (0) 
    1. Anton Levin

      1. first screen. press on “Add Field” to add more fields to the message type

      2. a table is created once data is arrived from sensor/device/sample client

      (0) 
      1. Emmanuel Da Costa

        Hello

        I found my mistake.

        In the tutorial, the first step is the creation of the device type. But the first step must be the creation of the message type.

        As the device type assignment has been removed from the message type creation, it is not possible to assign a device type to the message type.

        When creating the device type, it is possible to assign the message type if it has been created first.

        It is explained in the iot stater kit.

        Please could you modify the tutorial ?

        Now everything goes well.

        best regards

        Emmanuel

        (0) 
  6. Pavan Hampi

    Hello,

    I have created new MessageType for CC2650.

    & followed procedure as above. Getting below error(screenshot)

    Sensoreeror_cc2650.jpg

    I am not getting data in MMS Cockpit.Could you please help this out?

    (0) 
    1. Anton Levin

      Message Type filed names you used during message type creation should match to the names you send in payload. I see you have SensorGyroy and SensorGyroz (1st screenshot) but sensorGyroY and sensorGyroZ (2nd screenshot). Case matters.

      (0) 
      1. Pavan Hampi

        Hello Anton,

        I have changed accordingly,but still facing same error.

        Changed Message ID,Device Type ID,Device registration Token in standard IoT url.

        Registration was successful.

        Regards,

        Pavan

        (0) 
        1. Anton Levin

          It will help if you provide a full screenshot (do you have only 5 fields?) and also an updated screenshot from itelligence app to compare.

          (0) 
                1. Anton Levin

                  I do not have a sensortag with me but I do not remember it sends “timestamp”. This field should be removed from your message type, I guess.

                  (0) 
                  1. Murali Shanmugham

                    Hi Anton, My sensortag message has got timestamp(date) and it worked for me yesterday. Looks like the problem is elsewhere.

                    Pavan, can you please raise a discussion in the forum and point to this article. Thanks.

                    (0) 
  7. Simen Huuse

    Hi Michael. Great blog post. Fields “Message Type Name” and “Message Type Direction” are left blank when creating a connection with the above procedure. Is that intentional?

    Br, Simon

    (1) 
  8. Volker Kolberg

    Hi Michael!
    Great post. But it would b e very helpful, if at least all sensor data the App can read from the CC2650 SmartTag would also be handed over to HCP. I am talking about at least:
    sensorHumidity
    sensorObjectTemp
    sensorOptical
    sensorTemp
    But according to the specification there are even more sensors. Thus enabling ALL sensors in the app as optional fields would be great:

    pressure R hPa float Pressure sensor air pressure
    pressure_t R C float Pressure sensor temperature
    humidity R %RH float Humidity sensor relative humidity
    humidity_t R C float Humidity sensor temperature
    objtemp R C float IR temp sensor object temperature
    accelX R g float Accelerometer X-axis motion
    accelY R g float Accelerometer Y-axis motion
    accelZ R g float Accelerometer Z-axis motion
    gyroX R deg/sec float Gyroscope X-axis rotation
    gyroY R deg/sec float Gyroscope Y-axis rotation
    gyroZ R deg/sec float Gyroscope Z-axis rotation
    magX R uT float Magnetometer X-axis magnetic field
    magY R uT float Magnetometer Y-axis magnetic field
    magZ R uT float Magnetometer Z-axis magnetic field
    light R Lux float Light sensor illuminance
    battery R mV float Battery voltage level
    key1 R state int Push button 1 key value
    key2 R state int Push button 1 key value
    reed R state int Magnet reed relay state value
    buzzer RW state int Buzzer on/off
    LED1 RW state int LED1 state on/off
    LED2 RW state int Buzzer on/off
    Radio R string string Radio interface(BLE/Wifi)
    (0) 
  9. Sri Jayant Singh

    Hi Michael,

    Thanks for the post, it is amazingly descriptive,

    Just that i need some help configuring my TI sensor app on android phone, for my sensor to communicate with HCP IOT service, well is configuration, same as the IOS, as explained in the post ?

    I have tried using the same syntax to create a thing and, use it in the custom cloud option on the Android app by TI, it wont throw me any error, but i don’t even get any data on my HANA database.

        

     

    Regards,

    Srijayant

    (0) 
    1. Anton Levin

      Hello Srijayant,

      this blog explains how to use TI SensorTag in a combination with IoTSensor app by itelligence AG (iOS app) to send data to the SAP Cloud Platform Internet of Thing. The native Simplelink SensorTag Android app you try to use does not support SAP Cloud Platform connectivity and also the mentioned above “quick link” syntax.

      Regards, Anton

      (0) 
  10. Flavio Molina

    Hi Michael,

    Thanks for this blog, I really was finding some think like this.

    I have see other tutorial where IOT services are created directly on HANA  DP (By Eclipse).

    Im really wold like understand the options to do this. Can you please put some lights on this and clarify  the differences btw the method presented here an this other? In additional what is the recommended approach.

     

    For reference IOT integration using HANA DB:

    (0) 
    1. Anton Levin

      Dear Christian,

      please familiarize yourself with the Community Rules of Engagements [1] and especially with:

      #9 do not cross post – you asked the same question here and in [2] thread
      #13 do not hijack – this blog describes completely different scenario to what you try to ask

      Regards,
      Anton (Moderator)

      [1] https://www.sap.com/community/about/rules-of-engagement.html 
      [2] https://answers.sap.com/questions/298564/its-possible-to-use-sensortag-2650-iot-services-of.html?childToView=301112#comment-301112 

      (1) 

Leave a Reply