Skip to content

aws-samples/aws-mqtt-wavelength-latency

Wavelength MQTT Latency Tester

This Android application is purpose-built to test 5G roundtrip latency to EC2 MQTT brokers in a Wavelength zone. This application will all the user to connect to two separate MQTT brokers (Mosquitto is supported). We recommend implementing a Wavelength instance and a Region Instance. The application will then connect to both brokers and send threaded packets with the location of the 5G device included in the payload. This data can then be sent to IoT Core to be displayed on a Grafana instance for latency over time or on a map. This workshop provides that implementation setup.

Prerequisites

The following libraries are required to run this Android application:

Make sure you have the following installed:

Install the following (if not already installed):

npm install -g @aws-amplify/cli

Now it's time to setup the Amplify CLI. Configure Amplify by running the following command:

amplify configure

amplify configure will ask you to sign into the AWS Console.

We will finalized setup of Amplify later when we want to add Amplify CLI Authentication to the Android application

Setup MQTT Brokers

Installing and configuring your Mosquitto brokers is outside the scope of this guide, but this AWS Wavelength Workshop provides an overview of installation and configuration.

Once your EC2 Instances are setup, you will need the public DNS of each one to configure in the strings.xml resource file.

Please note two MQTT brokers are not required

Edit the app -> res -> values -> strings.sample.xml and rename to strings.xml

Edit the app -> res -> values -> strings.xml and replace your EC2 endpoint

<string name="iot_endpoint_mosquito">tcp://ec2-11-222-33-444.us-west-2.compute.amazonaws.com:1883</string>
<string name="iot_endpoint_mosquito_2">tcp://ec2-11-222-33-445.compute-1.amazonaws.com:1883</string>

Additionally, replace the username and password with the values you set for your MQTT implementation on the EC2 Instances

    <string name="iot_username">InsertMQTTUsernameHere</string>
    <string name="iot_password">InsertPasswordHere</string>

Setup IoT Core Connectivity

The application provides the ability to send the results of a latency test to IoT Core. There are numerous downstream services provided by AWS that can ingest the data, but utilizing AWS IoT Core -> Timestream -> Grafana to see impact of latency against time and location is the easiest way to visualize the data.

To start, your unique AWS IoT Core endpoint needs to be updated in strings.xml


About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages