ESA2GJK1DH1K Basics: Test Air202 above two-dimensional code scanning APP binding by MQTT control device (compatible with SIM800) Hardware Description

 

 

Foreword

First, the basics of the program requires:   https://www.cnblogs.com/yangfengwu/category/1566194.html    all source code open source, your own learning

  

Second, this program is compatible with SIM800

If you want to bind SIM800, please send its IMEI number to generate two-dimensional code, using a mobile phone APP scan.

 

 

Realize the function summary

  GPRS module released by theme: device / GPRS module device IMEI number subscribed threads: user / device IMEI number

  APP obtain IMEI number GPRS device by scanning the two-dimensional code, and then set the subscription topics: device / device IMEI number issued by theme: user / device IMEI number

  Note: In fact, on one and the only difference is the code control server GPRS TCP connection, and then pass through other programs achieve exactly the same.!

  There are a further two behind, I will tell you how to port my current MQTT handler to their own projects, as long as they can achieve the module TCP, they will be able to achieve MQTT

  MQTT itself because it is a TCP server. You follow him to the provision of data sent, it will help you to forward the data only.

  I had a packet is to everyone no matter what modules, can be transplanted every minute on MQTT!

  Give a man to fish, you should give a great value to fish!

  To tell the truth Ha, I use this program on my bag transplant, only took less than 10 minutes. If there is in fact how ready steady flow of know TCP connection control module, and also five minutes.

First, the hardware program

  1.1: STM32 AT command to the control module GPRS TCP server MQTT transparent transmission connection, the communication control MQTT achieved.

    1.1.1: MQTT treatment, using the official language C + I MQTT pack secondary package (to facilitate rapid migration use).

    1.1.2: GPRS connection control part of the program server MQTT

      

 

 

 

     1.1.4: processing the data returned by the server part program MQTT (and in the previous section)

      

 

 

测试准备工作(详细下载步骤请参考 硬件使用说明 )

一,下载单片机程序

  

 

 

 

二,安装APP软件(APP软件还是上一节的那个软件)

  

三,调整波动开关位置,STM32和GPRS 串口1 通信

  

 

 

 

 

四,别忘了插手机卡,还有安装上天线

 

 

 

 

 

 

 

开始测试

一.打开手机APP,点击右上角菜单 "扫一扫"  扫描模块上面的二维码,模块的二维码就是这个模块的IMEI号,扫描成功将在主页面添加一个设备.

       

 

 

 

 

二.单片机控制Wi-Fi连接上MQTT服务器以后,指示灯1S闪耀

 

 

 

 

三.点击设备进入,设备控制页面,页面显示当前温湿度数据,显示当前设备的状态

 

 

 

 

四.远程控制继电器吸合

  

 

 

 

 

五.远程控制继电器断开

   

 

 

 

六.请自行控制家电(最大支持10A,注意安全!),咱的GPRS远程控制器就做好了.

 

Guess you like

Origin www.cnblogs.com/yangfengwu/p/11762609.html