1. Introduction:
USR-TCP232-T2 submits data to the web server via HTTP GET
HTTPD_Client is mainly used in web server, and the data sent by serial port can be transmitted to web server. The web server returns data to the serial port for monitoring the serial device.
Function: The data sent by the serial device can be sent directly to the web server through USR-TCP232-T2. The web server can receive data, judge and store the data, etc. The web server returns the corresponding control commands according to the data requested by the serial device .
Advantages: Generally, the serial server transmits data transparently through TCP or UDP protocol, and establishes a link with the server through socket communication. Currently, there are many ways to control and manage the device, not through SOCKET communication, but through the web page to manage and control the serial device. It is required that the user can access the Internet and control and query the data status and other information of the serial device through the browser.
2. Web server test. Enter the address, URL and request data of the web server on the web page (the following figure takes our test server as an example)
3. Parameter settings in T2: Open the M0 setup software, set the work mode to HTTP Client, GET, remote IP to test.usr.cn, port to 80. URL is /1.php?. Change the IP mode to DHCP, serial port parameters should be consistent with serial device.
After setting all parameters, restart the device. Then connect the Ethernet port of T2 to a router via a network cable.
4. Send data=123hello from the serial port, receive 123hello from the server.