Running the DeviceController Servlet

This file is included in the file devicecontroller.zip, which contains files for running a DeviceController servlet on a TINI module.

Running the DeviceController servlet requires a series of steps to build the application webserver.tini, deploy webserver.tini and related files to the TINI module, and run the application. The webserver.tini file contains the executable code for both the Tynamo Web server and the DeviceController servlet.

These are the steps to follow:

1. Download the needed files.

In addition to a TINI module and TINI SDK (from www.maxim-ic.com/TINIplatform.cfm), these are the required components for creating and running servlets on a TINI with the Tynamo Web server:

2. Building and deploying webserver.tini uses several configuration files. These are included in devicecontroller.zip. You must edit two of these files with information specific to your system.

The build.properties file contains the locations of the TINI SDK and the DeviceController servlet. Edit these lines to match the locations on your development PC:

# The location of the TINI SDK:
tini.path=/tini1.11

# The location of the servlet (DeviceController.java):
src.paths=/myservlets

Use forward slashes (/) as separators in the paths, even under Windows.

The deploy.properties file contains information about the TINI. Edit these lines to match the information for your TINI:

# The TINI's IP address.
deploy.server=192.168.1.9

# The TINI's user ID and password:
deploy.userid=root
deploy.password-tini

You can view and set the TINI's Internet Protocol (IP) address using the TINI's ipconfig command. In JavaKit, type ipconfig to view the current settings, and type ipconfig help to view the options you can set.

3. To build webserver.tini, run the Ant build tool by opening a command-prompt window on your development PC, changing to the directory where you stored the Tynamo download, and entering ant on the command line. The Ant tool uses the information in the configuration files to find out what to build and where to find the files.

4. Copy the files ledon.gif, ledoff.gif, and button.gif to the http-root directory in Tynamo's home directory.

5. To deploy the Web server to the TINI, connect the TINI to your development PC via Ethernet. For a direct connection, attach a crossover cable directly from the TINI's Ethernet (RJ-45) connector to the PC's Ethernet connector. If your PC connects to an Ethernet repeater hub or switch, attach a straight-across cable between the TINI and an available port on the repeater hub or switch.

At a command prompt, type ant deploy.

This causes the Web server's files to transfer to the TINI via the File Transfer Protocol (FTP).

6. To run the Web server, in Windows' Hyperterminal application, create a Telnet connection with these settings:

Host Address = the TINI's IP address
Port = 23
Connect = TCP/IP

Click Call to connect to the TINI and enter this text in the Telnet window:

source web/bin/WebServer

When the server is running, the Telnet Window will display this text:

HttpServer: Server started.

And the TINI is ready to run the DeviceController servlet.

On a computer in the same local network as the TINI, in the Address text box of a Web browser, enter http://, followed by the TINI's IP address, /servlet/, and the servlet's name. For example, if the TINI's IP address is 192.168.1.9, enter this:

http://192.168.1.9/servlet/DeviceController

You should then see the Device Controller's Web page with images and text that match the states of the LEDs on the TINI module. Click a button and the corresponding LED on the TINI will toggle and the browser will update with a new Web page that reflects the change.

For more information and Java and servlet examples, visit my Embedded Ethernet and Internet pages at www.Lvr.com.

Jan Axelson