0

i finished 2 days trying to search and solve my problem but no result, i wish i can get some help from you. i am pushing data from local pc running KEPServerEX to AWS IoT Core using MQTT Agent. i can see the data updating on AWS without issue. Then i created a DB and table on TimeStream called respectively Kep_DB & Table_Kep1. my issue is that i am trying to create a Rule on AWS IoT Core to send data to the DB table. a rule to work it require to create an SQL like statement and Dimensions.

below what i have tried:

`SELECT (SELECT v FROM values) as value FROM 'iotgateway'`

Then as dimension i put 1 dimension like below:

name: id value: ${id}

my pyload on AWS IoT Core is having this format:

`{
  "timestamp": 1668852877344,
  "values": [
    {
      "id": "Simulation Examples.Functions.Random1",
      "v": 7,
      "q": true,
      "t": 1668852868880
    },
    {
      "id": "Simulation Examples.Functions.Ramp2",
      "v": 161,
      "q": true,
      "t": 1668852868880
    },
    {
      "id": "Simulation Examples.Functions.Sine4",
      "v": 39.9302559,
      "q": true,
      "t": 1668852868880
    }
]}`

I am still not able to see to data coming to my DB even i tried several dimension name and several SQL statement format.

Any experience on this please ?

  • Are you sure the role in the iot rule has the permission to write into TimeStream? Also, I don’t think iot rule supports writing into timestream with a batch of values. – brushtakopo Nov 19 '22 at 10:28
  • I have test the role and it's okey. To test it I have published a simple value to the DB using simple flat JSON. Now since my real json is nested so i am suspecting either the sql statement format or the dimension value format. – Abdelmoula Nov 19 '22 at 11:51
  • I’d suggest to ingest data into Kinesis Data Stream from aws iot rule. Connect a lambda to Kinesis Data Stream to ingest data in batch into TimeStream. You would have more flexibility by using lambda than iot rule. – brushtakopo Nov 19 '22 at 15:09

0 Answers0