Page 1 of 1

connecting to AWS

Posted: Tue Aug 02, 2016 9:02 am
by julian
Hi guys,

I am glad that we have a AWS connector.
Amazon is used to make things easy but this time I think that I am doing something wrong.

At first, I connect the credentials and cert, everything looks ok. From the log everything looks working (meshlium log level 4 at the end)

Then, as you can see in the atchments and logs, looks like AWS is receiving the data but I can not gather them either from the mqtt client either from any filter.

Any clue about what I am doing wrong?

Screenshots:
https://www.dropbox.com/s/gz63rdc3ep67z ... 0.png?dl=0
https://www.dropbox.com/s/3oyrlv90tzagi ... 5.png?dl=0
https://www.dropbox.com/s/6ysu27rstxv4c ... 5.png?dl=0
https://www.dropbox.com/s/zg0glcj2pd87d ... 8.png?dl=0


Meshlium AWS Log

Code: Select all

Publish done
Executing query: UPDATE MeshliumDB.sensorParser SET sync=0|33554432 WHERE id=34283
Mark as sync
Sending message 10 ....
Topic: $aws/things/acuasensor1/shadow/update
Message: {
"id": "34282",
"id_wasp": "Meshlium",
"id_secret": "403473517",
"sensor": "DO",
"value": "19.3",
"datetime": "2016-08-02 06:17:10"
}

Publish done
Executing query: UPDATE MeshliumDB.sensorParser SET sync=0|33554432 WHERE id=34282
Mark as sync
Sending message 11 ....
Topic: $aws/things/acuasensor1/shadow/update
Message: {
"id": "34281",
"id_wasp": "Meshlium",
"id_secret": "403473517",
"sensor": "TIME",
"value": "Thu, 00/04/05, 00",
"datetime": "2016-08-02 06:17:10"
}

Publish done
Executing query: UPDATE MeshliumDB.sensorParser SET sync=0|33554432 WHERE id=34281
Mark as sync
Sending message 12 ....
Topic: $aws/things/acuasensor1/shadow/update
Message: {
"id": "34280",
"id_wasp": "Meshlium",
"id_secret": "403473517",
"sensor": "PH",
"value": "-1.44",
"datetime": "2016-08-02 06:17:10"
}

Publish done
Executing query: UPDATE MeshliumDB.sensorParser SET sync=0|33554432 WHERE id=34280
Mark as sync
Sending message 13 ....
Topic: $aws/things/acuasensor1/shadow/update
Message: {
"id": "34279",
"id_wasp": "Meshlium",
"id_secret": "403473517",
"sensor": "TCB",
"value": "19.83",
"datetime": "2016-08-02 06:17:10"
}

Publish done
Executing query: UPDATE MeshliumDB.sensorParser SET sync=0|33554432 WHERE id=34279
Mark as sync
Sending message 14 ....
Topic: $aws/things/acuasensor1/shadow/update
Message: {
"id": "34278",
"id_wasp": "Meshlium",
"id_secret": "403473517",
"sensor": "BAT",
"value": "72",
"datetime": "2016-08-02 06:17:10"
}

Publish done
Executing query: UPDATE MeshliumDB.sensorParser SET sync=0|33554432 WHERE id=34278
Mark as sync
Log events fo acuasensor 1

Code: Select all

2016-08-02 06:45:53.949 TRACEID:675a08d6-5dfd-4a43-9d23-a8f06023c456 PRINCIPALID:acuasensor1 [INFO] EVENT:UpdateThingShadow TOPICNAME:$aws/things/acuasensor1/shadow/update THINGNAME:acuasensor1

2016-08-02 06:45:53.949 TRACEID:675a08d6-5dfd-4a43-9d23-a8f06023c456 PRINCIPALID:acuasensor1 [ERROR] EVENT:UpdateThingShadow TOPICNAME:$aws/things/acuasensor1/shadow/update THINGNAME:acuasensor1 ERRORCODE:400 MESSAGE:Missing required node: state

2016-08-02 06:45:54.155 TRACEID:3a426e40-6b6b-4653-a55a-ba4e36f7d47d PRINCIPALID:acuasensor1 [INFO] EVENT:UpdateThingShadow TOPICNAME:$aws/things/acuasensor1/shadow/update THINGNAME:acuasensor1

2016-08-02 06:45:54.155 TRACEID:3a426e40-6b6b-4653-a55a-ba4e36f7d47d PRINCIPALID:acuasensor1 [ERROR] EVENT:UpdateThingShadow TOPICNAME:$aws/things/acuasensor1/shadow/update THINGNAME:acuasensor1 ERRORCODE:400 MESSAGE:Missing required node: state

2016-08-02 06:45:54.592 TRACEID:4d0f54f0-f9f6-46c8-a61f-4f150f3d1283 PRINCIPALID:acuasensor1 [INFO] EVENT:UpdateThingShadow TOPICNAME:$aws/things/acuasensor1/shadow/update THINGNAME:acuasensor1

Log Events For 4c708e2bc346c5cdd6a411340a9dc049c85e0f828ab399a8e643d63e81dab51d

Code: Select all

2016-08-02 06:56:55.266 TRACEID:b44d0f9d-707d-47e3-b4d0-02097e11279d PRINCIPALID:4c708e2bc346c5cdd6a411340a9dc049c85e0f828ab399a8e643d63e81dab51d [ERROR] EVENT:CloudwatchMetricActionFailure TOPICNAME:$aws/things/acuasensor1/shadow/update CLIENTID:$GEN/366a6ba7-7393-4966-b5d1-2cdf87d080ff MESSAGE:Failed to publish Cloudwatch metric. The error received was For input string: "value". Message arrived on: $aws/things/acuasensor1/shadow/update, Action: cloudwatchMetric

2016-08-02 06:56:55.267 TRACEID:b44d0f9d-707d-47e3-b4d0-02097e11279d PRINCIPALID:4c708e2bc346c5cdd6a411340a9dc049c85e0f828ab399a8e643d63e81dab51d [ERROR] EVENT:DynamoActionFailure TOPICNAME:$aws/things/acuasensor1/shadow/update CLIENTID:$GEN/366a6ba7-7393-4966-b5d1-2cdf87d080ff MESSAGE:Dynamo Insert record failed. The error received was null. Message arrived on: $aws/things/acuasensor1/shadow/update, Action: dynamo, Table: sensorglobe, HashKeyField: id, HashKeyValue: TCBsensorTEST, RangeKeyField: None, RangeKeyValue: 1470121015263

2016-08-02 06:56:55.269 TRACEID:b44d0f9d-707d-47e3-b4d0-02097e11279d PRINCIPALID:4c708e2bc346c5cdd6a411340a9dc049c85e0f828ab399a8e643d63e81dab51d [ERROR] EVENT:DynamoActionFailure TOPICNAME:$aws/things/acuasensor1/shadow/update/rejected CLIENTID:n/a MESSAGE:Dynamo Insert record failed. The error received was null. Message arrived on: $aws/things/acuasensor1/shadow/update/rejected, Action: dynamo, Table: sensorglobe, HashKeyField: id, HashKeyValue: TCBsensorTEST, RangeKeyField: None, RangeKeyValue: 1470121015267

2016-08-02 06:56:55.289 TRACEID:b44d0f9d-707d-47e3-b4d0-02097e11279d PRINCIPALID:4c708e2bc346c5cdd6a411340a9dc049c85e0f828ab399a8e643d63e81dab51d [INFO] EVENT:KinesisActionSuccess TOPICNAME:$aws/things/acuasensor1/shadow/update/rejected CLIENTID:n/a MESSAGE:Successfully published Kinesis message. Message arrived on: $aws/things/acuasensor1/shadow/update/rejected, Action: kinesis, Name: SENSORGLOBE, PartitionKey: a52aad64-13c4-4740-889a-44bff79c5981, ShardId: shardId-000000000000, Sequence number: 49564413043844335886639249172309383477487917268090224642

2016-08-02 06:56:55.326 TRACEID:b44d0f9d-707d-47e3-b4d0-02097e11279d PRINCIPALID:4c708e2bc346c5cdd6a411340a9dc049c85e0f828ab399a8e643d63e81dab51d [INFO] EVENT:KinesisActionSuccess TOPICNAME:$aws/things/acuasensor1/shadow/update CLIENTID:$GEN/366a6ba7-7393-4966-b5d1-2cdf87d080ff MESSAGE:Successfully published Kinesis message. Message arrived on: $aws/things/acuasensor1/shadow/update, Action: kinesis, Name: SENSORGLOBE, PartitionKey: 4cc654c4-5eee-4558-be50-4930bc548c37, ShardId: shardId-000000000000, Sequence number: 49564413043844335886639249172331144142240980593234935810

2016-08-02 06:56:55.435 TRACEID:33538741-e855-48df-b78a-708dc892f9d0 PRINCIPALID:4c708e2bc346c5cdd6a411340a9dc049c85e0f828ab399a8e643d63e81dab51d [INFO] EVENT:PublishEvent TOPICNAME:$aws/things/acuasensor1/shadow/update MESSAGE:PublishIn Status: SUCCESS

2016-08-02 06:56:55.470 TRACEID:33538741-e855-48df-b78a-708dc892f9d0 PRINCIPALID:4c708e2bc346c5cdd6a411340a9dc049c85e0f828ab399a8e643d63e81dab51d [INFO] EVENT:MatchingRuleFound TOPICNAME:$aws/things/acuasensor1/shadow/update CLIENTID:$GEN/366a6ba7-7393-4966-b5d1-2cdf87d080ff MESSAGE:Matching rule found: TCB


Re: connecting to AWS

Posted: Tue Aug 02, 2016 9:54 am
by libelium-dev
Hi julian,

You should configure your amazon MQTT client. Please follow these steps:

1. In the AWS IoT console, choose “MQTT Client”, type in the “client ID” your AWS AWS iot mqtt client id, and then choose Connect.

2. Now you will subscribe to the topic on which your thing publishes. Choose “Subscribe to topic”, and in Subscription topic, type the previously annotated MQTT Topic, and then choose “Subscribe”.

3. Messages from your Meshlium will be displayed in the AWS IoT MQTT client.

Regards

Re: connecting to AWS

Posted: Wed Aug 03, 2016 6:39 am
by julian
Amazing!
It is working

Re: connecting to AWS

Posted: Wed Aug 03, 2016 7:56 am
by libelium-dev
Hi julian,

Glad to heard that! If you have more questions please do not hesitate and drop us a line.

Regards