Industrial Modem-USR-G781 Submit Data to Webpage Server in the Way of HTTP POST

Keyword: industrial modem-USR-G781 HTTPD_Client POST

 

1.HTTPD Client is mainly applied in webpage servers, and industrial modem-USR-G781 can send data to the webpage server. Then, webpage server will return data to industrial modem-USR-G781 serial to monitor serial devices.

 

Function: to send data from serial device to webpage server through USR-G781 module. Webpage server can receive data and then judge and store data. Web server will respond corresponding command to control in accordance with the data requested by serial device.

 

Resolution:  industrial modem-USR_G781 is generally transparently transmit data through TCP or UDP protocol to connect server in the way of socket communication. At present, many control and management devices do not connect through SOCKET communication but to manage and control serial devices through webpage. As such, as long as user can access internet, they can control or inquire the data state and other information of serial devices through browser.

 

2.AT command setting steps ([0D][0A] are just form to represent shift)

 

It needs to shift the serial to temporary commend mode

 

a.AT+WKMOD=HTTPD[0D][0A]

Set the working mode as HTTPD:

AT+WKMOD=HTTPD[0D][0A]

 

b.AT+HTPTP=POST[0D][0A]

Set the request method of HTTP:

AT+HTPTP=POST[0D][0A]

 

c.AT+HTPURL=/2.php[0D][0A]

Set URL of HTTP:

AT+HTPURL=/2.php[0D][0A]

 

d.AT+HTPSV=test.usr.cn,80[0D][0A]

Set the request server address and port number of HTTTP

AT+HTPSV=test.usr.cn,80[0D][0A]

 

e.AT+HTPHD=Connection: close[0D][0A][0D][0A]

Set the request header information of HTTP:
AT+HTPHD=Connection: close[0D][0A][0D][0A]

 

f.AT+HTPTO=10[0D][0A]

Set the time for request time out of HTTP:

AT+HTPTO=10[0D][0A]

 

g.AT+HTPFLT=ON[0D][0A]

Set to sift out the reply information

AT+HTPFLT=ON[0D][0A]

 

h.AT+Z[0D][0A]

Restart the device

AT+Z[0D][0A]

 

Use configuration tools to set:

USR-G781 submit data to webpage server in the way of HTTP POST

 

3.Use serial debugging assistant to send data and test the data sent by server and data returned

For instance, send data-123

And then, return data-123