Getting started with AWS IOT Core

Hi,

I am new to ubidots, still trying to get the process working. I think I have the access setup correctly…

  1. In AWS IoT the ‘Destinations’ points to a ubidots https URL and shows as active.
  2. In ubidots the AWS IoT Core plugin is setup and the status is running.

So, I think the ‘plumbing’ should all be correct.

Now I am sending a message from the AWS IoT Core test console by publishing the test payload from $aws/things/RaspberryPi/shadow/update. I know AWS sends the test message because I also subscribe to that same message on the AWS test console.

But that message doesn’t seem to ever be received by ubidots. Under devices all I see is ‘you have yet to create a device’. But I understood a new device will be automatically created by ubidots.

So, what am I missing :thinking:. Appreciate any help, guidance or suggestions for other things to try out. It looks like a great tool for my application but having some issues getting it working.

Thanks,

JT

This is the ‘default’ message payload that I expected to see in ubidots.
{
“state”: {
“reported”: {
“temperature”: 23,
“humidity”: 55
}
}
}

Quick update…

If I use $aws/things/aws-iot-test-device/shadow/update to publish a message I do see a device added but I can’t find any payload data for that message. How is the received payload viewed?

Publishing from my actual device shadow $aws/things/RaspberryPi/shadow/update does not add a new device. No differences between the two published messages other than the specific device.

JT

Greetings @JustTinkering,

I hope this message finds you well. I’ve looked into the issue you’re experiencing with AWS IoT data integration and I believe I’ve pinpointed the solution.

I think you should be seeing a device as the screenshot below show:

From the screenshots above, it’s clear that you are successfully receiving data from AWS. However, the data still needs to be decoded into a format that Ubidots can interpret and display on the required device.

The key to resolving this lies in the “Decoder” tab of the Ubidots plugin. This feature is designed to extract and format the data appropriately:

For example, consider the following payload sent from the AWS MQTT test client tool:

{ 
    "state": {
        "reported": {
            "temperature": 23, 
            "humidity": 55
        } 
    }
}

Upon receiving the arguments within the Ubidots plugin, it will look like:

{
   "device":"aws-iot-test-device",
   "payload":{
      "state":{
         "reported":{
            "humidity":55,
            "temperature":23
         }
      }
   }
}
     

Our objective is to display the humidity and temperature data on a specific device. To achieve this, the data must be formatted within the plugin as follows:

payload = {
    "temperature": temperature,
    "humidity": humidity 
}

Therefore, in your particular case, you should set the plugin’s decoder to:

def decode(args):
    print("Arguments received in decode function", args)
    device_label = args.get("device")
    payload = {"temperature": args["payload"]["state"]["reported"]["temperature"],
               "humidity": args["payload"]["state"]["reported"]["humidity"] }
    return {"device_label": device_label, "payload": payload}

This setup will ensure the data is correctly extracted and displayed on the Ubidots device, as shown in the following screenshot:

For this demonstration, I used the topic $aws/things/aws-iot-test-device/shadow/update, but it’s adaptable to any device label. Here’s an example of another device on Ubidots displaying data sent to the topic $aws/things/other-device/shadow/update:

In summary, you were missing the data decoding.

I hope this clarifies the process and resolves your issue. Please don’t hesitate to reach out if you have any further questions or need additional assistance.

–Juan David Tangarife H.

This 3-minute video shows it working end-to-end.

At 1:25 in the video it shows the AWS IoT plugin Configuration.