Setting Up TINIs

Loading Firmware

TINIs come with no firmware loaded and the first order of the day is to fix this. Even if your TINI has fireware loaded you may still wish to reload at as a method of extreme reset.

Firstly, grab version 1.02e of the SDK. Version 1.02f came out between my experiementing with the TINIs and writing this, so if you have problems you may wish to try it.

The SDK is written in Java and uses the Java Serial Port API to talk to the TINI. JDKs on Linux don't support this API so you either need to use a Windows box or (as I do) install RXTX. I'm using version 1.4 of RXTX. Follow the install instructions that come with RXTX (you need root for this). You also need to chgrp csg /var/lock (assuming you are going to run the SDK as a non-root member of group csg).

Now make sure that the TINI is wired up correctly. You should be supplying 7.5V DC into the power socket. The TINI docs say 5V, but it seems that the voltage regulator needs quite a bit of power. The polarity doesn't seem to matter.

You should also have a straight through serial cable running into the female serial port of the TINI (labled J6). In the end, I got fed up with wondering if the cable was actually correct and plugged the TINI into the back of the computer.

(from this point on, this information is in the TINI book)

Now try firing up the fireware app:

Select a comm port (if you don't see any, your RXTX install isn't correct) and click "Open Port". Now click "Reset". You should see the TINI talking to you. If you don't then try the other serial port and then look at the wiring carefully.

From the File menu, load tini.tbin followed by slush.tbin from the tini1.02e/bin directory. This will take a little time over the serial cable.

Now, in the SDK terminal window type these commands exactly, each followed by Enter:

The TINI should now boot. The default root password is tini

TINI Networking

Once you have a root console on the TINI you probably wish to delete the guest user with userdel. You can then setup networking with ipconfig -d (uses DHCP). The ipconfig -C will save the setup to Flash memory for when you reboot.

TINI Programming

General

The TINIs have a small java virtual machine and can run java class files so long as they only use the supported subset of the libraries. TINIs only support Java 1.1 code and then, only if it has been specially premangled.

Building .tini Files

Firstly you need to build the class files for each .java file you have

Once all the .class files have been compiled, put them in a directory and run the premangler on them:

Temperature Sensing

See the 1-Wire chapter in the TINI book for details of the actual java. The driver for the temperature sensors had to be dug up using Google. It's called OneWireContainer10.java and I have a copy here.

The source code for the little utility which I run on the TINI's (not good for a public network, this is on DoC's secure network:

import java.util.Enumeration;
import java.io.*;
import com.dalsemi.onewire.OneWireAccessProvider;
import com.dalsemi.onewire.container.OneWireContainer;
import com.dalsemi.onewire.container.OneWireContainer10;
import com.dalsemi.onewire.adapter.DSPortAdapter;
import com.dalsemi.onewire.OneWireException;
import java.net.*;

class Census {
	public static void main(String [] args) throws IOException, OneWireException { 
		OneWireContainer10 tempsen;
		DSPortAdapter adapter;
		Link sensors = null;
		
		try {
			adapter = OneWireAccessProvider.getDefaultAdapter();
		} catch (OneWireException e) {
			e.printStackTrace ();
			return;
		}
		
		try {
			adapter.targetFamily (0x10);
			Enumeration e = adapter.getAllDeviceContainers ();
			while (e.hasMoreElements ()) {
				tempsen = (OneWireContainer10) e.nextElement ();
				System.out.println( tempsen.getAddressAsString());
				byte[] state = tempsen.readDevice();
				tempsen.setTemperatureResolution (tempsen.RESOLUTION_MAXIMUM, state);
				tempsen.writeDevice (state);
				sensors = new Link (sensors, tempsen);
			}
		} catch (OneWireException e) {
			e.printStackTrace ();
		}

		while (true) {
			ServerSocket ssock = new ServerSocket (1);
			Socket sock = ssock.accept ();
			ssock.close ();
			
			String srcip = sock.getInetAddress ().getHostAddress ();
			/*if (!srcip.substring(0, 0xa).equals ("146.169.5.")) {
				System.out.println ("Rejected connection from: " + srcip);
				sock.close ();
				continue;
			} */
			System.out.println ("Accepted connection from: " + srcip);
			OutputStream out = sock.getOutputStream();
			try {
				Link cur;
				byte[] state;
				for (;;) {
					for (cur = sensors; cur != null; cur = cur.next) {
						try {
							state = cur.sensor.readDevice ();
							cur.sensor.doTemperatureConvert(state);
							state = cur.sensor.readDevice();
							out.write ((cur.sensor.getAddressAsString() + " " + cur.sensor.getTemperature (state) + "\n").getBytes ("UTF8"));
						} catch ( com.dalsemi.onewire.adapter.OneWireIOException e ) {
						}
					}
				}
			} catch ( IOException e ) {
			}

			sock.close (); 
		}
	}
}

Site Map
/Root
     AlternateThe Weird and Wonderful
          BacklinksWhat are backlinks
          John GilmoreWhat's Wrong with Copy Protection
     ArchivesBlog Archives
          OneArchive 1
          TwoArchive 2
          ThreeArchive 3
          FourArchive 4
          FiveArchive 5
          SixArchive 6
          SevenArchive 7
          EightArchive 8
          NineArchive 9
          TenArchive 10
          ElevenArchive 11
          TwelveArchive 12
          ThirteenArchive 13
          FourteenArchive 14
          FifteenArchive 15
          SixteenArchive 16
          SeventeenArchive 17
          EighteenArchive 18
          NineteenArchive 19
          Twenty Archive 20
          Twenty OneArchive 21
          Twenty TwoArchive 22
          Twenty ThreeArchive 23
          Twenty FourArchive 24
          Twenty FiveArchive 25
          Twenty SixArchive 26
          Twenty SevenArchive 27
          Twenty EightArchive 28
          Twenty NineArchive 29
          Thirty Archive 30
          Thirty OneArchive 31
     PhotosPoor People Caught on Film
          Jack and the Beanstalk Jack and the Beanstalk
          RIP ScanResults of a Stage Scan Fire
          YosemiteYosemite National Park
     ProjectsIncomplete things from the lab
          Seagull's BaneLinux Automounter
          bttrackdBitTorrent Tracker
          CAPTCHACAPTCHA CGI script
          ConservConsole Serving
          DeerparkUsing Tor with Firefox/1.1 (Deerpark)
          DNSFixFixing DNS
          XoversXTA Crossover Control
          IAFSArchive Org Storage
          JBIG2JBIG2 Encoder
          VerifyPGP Key Verifier
          MaxFlowMaximal Flow in Python
          PyBloomBloom Filters in Python
          pyGnuTLSPython wrapping of GnuTLS
          SxmapApache SuEXEC Map
          HellardUnion Server Notes
     RecordingsFree recordings
          ICSM ChoirSt Paul's Church
     SchoolAncient School Stuff
     WritingsWho knows
          Cap SystemsCapability Systems
          IntroIntroduction to me
          SupremaJMC2 Group Project
          MP LettersLetters I've written to my MP
          SoundSound With Dramsoc
          SyncThreadingThe wonders of user-land threads