HTTP Server using WizFi360
#
IntroductionHTTP(Hypertext transfer protocol) is a communication protocol for exchanging data between server and client on the Web. HTTP exchanges data in the form that the client sends the request and the server sends the reply to the request. At this time, Server transmits response such as HTML, JSON, etc., and uses port 80. HTTP is a TCP-based protocol. WizFi360 can communicate the HTTP communication by creating TCP Server. The HTTP protocol must be implemented by the user.
#
Hardware environmentThis document uses Arduino Mega2560 and WizFi360-EVB-Shield. To communicate with the WizFi360-EVB-Shield using UART1 in the Arduino Code, connect the TX1 and RX1 pins of Arduino to the RXD and TXD pins of the WizFi360-EVB-Shield. In the WizFi360-EVB-Shield, change the RXD / TXD Selector to OFF to enable UART communication via the pin, not the USB.
You can also use D0 ~ D8 Pin as TXD / RXD Pin by using UART Select Pin header. If you use it, you can connect without Wiring by placing WizFi360-EVB-Shield on Arduino.
#
Library downloadDownload the library from Github and copy it in the “libraries” folder inside your sketchbook.
#
Execution#
Open exampleLaunch Arduino and Open the WebServer example as shown below.
#
CodeUpdate your AP credentials (SSID and password) to connect WizFi360. Serial1 is the serial communicating with Arduino and WizFi360 and should have the same baud rate as WizFi360. The factory default baud rate for WizFi360 is 115200, and if you have not changed it, enter 115200. Enter the address of the HTTP server to connect to server. You can enter ip address or domain address. In this case, connect to arduino.cc.
Arduino (WizFi360-EVB-Shield) transmits the following HTML data when Web client connects. If you want to send other data, you can modify it below.
#
Result- Check the firmware version. The current firmware version is 3.0.0.
- Attempted to connect to the AP, succeeded, and assigned a virtual IP address of 192.168.1.118.
- TCP Server was created and WebServer was opened.
- Check the connection of the client and receive the Get method data from the client
- HTML data sent to client.