ESA2GJK1DH1K security chapter: Wi-Fi module (8266) connected to the SSL server MQTT

 

 

prompt

 

 

 

 

  Sad to see this immediately !!!!

 

  Common AT commands can only go up

 

 

Directive change

  \

  1. First transmission: AT + CIPSEND = 34 \ r \ n

  2.连接TCP:  AT+CIPSTART="SSL","mnif.cn",8883\r\n

    This SSL connected to the server on MQTT

  Then, when the first communication transmission   AT + CIPSEND = xxxx \ r \ n

  Wi-Fi module returns to wait> then sends Data

  This command this we should all know Ha, I started to learn a Wi-Fi module when basically use

 

 

You may have doubts

  Why not import the certificate it ??

  A: When we MQTT configuration on a one-way authentication is configured, and is on the authentication server

  That is, the terminal device can connect to the server is judged not real server

  That initiative in the equipment here,

  When establishing communications server will be sent, the server's certificate

  I can ignore the device side, that is whether you totally certificate

  The current default Wi-Fi module is directly ignored

 

Wi-Fi data test module

  All Wi-Fi module to upload data encryption!

  

 

 

Changes in procedures detailed instructions 1

  1. Description

  Adding data cache management: Please refer to   https://www.cnblogs.com/yangfengwu/p/12228402.html

  

 

 

 

 

 

 

  2. The reason for adding cache

  Because each time you send data becomes the first send

  AT+CIPSEND=xxxx\r\n

 

  Wait until the Wi-Fi module returns>

  Then send the data

  The whole process necessary to send heartbeat packets, but also send the temperature and humidity, but also the data transmission switch

  After addition of the cache management, when the above data to be transmitted directly into the cache and

 

  I taken periodically from the cache into a data array which

  Then sends AT + CIPSEND = xxxx \ r \ n

  Wait until the Wi-Fi module returns>

  The data is then sent inside the array

 

Cache roadmap details

  1.插入数据

  1.1插入心跳包数据

    

 

 

  1.2 插入开关状态

 

    

 

 

    

 

 

  1.3 插入温湿度数据

 

    

 

 

 

 

   2.定时提取数据

    2.1 在1ms定时器中断里面每隔150ms判断提取一次数据

    

 

 

 

 

  3.如果有数据需要发送

 

  则先发送 AT+CIPSEND=xxxx\r\n

 

    

 

 

 

 

  4.判断Wi-Fi模块如果返回 > 则,发送数据

 

    

 

 

    

 

 

 

 

   

 

 

 

程序修改细节说明2

  1.现在数据返回的时候会返回 +IPD

  为保证先前接收判断程序不做改动,剔除+IPD,接收真实的数据

    

 

 

 

 

 

补充细节

  1.为什么不按照下面的方式判断接收到了 >

    

 

 

  原因:

 

    如果Wi-Fi模块 返回 > 的同时,Wi-Fi也接收到了服务器发来的(+IPD)数据....

 

    那么 > 将会被剔除

 

    

 

 

 

 

 

 

 

 

    

 

Guess you like

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