当前位置:网站首页>[STM32 + esp-12s connect Tencent cloud IOT development platform 1] creation of cloud platform and burning of at firmware

[STM32 + esp-12s connect Tencent cloud IOT development platform 1] creation of cloud platform and burning of at firmware

2022-07-07 23:32:00 Little river god is tangled


Preface

        I used to use ESP-C3 The module has been connected to Alibaba cloud physical network platform , Today, let's play Tencent cloud IOT development platform , I heard that this platform can be used directly Tencent goes on and on App Or Tencent serial applet Direct control , There must be a lot of time left , Bloggers also played , Have a pretty good experience . The feeling is as follows :
       1. The test tool is very friendly , Anxin can provide a good simulation MCU Of Windows Upper computer visualization software :loTDevTool:https://axk.coding.net/s/98cbbda6-ff1e-4c38-819d-325bce81bacc;
       2. The connection process is simple , Only two instructions are needed to establish the connection ;
       3. It's really possible to use mobile phones App To control .
        It is said that there is also the function of mobile phone distribution network , But I didn't play either . Bloggers refer to the official blog of Anxin Ke for testing , At present, only ESP-12S This module , But it is a module after all , For connections STM32 or 51 SCM or other MCU Come on , It's a bit cumbersome . still ESP8266-01S It smells good ( Connected to Tencent cloud AT Firmware must 2M The above flash, therefore 01S To burn this firmware , It needs to be changed flash chip ).

One 、 Creation of Tencent cloud IOT development platform

        Tencent cloud IOT development platform address :https://cloud.tencent.com/product/iotexplorer;
( If you don't register, you can register and authenticate first ), After you log in , Click on “ Use now ” Then the interface you see should be like this :
 Insert picture description here

1. Create products

        Don't talk much . Just look at the operation ( Mainly lazy screenshots ),
 Insert picture description here

2. Configure products and create devices

        This device is for testing , So I won't explain this configuration too much , After configuring once , Just match it according to your needs :
 Insert picture description here

3. Device triplet description

        After the device is created , It will be in the debugging interface “ Equipment information ” See device triples in , They are : product ID、 Device name and device key . This is a ESP-12S Important parameters for connecting the cloud . Specific viewing method :
 Insert picture description here

Two 、ESP-12S Firmware burning

1. Firmware acquisition

        If you have played ESP8266 AT Firmware students may have a doubt , Lexin officially has AT Firmware , Why should I find something else AT Firmware . First explain , Conventional AT Firmware can also be connected to Tencent cloud , But it will be more troublesome , So Lexin also released a version of firmware that can simply connect to Tencent cloud IOT development platform , Its instruction set can also be found in Lexin AT The user guide can be seen :AT User guide - Tencent cloud loT Instruction set ,
Anxinco ESP-12S Tencent cloud AT Firmware download address :
https://codechina.csdn.net/mirrors/ai-thinker-open/ai-thinker-open-qcloud-esp-wifi/-/tree/master/qcloud-iot-at-esp8266/QCloud_IoT_AT_ESP8266_FW
There are two versions , Bloggers use : QCloud_IoT_AT_ESP8266_v2.0.0_20200617_UART_15_13.bin It uses IO15 and IO13 Serial port version of .

2. Firmware burning

        Burn firmware , You also need to use a tool :flash_download_tool
 Insert picture description here
Download decompression , Run the only .exe file , Then follow the dot :
 Insert picture description here
 Insert picture description here
Just wait for the burning to complete . Press the reset button after burning .

3、 ... and 、 Connect the test

1. Connect WiFi

        Previously, it was said that Anxin can provide a good testing tool :loTDevTool,
 Insert picture description here
Be careful : The serial port of the firmware we use is :IO15-TXD and IO13-RXD, Default baud rate 115200, So onboard USB It doesn't work , External modules are required .
 Insert picture description here

2. Connect Tencent cloud Internet of things development platform

        Connecting Tencent cloud IOT development platform requires device triples , namely : product ID、 Device name and device key . How to check? Please turn to the first section . Fill the triples in the device parameters :
 Insert picture description here

Remember that triples must not be wrong , No one can connect successfully . Blogger here is just a demonstration , Although the above figure is different from the triplet of cloud platform , But the actual configuration is the same ,
 Insert picture description here
If always connected , But that tool shows that it is connected , The module can be reset , Then reopen the debugging tool , Reconnect the WiFi.

3. Subscribe to topics

        Make sure it is connected , And the device is online .,
 Insert picture description here
Topic explain :
        subscribe :$thing/down/property/{ProductID}/{DeviceName}
        Parameters :ProductID It's the product ID 、DeviceName It's the name of the device , Such as :
$thing/down/property/C9N29PAEXK/LED;
notes : Input Topic when , Can't use Space Start with , Otherwise, this is the result :
 Insert picture description here
 Insert picture description here

4. Release the news

        Published and subscribed Topic It's just a little different , That's it down and up; Such as :
        subscribe :$thing/down/property/{ProductID}/{DeviceName}
        Release :$thing/up/property/{ProductID}/{DeviceName}
With Topic after , You need to send Json data , You can refer to : Tencent cloud data template Protocol , For your convenience , I will post LED Control data :

{
   "method":"report",
   "clientToken":"123",
   "params":{
		"led1":1
   }
}

 Insert picture description here

Four 、 Tencent goes on and on App control

        You can go to the mobile app store to download Tencent goes on and on App,
 Insert picture description here
 Insert picture description here
After these two steps , You can debug on your mobile phone ESP-12S 了 , The back controls . As long as the process of connecting the cloud platform is simulated with a single chip microcomputer, the remote control of the single chip microcomputer can be achieved . This process will be put into the blog post later .
Pay more attention to , Neverlost ,Nice!

原网站

版权声明
本文为[Little river god is tangled]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130559025699.html