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.
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:
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.
Then you decide whether you want to create one thing or several things in bulk. For demonstration purposes we create one thing:
The minimum information you should provide to create a thing is its name:
On the next step of the thing creation, you should generate a certificate to authenticate your device's connection to AWS IoT:
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.
This is our newly created thing:
Next, we need to create a policy to define things permission to access AWS IoT resources. Go to Secure -> Policies -> Create a policy:
For ease of demonstration we can simply grant full access:
And here’s our policy
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:
Pick the policy we’ve created and click Attach:
Then we follow a similar process to attach a thing - click on the three dots for the certificate and select Attach thing:
Pick the thing we’ve created and click Attach:
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.
Flespi AWS stream configuration
Back to flespi now. We are ready to create an aws_iot stream.
Go to Telematics hub -> Streams -> green “+” button.
Give your stream a name.
Pick the “aws_iot” protocol ID.
Find the Endpoint in the AWS IoT Console -> Settings.
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:
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:
If you switch back to the Toolbox tab after that, you should see the confirmation that the messages are dispatching to AWS:
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:
If your device is actively sending new messages, you should shortly see them here:
Now that the device data is in the AWS thing, you can process and handle it as per your business needs.