SPMA080 April   2021 TM4C1292NCPDT , TM4C1292NCPDT , TM4C1292NCZAD , TM4C1292NCZAD , TM4C1294KCPDT , TM4C1294KCPDT , TM4C1294NCPDT , TM4C1294NCPDT , TM4C1294NCZAD , TM4C1294NCZAD , TM4C1299KCZAD , TM4C1299KCZAD , TM4C1299NCZAD , TM4C1299NCZAD , TM4C129DNCPDT , TM4C129DNCPDT , TM4C129DNCZAD , TM4C129DNCZAD , TM4C129EKCPDT , TM4C129EKCPDT , TM4C129ENCPDT , TM4C129ENCPDT , TM4C129ENCZAD , TM4C129ENCZAD , TM4C129LNCZAD , TM4C129LNCZAD , TM4C129XKCZAD , TM4C129XKCZAD , TM4C129XNCZAD , TM4C129XNCZAD

 

  1.   Trademarks
  2. Introduction
    1. 1.1 TI-RTOS Download
    2. 1.2 License
    3. 1.3 XDCtools
    4. 1.4 Versions
    5. 1.5 Configuring NDK Modules
    6. 1.6 Socket-Based API
      1. 1.6.1 BSD Style Socket APIs
  3. Application Examples
  4. Application Setup
    1. 3.1 Hardware Setup
    2. 3.2 Software Tools
  5. Download and Import the Ethernet Examples
  6. How to Create an Ethernet Application for TI-RTOS NDK
  7. Enet_tcpecho_server_tirtos Example Overview
    1. 6.1 Build and Flash the Program
    2. 6.2 Check and Program the MAC Address
      1. 6.2.1 Using The LM Flash Programmer
      2. 6.2.2 Using CCS
      3. 6.2.3 Using UniFlash
    3. 6.3 Run the enet_tcpecho_server_tirtos Example
  8. Enet_udpecho_server_tirtos Example Overview
    1. 7.1 Run the enet_udpecho_server_tirtos Example
  9. Enet_httpServer_tirtos Example Overview
    1. 8.1 Configure NDK for HTTP Application
    2. 8.2 Embedded File System (EFS) Operation
    3. 8.3 Adding HTTP Server Content
    4. 8.4 Declaring HTML Files to EFS
    5. 8.5 Writing CGI Functions
    6. 8.6 Run the enet_httpServer_tirtos Example
  10. Enet_dns_tirtos Example Overview
    1. 9.1 How to Configure NDK for DNS
    2. 9.2 How to View the DNS Traffic on Wireshark
    3. 9.3 Run the enet_dns_tirtos Example
  11. 10Enet_sntp_tirtos Example Overview
    1. 10.1 Run the enet_dns_tirtos Example
  12. 11Enet_tcpecho_client_tirtos Example Overview
    1. 11.1 Configure the Server IP Address
    2. 11.2 Configure the SocketTest Server
    3. 11.3 Run the enet_tcpecho_client_tirtos Example
  13. 12Enet_udpecho_client_tirtos Example Overview
    1. 12.1 Run the enet_udpecho_client_tirtos Example
  14. 13Enet_httpget_tirtos Example Overview
    1. 13.1 How to Configure NDK for HTTP GET Example
    2. 13.2 Run the enet_httpget_tirtos Example
  15. 14References

Run the enet_httpServer_tirtos Example

Rebuild the example if you create your own web contents or load and run the existing example. In the CCS console window, you should see the web server IP address displayed. For more information, see Figure 6-5.

Once the web server is running, enter the IP address on your browser’s URL field as shown in Figure 8-7 and the example web page is rendered on the browser. The index.html normally is the default page shown on a web page if no other page is specified. In other words, index.html is the name used for the homepage of the website.

GUID-20210329-CA0I-JLMK-3BMB-QGZHLSDQMMP7-low.jpgFigure 8-7 Enet_httpServer_tirtos Web Server Home Page

Several hyperlinks and images are displayed on the home page. Click any one of them to get a feel of how they respond. For example, click the “TM4C1294NCPDT Block Diagram” and you will see the web page displayed as shown in Figure 8-8. Note that you could also reach the same web page by directly typing “192.168.254.92/block.htm” on the URL.

GUID-20210329-CA0I-XJ33-J8FS-ZMVGK6GXJ05Q-low.jpgFigure 8-8 Block Diagram Page

Examine the Wireshark capture in Figure 8-9.

  1. The first HTTP GET request from the client happens on frame 4460 and the corresponding server response happens on frame 4468. The server responds with an OK response along with the contents of the web page which is the default index.html.
  2. The file size is 1932 bytes. This is exactly the same as the INDEX array specified in the index.h file, shown in Figure 8-5.
  3. There are a total of 54 lines of html data with the first line as <!DOCTYPE HTML>\r\n. This is matching Figure 8-5.
  4. Again, the second line of index.html is <!—Copyright (c) ……> which is the same as what was encoded in the INDEX character array.
GUID-20210329-CA0I-49CZ-P4PD-J0DLGVJLJQF2-low.jpgFigure 8-9 Wireshark Capture for enet_httpServer_tirtos Web Server

Finally, from the home page, click the “Get Elapsed Time Using CGI Method”. This action triggers the getTime() function to execute and print out the elapsed time the web server has been active, see Figure 8-10. Press the “Refresh” button on your browser to refresh the screen to see an updated elapsed time. Note that you can also trigger the CGI function by directly specifying it in the URL as in “192.168.254.92/getTime.cgi”.

GUID-20210329-CA0I-QKMT-0RC4-QQVMXPPZBD3B-low.jpgFigure 8-10 Web Server Elapsed Time