The web server application exercises many of the features of the DT7837 module.
Note: By default, the web server example program and all other web-based examples provided by Data Translation use the default HTTP port (8080). Therefore, if you run one web-based example and then try to run another web-based example, the web page may not load correctly. To avoid this problem, either start the web-based example with a different port number (using the -p or -port option) or clear the browser cache history and reload the web page.
To use the web server application, perform the following steps:
Attach an Ethernet cable to the Ethernet
connector on the DT7837 module and to your network.
Note that this cable is provided as EP372 if you purchased the DT7837
Accessory kit.
From the command-line prompt of the terminal window, press enter to see the command-line prompt.
Enter the following command to return the IP address of the DT7837:
# ifconfig
Note that you may have to issue this command more than once if the IP address is not yet available.
Once you have the IP address of the device, change to the directory that contains the web server application by entering the following command:
# cd /usr/local/bin/dt78xx-examples/web-server
To run the executable using the default HTTP port, enter the following command:
# ./release/webserver
To run the example with a different HTTP port, enter the following command, where xxxx is the port number:
# ./release/webserver -p xxxx
To run the example as a daemon so that the process is running in the background and is not connected to the terminal emulator, enter this command to use the default HTTP port:
# ./release/webserver -d
Open a window in your browser, and type the IP address of your DT7837 followed by the HTTP port number. For example, if the IP address of the module is 192.43.218.139 and you are using the default HTTP port, enter the following in your web browser:
192.43.218.139:8080
The main page of the web server application is displayed:
Note: If you run the web server example application as a daemon, you need to terminate the process when you are finished using the example. To determine the process ID of the web server daemon, enter the following command:
# ps -ax |grep webserver
The process ID is returned. To terminate the process, enter the following command, where nnnn is the process ID that was returned for the web server application:
# kill -9 nnnn