TcpComm is a serial-to-ethernet converter that allows applications to access TINI's serial ports through TCP. Applications written using the Java Comm API can use one of TINI's network-enabled serial ports without altering any Java code. If you do not have the Java Comm API installed, you will need to in order to use the usage examples listed on this page.
TcpComm is a client-server application. The TcpComm client works by installing itself as another driver specified by the file javax.comm.properties. When the Comm API enumerates ports, it will query the TcpComm driver for ports it knows about. The server works by running on a TINI attached to the serial device the application needs to communicate with. The following image illustrates this relationship:

The PC runs the client, connecting to the TINI board through the ethernet. By invoking methods on javax.comm.CommPort objects, the client sends network messages to TINI, telling it what serial operations to perform.
In order to run the sample applications described later, download and unpack the file listed above. To use TcpComm, we will need to change our javax.comm.properties file and place the file tcpcomm.jar (included in the download) in our classpath.
When you installed the Comm API, it should have placed a file on your system called
javax.comm.properties. The contents of the file might looks something like this:
Open the file javax.comm.properties in your favorite editor (notepad.exe, write.exe, vi ...).
Add the following line to the bottom of the file:
## Drivers loaded by the Java Communications API standard extension
# at initialization time
## Format:
# Each line must contain ONE driver definition only
# Each line must be of the form:
# driver=
If you have multiple copies of javax.comm.properties or are having trouble finding it,
you can determine the correct location of the file by compiling and running this simple java program:
Driver=com.dalsemi.tcpcomm.client.TcpCommDriver
public class ListProperties
{
public static void main(String[] args)
{
System.out.println("Your home directory is: "+System.getProperty("java.home"));
}
}
The output of this program will be the name of the home directory for your Java installation.
The output may look like this:
Your home directory is: C:\Program Files\JavaSoft\JRE\1.2
In this case, we must change the properties file in the directory C:\Program Files\JavaSoft\JRE\1.2\lib.
Note that if you use different Java installations, those installations may have different home directories,
and you may need to change multiple copies of the javax.comm.properties file.
Next you will need to put the file tcpcomm.jar (located in the download above) in your classpath. You can do this in one of several ways.
java MyApplication
To this:
java -classpath "c:\downloads\tini\tcpcomm.jar;%classpath%" MyApplication
set classpath=%classpath%;tcpcomm.jar
You can also do this from a script or a batch file.
The file CommPortServer.tini, included in the release, can be put on a TINI running
Firmware Version 1.02 using FTP. Then from a telnet session, you will need to stop the serial
server and start the host application.
TINI /> stopserver -s -d
Warning: This will disconnect users on specified servers.
OK to proceed? (Y/N): y
TINI /> java CommPortServer.tini serial0 &
TiniCommPortServer v1.0
TINI /> ps
3 processes
1: Java GC (Owner root)
2: init (Owner root)
3: CommPortServer.tini (Owner root)
TINI />
A number of source files are included in this distribution. They can be separated into files for the client and files for the host. One file is shared between both.
Building the Host
To build the host application, the following files must be compiled for TINI and built using TINIConvertor:
Building the Client
The client is not an application, but rather a set of drivers that will reside in a jar file.
The following files must be compiled and jar'ed together in a file called tcpcomm.jar:
Note: To run this example, you must already have JavaKit installed and be able to run it normally (i.e. you have used it to talk to a TINI board before).
After following the installation above, it is easy to run the JavaKit program (a program included with the TINI software development kit). This requires two TINI boards. Make sure one board is already running the CommPortServer program, and attach a straight-through serial cable from its serial port 0 terminal (on a REV C socket board from Dallas Semiconductor, this is the DTE serial port placed at J3) to the second TINI's serial port 0 DCE terminal (on a REV C socket board from Dallas Semiconductor, this is the serial port placed at J6).

To run JavaKit over the internet, run the following command line:
where IPADDRESS is the IP of the TINI running the CommPortServer.tini program. If this
TINI's IP is 180.0.16.133, then the command line would look like this:
java -Dtcpcomm.serial=IPADDRESS JavaKit
Note that if you are using the command line to specify that the file tcpcomm.jar
is in your classpath, your command line would look like this:
java -Dtcpcomm.serial=180.0.16.133 JavaKit
When JavaKit comes up, you will notice that an extra entry is in your list of available
ports.
java -classpath %classpath%;tcpcomm.jar -Dtcpcomm.serial=180.0.16.133 JavaKit

Note: To run this example, you must have the 1-Wire API kit insstalled and be able to run the 'FindiButtonsConsole' included with the distribution. You can find the 1-Wire API at http://www.ibutton.com/software/1wire/1wire_api.html.
Running JavaKit over the internet is an interesting example, but doesn't stress TINI's serial port as much as a 9097U would. Since the 1-Wire API includes support for communicating with the 9097U adapter through JavaKit, we can internet-enhance any 9097U, using our new TcpComm drivers. Note that although this example is interesting, it is highly impractical. TINI can already communicate with iButtons through its on-board DS2480. Running the FindiButtonsConsole application through an internet proxy is noticeably slower than running the application directly on TINI. Running more complex applications in this manner will likely result in timing problems that causes communication with iButtons to fail.
Attach a DS9097U to the transmitting terminal for serial port 0 (on a
REV C socket board from Dallas Semiconductor, this is the DTE serial port placed
at J3). Also attach a couple iButtons.

Make sure that you can run the FindiButtonsConsole program by itself
first. Once you can, try it with the following command line:
Remember to change this line to use your TINI's
IP address, and to add a '-classpath' switch if necessary.
java -Dtcpcomm.serial=180.0.16.133 FindiButtonsConsole
This program will iterate through all your machines ports that the 1-Wire software can run on. It may search your parallel ports and your serial ports. It will also try to search the port "180.0.16.133" through the Java Comm API. After a few seconds (there may be many ports to iterate on your computer, even if you usually only use one or two), the iButtons attached to the 9097U on the TINI will be reported.
The TcpComm server application (CommPortServer.tini) works by opening and listening on TCP port 10101. To run it on a different port, use the command line:
java CommPortServer.tini serial0 10102 &
This would run the server on port 10102. To make the client programs connect to this port, change your command line to the following:
java -Dtcpcomm.serial=180.0.16.133:10102 FindiButtonsConsole
Note the ':10102' specifies the port for the client to connect.
Though this software was written with TINI in mind, the server can also run on a PC with a properly installed Comm API. To run on the PC, execute the class com/dalsemi/tcpcomm/server/CommPortServer, using the same arguments as for the TINI application.
java com/dalsemi/tcpcomm/server/CommPortServer COM2 10102
Classpath issues may need to be resolved to run the application on the PC. Remember that on TINI, the main class to execute is TiniCommPortServer. This is because it may need to enable a serial port before it begins running.
Some applications may require handshaking to be enabled on TINI. For these applications, add an '-hs' argument to the command line of the server:
java CommPortServer.tini -hs serial0 10102 &
Currently, the client software can only run on a PC. With future modifications to TcpComm, the client software will be able to run on TINI as well.