Test connectivity with your device data endpoint
This topic describes how to test a device's connection with your account's device data endpoint, the endpoint that your IoT devices use to connect to AWS IoT.
Perform these procedures on the device that you want to test or by using an SSH terminal session connected to the device you want to test.
To test a device's connectivity with your device data endpoint.
Find your device data endpoint
This procedure explains how to find your device data endpoint in the AWS IoT console
To find your device data endpoint
-
In the AWS IoT console
, near the bottom of the navigation pane, chooseSettings. -
In the Settings page, in the Device data endpoint container, locate the Endpoint value and copy it. Your endpoint value is unique to your AWS account and is similar to this example:
a3qEXAMPLEsffp-ats.iot.eu-west-1.amazonaws.com
. -
Save your device data endpoint to use in the following procedures.
Test the connection quickly
This procedure tests general connectivity with your device data endpoint, but it doesn't test the specific port that your devices will use. This test uses a common program and is usually sufficient to find out if your devices can connect to AWS IoT.
If you want to test connectivity with the specific port that your devices will use, skip this procedure and continue to Get the app to test the connection to your device data endpoint and port.
To test the device data endpoint quickly
-
In a terminal or command line window on your device, replace the sample device data endpoint (
) with the device data endpoint for your account, and then enter this command.a3qEXAMPLEsffp-ats.iot.eu-west-1.amazonaws.com
-
If
ping
displays an output similar to the following, it connected to your device data endpoint successfully. While it didn't communicate with AWS IoT directly, it did find the server and it's likely that AWS IoT is available through this endpoint.PING a3qEXAMPLEsffp-ats.iot.eu-west-1.amazonaws.com (xx.xx.xxx.xxx) 56(84) bytes of data. 64 bytes from ec2-EXAMPLE-218.eu-west-1.compute.amazonaws.com (xx.xx.xxx.xxx): icmp_seq=1 ttl=231 time=127 ms 64 bytes from ec2-EXAMPLE-218.eu-west-1.compute.amazonaws.com (xx.xx.xxx.xxx): icmp_seq=2 ttl=231 time=127 ms 64 bytes from ec2-EXAMPLE-218.eu-west-1.compute.amazonaws.com (xx.xx.xxx.xxx): icmp_seq=3 ttl=231 time=127 ms 64 bytes from ec2-EXAMPLE-218.eu-west-1.compute.amazonaws.com (xx.xx.xxx.xxx): icmp_seq=4 ttl=231 time=127 ms 64 bytes from ec2-EXAMPLE-218.eu-west-1.compute.amazonaws.com (xx.xx.xxx.xxx): icmp_seq=5 ttl=231 time=127 ms
If you are satisfied with this result, you can stop testing here.
If you want to test the connectivity with the specific port used by AWS IoT, continue to Get the app to test the connection to your device data endpoint and port.
-
If
ping
didn't return a successful output, check the endpoint value to make sure you have the correct endpoint and check the device's connection with the internet.
Get the app to test the connection to your device data endpoint and port
A more thorough connectivity test can be performed by using nmap
.
This procedure tests to see if nmap
is installed on your
device.
To check for nmap
on the device
-
In a terminal or command line window on the device you want to test, enter this command to see if
nmap
is installed.nmap --version
-
If you see an output similar to the following,
nmap
is installed and you can continue to Test the connection to your device data endpoint and port.Nmap version 6.40 ( http://nmap.org ) Platform: x86_64-koji-linux-gnu Compiled with: nmap-liblua-5.2.2 openssl-1.0.2k libpcre-8.32 libpcap-1.5.3 nmap-libdnet-1.12 ipv6 Compiled without: Available nsock engines: epoll poll select
-
If you don't see a response similar to the one shown in the preceding step, you must install
nmap
on the device. Choose the procedure for your device's operating system.
Test the connection to your device data endpoint and port
This procedure tests your IoT device's connection to your device data endpoint using your selected port.
To test your device data endpoint and port
-
In a terminal or command line window on your device, replace the sample device data endpoint (
) with the device data endpoint for your account, and then enter this command.a3qEXAMPLEsffp-ats.iot.eu-west-1.amazonaws.com
nmap -p 8443
a3qEXAMPLEsffp-ats.iot.eu-west-1.amazonaws.com
-
If
nmap
displays an output similar to the following,nmap
was able to connect successfully to your device data endpoint at the selected port.Starting Nmap 7.92 ( https://nmap.org ) at 2022-02-18 16:23 Pacific Standard Time Nmap scan report for a3qEXAMPLEsffp-ats.iot.eu-west-1.amazonaws.com (xx.xxx.147.160) Host is up (0.036s latency). Other addresses for a3qEXAMPLEsffp-ats.iot.eu-west-1.amazonaws.com (not scanned): xx.xxx.134.144 xx.xxx.55.139 xx.xxx.110.235 xx.xxx.174.233 xx.xxx.74.65 xx.xxx.122.179 xx.xxx.127.126 rDNS record for xx.xxx.147.160: ec2-EXAMPLE-160.eu-west-1.compute.amazonaws.com PORT STATE SERVICE 8443/tcp open https-alt MAC Address: 00:11:22:33:44:55 (Cimsys) Nmap done: 1 IP address (1 host up) scanned in 0.91 seconds
-
If
nmap
didn't return a successful output, check the endpoint value to make sure you have the correct endpoint and check your device's connection with the internet.
You can test other ports on your device data endpoint, such as port 443, the
primary HTTPS port, by replacing the port used in step 1,
, with the port that you want to
test.8443