When you use a device SDK, IoT Platform SDK, or AMQP SDK, you must specify the endpoint of an instance that you want your device to access. This topic describes how to obtain the instance endpoint.

Background information

For more information about instances, see Overview.

For more information about how to use SDKs, see Device SDKs, IoT Platform SDKs, and Connect an AMQP client to IoT Platform.

Usage notes

  • If you have devices that use MQTT, CoAP or HTTP to access IoT Platform instances, devices that use AMQP-based server-side subscription, or devices that call IoT Platform APIs, you must configure the public endpoint for these devices.
  • If you have devices that use MQTT to access IoT Platform instances, devices that use AMQP-based server-side subscription, or devices that call IoT Platform APIs, you must configure the VPC endpoint for these devices.
  • You can bind fixed IP addresses to the endpoint of an Enterprise Edition instance when devices are connected to IoT Platform by using MQTT.

Region

A region is a geographic area where data centers are deployed. The region of an Alibaba Cloud resource cannot be changed after the resource is created. The following table describes the information about all regions of Alibaba Cloud, including the region IDs and the cities where the regions reside.
  • Regions in mainland China
    Region City Region ID Number of zones
    China (Shanghai) Shanghai cn-shanghai 11
  • Regions outside mainland China
    Region City Region ID Number of zones
    Singapore Singapore ap-southeast-1 3
    Japan (Tokyo) Tokyo ap-northeast-1 2
    US (Silicon Valley) Silicon Valley us-west-1 2
    US (Virginia) Virginia us-east-1 2
    Germany (Frankfurt) Frankfurt eu-central-1 3

For more information about region IDs, see Regions and zones.

View the endpoint of a public instance

Notice China East 2 (Shanghai), Singapore, Germany (Frankfurt), US (Silicon Valley), and US (Virginia) do not support the Enterprise Edition instance function. The format of each endpoint is the same as that of each endpoint under the Japan (Tokyo) public instance.
Communication type Endpoint format
MQTT ${YourProductKey}.iot-as-mqtt.${YourRegionId}.aliyuncs.com:1883, where:
  • ${YourProductKey}: Replace this variable with the ProductKey of the product to which your device belongs. You can log on to the IoT Platform console and obtain the value on the device details page of the instance.
  • ${YourRegionId}: Replace this variable with the ID of the region where your IoT Platform device resides. For more information about region IDs, see Region of this article.
CoAP ${YourProductKey}.coap.cn-shanghai.link.aliyuncs.com:${port}, where:
  • ${YourProductKey}: Replace this variable with the ProductKey of the product to which your device belongs. You can log on to the IoT Platform console and obtain the value on the device details page of the instance.
  • ${port}: Specify the port. Port 5684 is used for Datagram Transport Layer Security (DTLS). Port 5682 is used for symmetric encryption.
HTTP https://iot-as-http.${YourRegionId}.aliyuncs.com, where:

${YourRegionId}: Replace this variable with the ID of the region where your IoT Platform device resides. For more information about region IDs, see Region of this article.:

AMQP ${uid}.iot-amqp.${YourRegionId}.aliyuncs.com, where:
  • ${uid}: Replace this variable with the ID of your Alibaba Cloud account. To view your account ID, log on to the IoT Platform console and move the pointer over your profile picture.
  • ${YourRegionId}: Replace this variable with the ID of the region where your IoT Platform device resides. For more information about region IDs, see Region of this article.
API requests The API request is in the http://Endpoint/?Action=**&Parameters format. For more information, see Initiate API requests.

View the endpoint of an Enterprise Edition instance

  1. Log on to the IoT Platform console. In the top navigation bar, select the region where the instance whose details you want to view is located.
    Select a region
  2. On the Instance Overview page, click the instance that you want to manage. The Instance Details page is displayed.
  3. On the Instance Details page, click View Developer Configurations in the upper-right corner. In the Developer Configurations panel that appears, click the MQTT, CoAP, or HTTP tab to view the endpoint based on the protocol that your device uses.
    查看开发配置You can click Copy to copy the instance endpoint. Endpoint

Bind fixed IP addresses to an endpoint

Fixed IP addresses prevent your DNS records from being updated when IoT Platform expands its list of IP addresses. If you use IoT cards and your carrier does not support domain names, you can add your fixed IP address to the directional IP address list of the carrier.

Note The IP address may change due to reasons such as the relocation of the data center of your carrier. If your device accesses a fixed IP address instead of a domain name, you can update the IP address used by your device by sending commands from IoT Platform or performing over-the-air updates. Otherwise, the device cannot connect to IoT Platform.

We recommend that you use domain names to connect your device to IoT Platform. This way, you will be notified before an IP address is changed.

Perform the following steps to bind fixed IP addresses to the endpoint that devices access over Internet by using MQTT.For instances, two fixed IP addresses can be bound to the endpoint.

  1. On the Instance Details page of an instance, click View Developer Configurations in the upper-right corner.
  2. In the Developer Configurations panel, click Settings to the right of Fixed IP address on the MQTT tab. Fixed IP address
  3. In the dialog box that appears, click OK to obtain two fixed IP addresses.

If MQTT devices no longer require the fixed IP addresses, click Unbind.