logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Login


Options
View
Go to last post Go to first unread
qiu  
#1 Posted : Tuesday, September 13, 2022 1:05:41 PM(UTC)
qiu

Rank: Advanced Member

Groups: Registered
Joined: 9/5/2022(UTC)
Posts: 63
China
Location: manhudun

1. Hardware preparation
1. Select hardware, there are two main types:

One is the officially recommended Arduino WiFi Shield (more expensive, about 300~400 yuan Taobao.com; but the information is complete);
One is the UART-WiFi module, which not only supports Arduino, but also supports all serial microcontrollers that can communicate with its module (about 100 yuan, Taobao, less information).
In the end, I chose the UART-WIFI module, and I also took a bumpy road, maybe a lot of stuff.



2. Introduction of UART-WIFI module

picture
How to use Arduino UART-WiFi module as web server


interface
Dual Row (2 x 4) Pin Connectors
Support baud rate range: 1200~115200bps
Support hardware RTS/CTS flow control
Single 3.3V power supply, 300mA
wireless
Support IEEE802.11b/g wireless standard
Support frequency range: 2.412~2.484 GHz
Two wireless network types are supported:
Basic network (Infra) and ad hoc network (Adhoc)
Supports multiple security authentication mechanisms:
WEP64/WEP128/TKIP/CCMP(AES)
WEP/WPA-PSK/WPA2-PSK
Support fast networking
Support wireless roaming
other
Supports multiple network protocols:
TCP/UDP/ICMP/DHCP/DNS/HTTP
Support both automatic and command working modes
Support serial port transparent transmission mode
Support AT+ control command set
Support a variety of parameter configuration methods:
Serial port/WEB server/wireless connection
3. UART-WIFI module configuration

Since the UART-WIFI module requires 3.3V and 300mA input, while the Arduino can only provide 3.3V and 50 mA, directly connecting to the Arduino will result in the 3.3v output of the arduino. The actual measurement is only about 2.3V, so the UART-WIFI cannot be used normally. module.


3 configurations
Configuration 1: External power supply
How to use Arduino UART-WiFi module as web server

Configuration 2: You can use an upgraded development board (Freaduino) compatible with the official Arduino. Freaduino uses 1117-3.3 to output 3.3V power supply, and the maximum current is 800mA. Arduino only provides 5V power supply of 500mA, while Freaduino changed the original LDO design to DCDC, which can provide 5V power supply of 2A at most. How to use Arduino UART-WiFi module as web server



Configuration 3: Adapter board (didn't find a suitable adapter board, not verified, but the principle should be the same, increase the current)
How to use Arduino UART-WiFi module as web server




2. Test the UART-WiFi module

Method 1: Use the UART-WIFI configuration management program to manage
Connect the UART-WIFI module to the serial port connection board, and turn on the power after connecting the serial port cable.
Tips: 1. You can connect the reset and gnd of Arduino to use as a serial adapter board; 2. When Arduino is used as a serial adapter board, the RX must be connected to the UART-WIFI module RX; TX is connected to the UART-WIFI module TX.
Start the UART-WIFI configuration management program, select the connection port number of the module from the port list, if you are not sure, you can choose automatic (the frequency is set to 9600)
How to use Arduino UART-WiFi module as web server


Click "Exit Transparent Transmission Mode"
Click "Search Module", if the connection port selects "Auto" and the computer has multiple serial ports, it may take a long time to search, as shown in the following figure:
How to use Arduino UART-WiFi module as web server
Modify the corresponding configuration of the module
Method 2: Through the built-in WEB server, use the IE browser to configure the parameters through the webpage
Using a pc, search for and connect to the module's ap. It must be ensured that the module has been successfully connected to the network;
The default port number of the WEB server is 80, so just enter the address in the address bar of the browser. For example: 192.168.1.100
Enter the account password of the WEB server (default account: admin default password: 000000)
How to use Arduino UART-WiFi module as web server
The configuration page of the web page is shown in the figure below. If you want to modify the configuration parameters of the wireless module, you only need to click the corresponding "save" button after the modification to submit the modification.


How to use Arduino UART-WiFi module as web server


3. Implement wifi webserver

Step 1: Configure parameters (both the management program and the web background can be used)
Protocol type: TCP
C/S mode: server
TCP expiration time: 2s
Port number: 8080
sta mode
SSID name
encryption mode
wireless router password
Wireless parameters
Automatic working mode
Step 2: Write the arduino and upload the code to the board


void setup()
{
Serial.begin(9600);
}
void loop()
{
boolean currentLineIsBlank = true;
while(1){
if (Serial.available()) {
char c = Serial.read();
// if you've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so you can send a reply
if (c == '\n' && currentLineIsBlank) {
// send the webpage
Serial.println("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.