The GeekOpen MTQTT socket developed in actual IoT project is connected to the Alibaba Cloud platform in 10 minutes

GeekOpen smart socket is created by the Geek Intelligent Hardware Application Club. Related products include smart switches, smart sockets, smart breakers and other products. It supports access to third-party cloud platforms such as Alibaba Cloud, Tianyi Cloud, Tencent Cloud, Huawei Cloud, etc. Self-built servers are also supported. The device is connected to the GeekOpen cloud platform by default when shipped from the factory. This article mainly introduces how to connect the socket to the Alibaba Cloud IoT platform and achieve intelligent control.

Chapter 1: First understand what Alibaba Cloud IoT Platform is

Alibaba Cloud IoT platform is an integrated platform that integrates device management, data security communication, message subscription and data services. It supports connecting to a large number of devices downwards and collects device data to the cloud; it provides cloud API upwards, and the server can issue instructions to the device by calling the cloud API to achieve remote control. For details, see Alibaba Cloud IoT Platform .

How does device access to Alibaba Cloud work?

Chapter 2 GeekOpen IoT device access steps

1. Register

Register an Alibaba Cloud account, log in to Alibaba Cloud, and log in to Alibaba Cloud .

2. Enter the Alibaba Cloud console

Search for the IoT platform on the Alibaba Cloud homepage and click on the management console.

3. Apply for public examples

When you apply for a public instance for the first time, you need to wait for a moment to activate it and click to enter the public instance.

4. Create products

Enter the main interface of the console, click Device Management->Products, and click Create Product.

5. Fill in the product parameters

In the new product, fill in the instructions in order, as shown in the picture below. You only need to fill in the following five items.

6. Add device

After filling in, click Confirm to enter the product creation page, click Add Device -> Go to Add.

Click Add Device, enter the device name, note that the name cannot be in Chinese, and click Confirm after filling in.

After clicking Confirm, you can view the device information:

[Remarks] The equipment needs to be purchased by the user first. The product link used in the operation guide:

Smart mini socket:

https://item.taobao.com/item.htm?spm=a1z10.3-cs.w4023-24816240193.8.14d67d01QDOjaR&id=728813143446 Type 86 smart socket:

https://item.taobao.com/item.htm?ft=t&id=703031801152

7. View device details and record key device information

After the device is added, it is in an inactive state. Click the [View] button to view the device details.

Click the [View] button on the device details page. The page displays MQTT connection information.

Click one-click copy and use Notepad to record the MQTT connection information.

8. Create subscription and publish topics

Click on the Topic list and you will find that the list is empty at this time. We need to create a subscription and publish the Topic.

Click on the product, select the device you just added and click [View]:

Follow the instructions below to customize the Topic

9. Add publishing theme

10. Add subscription topic

The definition is completed as follows, ${deviceName} represents the name of the device created previously:

Based on the above information, use tools or small programs to send customized information to the device. Note that the publication and subscription topics are inverse, that is, the publication of the device corresponds to the subscription of the cloud platform, and the publication of the cloud platform corresponds to the subscription of the device.

11. The connection is successful and the device is online

Use the restart command to restart the device. The device disconnects from the GeekOpen cloud platform that is connected by default and connects to the Alibaba Cloud IoT platform. At this time, the Alibaba Cloud IoT platform device appears online.

12.Control equipment

Publish the device control command defined by GeekOpen in the subscribed topic to control the device connected to Alibaba Cloud, and the connection is successful.

All devices developed by GeekOpen support docking with third-party cloud platforms and can be integrated into various scenarios such as shared tea rooms, self-service chess and card rooms, gyms, shared appliances, QR code charging, etc. Products that support such scenarios include:

Type 86 smart socket: https://item.taobao.com/item.htm?ft=t&id=703031801152 icon-default.png?t=N7T8https://item.taobao.com/item.htm?ft=t&id=703031801152

mini smart socket:

https://item.taobao.com/item.htm?spm=a1z10.3-c-s.w4023-24816240193.8.14d67d01QDOjaR&id=728813143446icon-default.png?t=N7T8https://item.taobao.com/item.htm?spm=a1z10.3-c-s.w4023-24816240193.8.14d67d01QDOjaR&id=728813143446

Type 86 intelligent zero fire switch: https://item.taobao.com/item.htm?ft=t&id=701109818673 icon-default.png?t=N7T8https://item.taobao.com/item.htm?ft=t&id=701109818673

For more information, you can visit our official website to understand and communicate:

GeekOpen intelligent hardware open platform supports secondary software development and hardware customization development!

This article is only for learning and use by friends who need it. If you are unclear about it, you can leave a message. Please include any inappropriate information.

Guess you like

Origin blog.csdn.net/ligongzhikong/article/details/133313211
Recommended