ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: java recommendations

To:
Subject: Re: [ts-7000] Re: java recommendations
From:
Date: Sun, 29 Jul 2007 18:27:13 -0500
I am working on the same thing, didnt want to respond till I an answer

You can download the most current version of the arm-unknown-linux-gnu  
binary at rxtx site:
ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5/arm-unknown-linux-gnu/

The easyest way to add the ttyAMx com ports is to set the system properties:
jamvm -Dgnu.io.rxtx.SerialPorts=/dev/ttyAM0:/dev/ttyAM1 foo

The other way:
RXTXCommDriver.java is
available in ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-7pre2/src/ Download the
RXTXCommDriver.java. In this code, you will find

if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial
Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp;

Replace this code with

if (osName.equals ("Linux")) { String[]Temp = { "ttyS", "ttyAM",  // linux
Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; }

Compile the RXTXCommDriver.java and add the resulting RXTXCommDriver.class
file to RXTXcomm.jar in /usr/java/jdk1.5.0_07/jre/lib/ext/RXTXcomm.jar

Hope this help,
Justin



Quoting tedapt <>:

> Can anyone clarify Dave's statement about the use of rxtx:
>
>    > note: you have to add the arm's /dev/ttyAMx to rxtx, it doesn't
> know about them
>
> Also, any notes from anyone who has successfully setup and used rxtx
> with jamvm would be appreciated!
>
> The setup I'm attempting to get working is:
>
>    - TS-7250
>    - debian on a USB thumbdrive
>    - jamvm installed via apt-get
>    - downloaded rxtx rxtx-2.0-7pre1 for Linux from:
>       http://users.frii.com/jarvi/rxtx/download.html (file at
> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz)
>    - extracted librxtxSerial.so and placed it in /usr/lib/jamvm
>    - using Sun's comm.jar (from a Java 1.3 distribution)
>
> When I invoke the test class (source below) I get these results:
>
>    root# /usr/bin/jamvm -cp .:comm.jar SerialTest /dev/ttyAM0 9600
>    Specified serial port (/dev/ttyAM0) does not exist
>    null
>    javax.comm.NoSuchPortException
>       at
> javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:105)
>    at SerialTest.main(SerialTest.java:32)
>
> Here's source for SerialTest.java:
>
> import java.io.IOException;
> import java.io.InputStream;
> import java.io.OutputStream;
> import java.util.Enumeration;
>
> import javax.comm.CommPortIdentifier;
> import javax.comm.NoSuchPortException;
> import javax.comm.PortInUseException;
> import javax.comm.SerialPort;
> import javax.comm.UnsupportedCommOperationException;
>
> public class SerialTest {
>
>       private static SerialPort sp;
>       private static InputStream sin;
>       private static OutputStream sout;
>
>    public static void main(String[] args) {
>               try {
>                       if (args.length != 2) {
>                               System.out.println("Usage: java SerialTerm.tini 
> port_name data_rate");
>                               System.out.println("Available ports are:\n");
>                               Enumeration ports = 
> CommPortIdentifier.getPortIdentifiers();
>                               while(ports.hasMoreElements()){
>                                       System.out.println(ports.nextElement() 
> + "\n");
>                               }
>                               System.exit(1);
>                       }
>          String portName = args[0];
>          int baudRate = Integer.parseInt(args[1]);
>          try {
>             sp =
> (SerialPort)CommPortIdentifier.getPortIdentifier(portName).open("SerialTerm",
> 5000);
>             sp.setSerialPortParams(baudRate, SerialPort.DATABITS_8,
>                                    SerialPort.STOPBITS_1,
>                                    SerialPort.PARITY_NONE);
>             sin = sp.getInputStream();
>             sout = sp.getOutputStream();
>          } catch (NoSuchPortException nsp) {
>             System.out.println("Specified serial port ("+portName+
>                                ") does not exist");
>             throw nsp;
>          } catch (PortInUseException piu) {
>             System.out.println("Serial port "+portName+
>                                " in use by another application");
>             throw piu;
>          } catch (UnsupportedCommOperationException usc) {
>             System.out.println("Unable to configure port:"+portName);
>             throw usc;
>          } catch (IOException ioe) {
>             System.out.println(
>                                "Unable to acquire I/O streams for port
> " + portName);
>             throw ioe;
>          }
>               } catch (Exception e) {
>                       System.out.println(e.getMessage());
>                       e.printStackTrace();
>               }
>       }
>
> }
>
> --- In  Dave Cramer <> wrote:
>>
>> I've been running jamvm on mine for quite a while. You don't need
>> jikes, unless you plan to compile on the arm (Very slow)
>> I pulled alot of the gnuclasspath out, and the whole thing is quite
>> small. Around 4M or so
>>
>> you need rxtx for serial port work with java,, other than that it's
>> write once deploy everywhere
>>
>> note: you have to add the arm's /dev/ttyAMx to rxtx, it doesn't know
>> about them
>>
>> Dave
>> On 7-Nov-06, at 8:57 PM, gunghoiguana wrote:
>>
>> > The install was much easier than I anticipated:
>> >
>> > apt-get install jikes
>> > apt-get install jamvm
>> > apt-get install jikes-classpath
>> >
>> > Everything seems to work fine, and I can run class files that I
>> > compiled on my desktop PC. I've only checked out basic functions and
>> > console IO so far, but I'll be checking out the serial port and
>> > network interfaces soon. Java is *supposed* to make those things
>> > easy...
>> >
>> > Brian
>> >
>> >
>> >
>>
>
>
>





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU