If you use a device SDK, IoT Platform SDK, or Advanced Message Queuing Protocol (AMQP) SDK, you must specify the endpoint of the instance to which you want to connect your device. This topic describes how to obtain the endpoint of an instance.
Prerequisites
Instance | Region | Description | Operation |
---|---|---|---|
Public instance of the old version | China (Shanghai) and Japan (Tokyo) |
On the Overview page of the IoT Platform console, no specific instance ID is displayed. In addition, you cannot click an instance to go to the Instance Details page. Note You cannot create public instances of the new version in the Japan (Tokyo) region.
All public instances in this region are of the old version.
|
In this case, you cannot view the development configurations of an instance in the IoT Platform console. This topic describes all endpoint information that is required to connect your device to IoT Platform. For more information, see the "View the endpoint of a public instance of the old version" section of this topic. |
Singapore, Germany (Frankfurt), US (Silicon Valley), and US (Virginia) |
If no Enterprise Edition instance is available, a public instance of the old version is used, and the Overview page is not displayed in the IoT Platform console. |
||
Public instance of the new version | China (Shanghai) |
On the Overview page of the IoT Platform console, an instance ID is displayed. You can click an instance to go to the Instance Details page. |
On the Instance Details page of the IoT Platform console, you can click View Development Configurations in the upper-right corner to open the Development Configurations panel that displays the endpoint information. For more information, see the "View the endpoint information of a public instance of the new version or an Enterprise Edition instance" section of this topic. |
Enterprise Edition instance | China (Shanghai) and Japan (Tokyo) |
Background information
For information about how to use SDKs, see Download device SDKs, Download IoT Platform SDKs, and Connect an AMQP client to IoT Platform.
Usage notes
- If you use AMQP-based server-side subscriptions or call IoT Platform API operations to connect devices to an IoT Platform instance over the Internet by using Message Queuing Telemetry Transport (MQTT), Constrained Application Protocol (CoAP), or HTTP, you must specify a public endpoint when you configure the devices.
- If you use AMQP-based server-side subscriptions or call IoT Platform API operations to connect devices to an IoT Platform instance over a virtual private cloud (VPC) by using MQTT, you must specify a VPC endpoint when you configure the devices.
- If you want to connect devices to an Enterprise Edition instance by using MQTT, you can bind a fixed IP address to the instance endpoint.
View the endpoint of a public instance of the old version
Communication type | Endpoint format | Port number |
---|---|---|
MQTT | ${YourProductKey}.iot-as-mqtt.${YourRegionId}.aliyuncs.com |
1883 or 443.
If MQTT over WebSocket is used, set this parameter to 443. |
CoAP | ${YourProductKey}.coap.cn-shanghai.link.aliyuncs.com |
|
HTTP | https://iot-as-http.${YourRegionId}.aliyuncs.com |
Set this parameter to 443. |
AMQP | ${uid}.iot-amqp.${YourRegionId}.aliyuncs.com |
|
IoT Platform API request | The syntax of API requests is http://Endpoint/?Action=**&Parameters . For more information, see Initiate API requests.
|
N/A |
Specify the following parameters based on your business requirements:
Parameter | Description |
---|---|
${YourProductKey} |
The ProductKey of the product to which the device belongs. You can log on to the IoT Platform console and obtain the ProductKey on the Device Details page of the instance. |
${YourRegionId} |
The ID of the region in which your device resides. For information about the format of region IDs, see Supported regions. |
${uid} |
The ID of your Alibaba Cloud account. You can log on to the IoT Platform console, and move the pointer over the profile picture to view the account ID. |
View the endpoint of a public instance of the new version or an Enterprise Edition instance
Bind a fixed IP address to an endpoint
Fixed IP addresses prevent your Domain Name System (DNS) records from being updated when IoT Platform expands the list of IP addresses. If you use IoT cards and your carrier does not support endpoints, you can add your fixed IP address to the list of directional IP addresses of the carrier.
We recommend that you use endpoints to connect your device to IoT Platform. This way, you are notified before an IP address is changed.
To bind fixed IP addresses to the endpoint that devices access over the Internet by using Message Queueing Telemetry Transport (MQTT), perform the following steps: You can allocate two fixed IP addresses to each MQTT device.
- In the upper-right corner of the Instance Details page of an instance, click View Development Configurations.
- In the Development Configurations panel, click Configure to the right of Fixed IP on the MQTT tab.
- In the dialog box that appears, click OK to obtain two fixed IP addresses.
If an MQTT device no longer require fixed IP addresses, click Unbind.