C51 Programming 24-Application (ESP-01S WIFI module and computer communication)

Publisher:chenfengy818Latest update time:2022-06-21 Source: eefocusKeywords:C51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In order to realize transparent transmission between the computer and the microcontroller, we must first understand the WiFi module.

Test whether the wifi module is normal


Use a serial cable to connect to the wifi module serial port. Connect the CH340G serial cable TX to the wifi module RX, and connect the CH340G serial cable RX to the wifi module TX. As shown in the following table       

image.png

Note: The wifi module cannot be powered by 5V, the wifi module is powered by 3.3V. The pin diagram is as follows 

Connect to the serial debugging assistant (you can use Anxinke Assistant or other serial debugging assistants), and send data to the wifi module through the serial port for settings.


Note: When using the Friendly Serial Port Assistant to send a command, you need to press the Enter key before clicking Send, otherwise the command will fail to be recognized.


It is recommended to use Anxinke serial port debugging, which comes with commands. The link is as follows.


AiThinker_Serial_Tool.rar-Embedded Document Resources-CSDN Download

For more download resources and learning materials of Anxin WiFi module debugging tool, please visit CSDN download channel.

https://download.csdn.net/download/qq_34343637/53394077?spm=1003.2166.3001.6637.1


The default display of the serial port assistant is not comprehensive. You need to drag the lower right corner to display all commands.

 

The module uses a default baud rate of 115200. After the connection is successful, send the command "AT" and the return "OK" indicates that the module is normal.

ESP-01S WIFI module communicates with the computer via TCP


1. Anxinke serial port debugging assistant


 The default baud rate of the wifi module is 115200. After successfully connecting to the Anxinke serial port debugging assistant, send the settings in sequence.


AT+RST //wifi module reset

AT+CWMODE=1 //Set to station mode

AT+CWJAP="adam","5656haha" //Join the wifi network named "adam", password "5656haha"


2. Computer configuration


Query the IP address of the computer that will communicate with the wifi module: 192.168.43.170 (CMD -> ipconfig)

Open the friendly serial port debugging assistant and set it as follows

3. Anxinke serial port debugging assistant   


//Connect to the TCP server, TCP protocol, TCP server IP address, TCP server port

AT+CIPSTART="TCP","192.168.43.170",6000 

 

// Enable transparent transmission

AT+CIPMODE=1 

 

//Start sending and receiving data

AT+CIPSEND   


4. Final effect



Keywords:C51 Reference address:C51 Programming 24-Application (ESP-01S WIFI module and computer communication)

Previous article:C51 Programming 25-Application (MCU and computer realize WiFi communication)
Next article:C51 Programming 23- Application (HC 06 Bluetooth Module)

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号