Automatically translate this page?

How to send IoT/telematics data to Amazon AWS?

Configure a stream to forward device messages from IoT or telematics hardware into the AWS IoT.

Forwarding the data from telematics/IoT devices into the Amazon AWS cloud is a common task which, when complete, opens immense opportunities for handling the data in the Amazon ecosystem. Once the data from your device(s) appears in flespi, sending it to AWS is fast and straightforward.

Prerequisites

  • Flespi channel working over the appropriate protocol to collect the data from your IoT/telematics hardware.

  • Flespi device to have a virtual representation of each physical device in the flespi platform with dedicated long-term storage, access to telemetry, real-time analytics capabilities, and more.

  • Registered account with AWS IoT to set up the receiving side.

AWS IoT thing configuration

On the Amazon side, we start from the AWS Management Console:

aws management console

Go to the Connect an IoT device section.

Once in the AWS IoT section, unfold the Manage left-side menu and select the Things item. Click on the Register a thing button.

aws iot register a thing

Then you decide whether you want to create one thing or several things in bulk. For demonstration purposes we create one thing:

register a single aws iot thing

The minimum information you should provide to create a thing is its name:

aws iot thing config

On the next step of the thing creation, you should generate a certificate to authenticate your device's connection to AWS IoT:

aws iot certificate create

Download all generated files and store them in a safe place. You will need XXXXXXXX-certificate.pem.crt and XXXXXXXX-private.pem.key certificates to configure the aws_iot stream in flespi.

Then click the Activate button to activate the certificate.

Click Done to finalize the thing creation.

aws iot certificate download activate

This is our newly created thing:

aws iot thing created

Next, we need to create a policy to define things permission to access AWS IoT resources. Go to Secure -> Policies -> Create a policy:

aws iot policy create

For ease of demonstration we can simply grant full access:

aws iot policy access rights

And here’s our policy

aws iot policy created

Now we need to attach the policy and the thing to the certificate.

Open Secure -> Certificates. Click on the three dots for the certificate and select Attach policy:

aws iot certificate attach policy

Pick the policy we’ve created and click Attach:

aws iot certificate policy attached

Then we follow a similar process to attach a thing - click on the three dots for the certificate and select Attach thing:

aws iot certificate policy thing attach

Pick the thing we’ve created and click Attach:

aws iot certificate policy thing attached

Fast-forward way to configure a thing

Once in the AWS IoT section, unfold the Onboard left-side menu and select the Get started item. Click on the Get started button for the Onboard a device option.

aws iot onboard a device

Flespi AWS stream configuration

Back to flespi now. We are ready to create an aws_iot stream

Go to Telematics hub -> Streams -> green “+” button.

flespi aws_iot stream create configure

Give your stream a name.

Pick the “aws_iot” protocol ID.

Find the Endpoint in the AWS IoT Console -> Settings.

aws iot settings endpoint

Copy and paste the content of the previously downloaded XXXXXXXX-certificate.pem.crt and XXXXXXXX-private.pem.key files into the certificate and private key fields respectively.

Click Save and the new stream will appear in the streams list. It should turn green shortly.

Click on the newly created stream and go to the Toolbox tab:

flespi aws_iot stream toolbox tab

You should see the “stream connected successfully” log record that means the connection with AWS was established and the stream is ready to send messages.

Now we can assign a device to the stream to start sending messages.

Switch to the Devices tab, click the green “+” button and pick the device you need:

flespi stream assign device

If you switch back to the Toolbox tab after that, you should see the confirmation that the messages are dispatching to AWS:

flespi aws_iot stream toolbox tab sent messages

What’s in AWS?

Go to the Test section, type the MQTT topic we specified in the “aws_iot” stream configuration (we used “test_data”) and click Subscribe to topic:

aws iot mqtt client test subscribe to topic

If your device is actively sending new messages, you should shortly see them here:

aws iot mqtt client message from flespi device

***

Now that the device data is in the AWS thing, you can process and handle it as per your business needs.


See also
Set up HTTP callback to flespi channel to use Sigfox devices in telematics projects.
Detailed logs, real-time & historical messages, intervals, and so much more in a handy and functional interface.