关注官方微信

中文.

Products

Products

Use UART to Ethernet Module to Achieve Webpage Acquisition

Published Time: 2013-02-08 Author: Shanghai ZLAN Views: 4177
1. Access to embedded web pages

The embedded device accessing to web page is also a common application in the Internet of things. It has at least the below several applications:
1) Display the content on the webpage: get the latest data through device querying the webpage content on the web server, and displayed on the embedded device terminal. For example, can display the weather, temperature, etc. on sometime or somewhere.
2) Submit the data collected by the device with the HTTP protocol. For example, through the POST command of the HTTP protocol, the temperature information collected by the device is submitted to the Web server, and the database in the website can be updated and displayed on the webpage later.

2. Use UART to Ethernet to achieve web access

ZLAN UART to Ethernet module ZLSN2002 can easily realize the acquisition of embedded web pages and the submission of webpage data.

The ZLSN2002 UART to Ethernet port module, one end provides UART serial port to the user MCU, in UART serial port, user MCU can input the required command to obtain the network through the instruction; In Ethernet port end, it provides four network cable interfaces, which can connect the Ethernet cable directly. ZLSN2002 integrates the TCP/IP protocol stack inside, and the command interface required for the HTTP protocol. Users need no longer care about specific protocols, and they can instantly access web pages and submit data forms via a serial command.

In data transmission scheme based on HTTP protocol, ZLAN ZLSN2002 networking products act as the role of the computer browser, ZLSN2002 can upload the device data to a remote Web server, and at the same time can also be in the form of a Web page to get the data from the remote Web server.

3. Steps of using UART to Ethernet to get web page

Steps of user UART to RJ45 module getting the HTTP page or sending the data in the form of a web form as follows:

1) Hardware connection: the first step is to configure the IP, subnet mask and gateway of the ZLSN2002 module to the correct network parameters that can be accessed online, and the Ethernet port is connected to the RJ45 network line. The serial port of ZLSN2002 directly connects the UART serial port of user MCU, and the serial port rate of ZLSN2002 is configured as the UART serial port parameter of user MCU.

2) Send the correct Web server address command: the second step is to send the domain name of the website server to ZLSN2002 via ZLAN AT command through the serial port. The UART module automatically connects to the web server and is ready to access the web page.

3) Get web pages or send data: the third step is different for getting web pages and sending data. The URL of the webpage is sent to the UART module via the ZLAN AT command when accessing web page, and the content of the webpage will be immediately output to the user MCU. When sending data, it is necessary to send the variable command and value of the sent data to module of UART to TCP/IP by the AT command, and the data will be uploaded to the Web server automatically.