Connect NodeMcu with Aliyun-IOT
This experiment uses the MQTT protocol, again, I used miropython to write the program to achieve, and ultimately can be added through the Tencent Lianlian WeChat applet to add the device to publish the theme of the message to the Tencent cloud, ESP32 is responsible for subscribing to the Tencent cloud theme message, when a subscription message is received to control the LED lights on the ESP32 device to light up or down.
Create Tencent Cloud products and devices
2、Click the [Products] section and search for [IoT Development Platform], click [Management Console].
3、Click [Public Instances] in Instance Management
4、Click [Product Development] on the left and click [New Product].
5、In the [Product Category] column, select Smart City->Public Utilities->Street Lighting. Fill in the product information, [product name] set to esp_led1, [communication mode] fill in wi-fi, the other defaults do not change click [New Product].
6、Click on the name of the product you just created, esp_led1.Scroll down to the end and click [Next],Click [Module-based development], select [Loxin] for the product platform, select [wifi] for the type, click [Loxin ESP-WROOM-] and click [OK].Scroll down to the end and click [Next].
7、Click [Product Display Configuration] on the right side of the [Configuration], [Product Display Name] set to esp_led1, [Producer Name] for Assurant, [Product Model] to select esp32, click [Save], pull up and click [<-] to return
8、Click [Configuration] on the right side of [Shortcut Entry Configuration], no modification by default, click [Save], scroll up and click [<-] to go back
9、Click [Panel Configuration] on the right side of the [Configuration], the default is not modified, click [Save], click [<-] to return to the
10、Click [Configuration] on the right side of [Network Guidance], select Loxin for [Chip Program Selection], select Smart Config for [Preferred Distribution Mode], select Soft Ap for [Sub-Distribution Mode], click [Save], and click [<-] to return.
11、Click [Sweep product introduction] on the right side of the [Configuration], the default is not modified, click [Save], click [<-] back
12、Click [Smart Linkage Configuration] on the right side of the [Configuration], the default is not modified, click to save, click [<-] return
13、Click [Next].
14、Click [New Device], customize [Device Name] to esp_led1, and click [Save].
15、Click on the [QR code], use the cell phone WeChat applet [Tencent Lianlian] to scan the code to add equipment
Generate Username and Password
16、Click [Device Commissioning], click [Device Name], copy and save the three pieces of device information: device name, product ID, and device key.
17、Open password generation tool, click [sign.html], enter the device information just copied three sets, Hmac signature algorithm selection [HMAC-SHA1], click [Generate], you can generate Username and Password, copy and save.
IOT Product Analysis——Mijia App
Relying on the millet ecosystem system, Mijia app is the control center and e-commerce platform of millet ecosystem products, integrating device control, e-commerce marketing, crowdfunding platform and scene sharing, and is a total solution for users' intelligent life mainly based on intelligent hardware, covering hardware and family service products. Connected to the ecological chain companies under the Mijia, and all millet and ecological chain of intelligent products to achieve interoperability, but also access to open access to third-party products, is committed to building a complete ecological closed-loop from the intelligent access to the product, crowdfunding incubation, e-commerce access to reach the user, control and sharing.
Door and Window Sensors
The main body of the door and window sensor is mounted on the wall, and the split structure is connected to the door, which controls the relay through the door switch to control the wash or break of the two's magnets to determine the switching status of our door or window.
By creating an automation scene in the Mi Home app, the door is opened as a trigger condition, as a way to control the switch of the desk lamp, air conditioner.