Skip to Content
0

SCP IoT - Posting message(HTTP API) is failing

Jun 16, 2017 at 08:21 AM

67

avatar image
Former Member

Hi,

I somehow cannot post the data. I tried it via the HTTP client as well as the Java program. The return code is 202, which means accepted but not sure why the data is not getting posted.

Steps are pretty straigtforward

1. https://iotmmspNNNNNNNNNtrial.hanatrial.ondemand.com/com.sap.iotservices.mms/v1/api/http/data/device-id

2. {"mode":"async","messageType":"ID(and not the name)","messages":[{"value":30}]}

3 Device token used for the Java program

I have in the past(more than an year ago) tried posting data to the IoT devices registered on the SAP Cloud Platform all worked fine. Have successfully posted earlier(early 2016) via HTTP Client, Java Program, ESP8266 arduino board, etc

Would someone know what could be the issue?

Thanks

Jayant

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
avatar image
Former Member Jun 16, 2017 at 11:39 AM
0

Thanks guys!! Good to know the community is very active..

The issue was due to custom Authentication i had done for some other work in the past. On switching to the default one, all seems OK.

Share
10 |10000 characters needed characters left characters exceeded
Frank Schuler
Jun 16, 2017 at 08:37 AM
-1

Hello Kumar,

Please have a look at a respective blog of mine:

Analyse your Raspberry Pi I2C sensor data with the HANA Cloud Platform, predictive services

The Java code in there works and posts sensor data to the SCP as we speak.

Best regards

Frank

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Frank,

Thanks for the response. My original code was on the similar lines. Just to give it a try i still took your Java code and ran it(after entering my part) and it comes back with the same issues

code 500 for sync mode and 202 for async mode.

I suspect there is some default setting that needs to be changed to get this working.

Cheers,

Jayant

0
Anton Levin
Jun 16, 2017 at 09:48 AM
0

Hello Kumar, without seeing the logs or knowing your account ID (to see the logs remotely) it is hard to say what might went wrong. I have sent you a direct message asking for your account ID (if you do not want to share it in here). Regards, Anton

Share
10 |10000 characters needed characters left characters exceeded