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
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.
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.
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:
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 ();
}
}
}
| / | Root |
| Alternate | The Weird and Wonderful |
| Backlinks | What are backlinks |
| John Gilmore | What's Wrong with Copy Protection |
| Archives | Blog Archives |
| One | Archive 1 |
| Two | Archive 2 |
| Three | Archive 3 |
| Four | Archive 4 |
| Five | Archive 5 |
| Six | Archive 6 |
| Seven | Archive 7 |
| Eight | Archive 8 |
| Nine | Archive 9 |
| Ten | Archive 10 |
| Eleven | Archive 11 |
| Twelve | Archive 12 |
| Thirteen | Archive 13 |
| Fourteen | Archive 14 |
| Fifteen | Archive 15 |
| Sixteen | Archive 16 |
| Seventeen | Archive 17 |
| Eighteen | Archive 18 |
| Nineteen | Archive 19 |
| Twenty | Archive 20 |
| Twenty One | Archive 21 |
| Twenty Two | Archive 22 |
| Twenty Three | Archive 23 |
| Twenty Four | Archive 24 |
| Twenty Five | Archive 25 |
| Twenty Six | Archive 26 |
| Twenty Seven | Archive 27 |
| Twenty Eight | Archive 28 |
| Twenty Nine | Archive 29 |
| Thirty | Archive 30 |
| Photos | Poor People Caught on Film |
| Jack and the Beanstalk | Jack and the Beanstalk |
| RIP Scan | Results of a Stage Scan Fire |
| Yosemite | Yosemite National Park |
| Projects | Incomplete things from the lab |
| Seagull's Bane | Linux Automounter |
| bttrackd | BitTorrent Tracker |
| CAPTCHA | CAPTCHA CGI script |
| Conserv | Console Serving |
| Deerpark | Using Tor with Firefox/1.1 (Deerpark) |
| DNSFix | Fixing DNS |
| Xovers | XTA Crossover Control |
| IAFS | Archive Org Storage |
| JBIG2 | JBIG2 Encoder |
| Verify | PGP Key Verifier |
| MaxFlow | Maximal Flow in Python |
| PyBloom | Bloom Filters in Python |
| pyGnuTLS | Python wrapping of GnuTLS |
| Sxmap | Apache SuEXEC Map |
| Hellard | Union Server Notes |
| Recordings | Free recordings |
| ICSM Choir | St Paul's Church |
| School | Ancient School Stuff |
| Writings | Who knows |
| Cap Systems | Capability Systems |
| Intro | Introduction to me |
| Suprema | JMC2 Group Project |
| MP Letters | Letters I've written to my MP |
| Sound | Sound With Dramsoc |
| SyncThreading | The wonders of user-land threads |