0

Now up to i implement web server in nodejs where continuous script is running and shadow will be update by this giving input as per given by user..

this link is basically for adding canonical headers so shall i add any additional headers??if i am going wrong with this.

This link for web socket communication related to my question

From above two links i understand how i do with this in android mobile but i got same response

Here i used nodeJs for raspberry pi communication.it works fine and update it.

So same from application how to get back shadow??

This image is aws-iot thing shadow update from nodeJs.where there is API created here used for mobile to get results on your mobile

In this image when i hit same api on rest client got error missing authentication token.i used cannonical headers for this but not luck

Community
  • 1
  • 1
sagar potdar
  • 598
  • 1
  • 6
  • 22

2 Answers2

0

You got this example on github explaining how to use ThingShadow from your mobile application. https://github.com/awslabs/aws-sdk-android-samples/blob/master/TemperatureControl/README.md

AWS provides tools to access it.

import com.amazonaws.services.iotdata.AWSIotDataClient;
import com.amazonaws.services.iotdata.model.GetThingShadowRequest;
import com.amazonaws.services.iotdata.model.GetThingShadowResult;
import com.amazonaws.services.iotdata.model.UpdateThingShadowRequest;
import com.amazonaws.services.iotdata.model.UpdateThingShadowResult;
Sven Schoenung
  • 30,224
  • 8
  • 65
  • 70
  • Hello sir,from Temperature control example understand the steps to create iot based application and accessing thing shadow from device. But where do i used aws-iot rest api???means in that application they didn't used of rest api. – sagar potdar Sep 11 '16 at 07:07
0

To interact with AWS IoT Shadow, you have the following options:
1. HTTP using IAM credentials
2. HTTP using X.509 certificate based authentication
3. MQTT endpoint

AWS IoT provides AWS SDKs (HTTP) and AWS IoT Device SDKs (MQTT) to allow you to perform operations on shadow. For more details about restful APIs, please check the following AWS IoT Documentations.

Note that HTTP restful access needs proper authentication and perform SigV4 signing process when using IAM credentials, which is handled by the AWS SDKs for you. If you need to do it manually, you will have to include the required signature into the request.

To get a better support from AWS, I kindly suggest you to open up a thread in AWS Forums. You will get helps and support from the community and developers there.