IPAQ infrared with teilo package

hi,

I have a question about infrared connection from ipaq h4150 to PC.

I use and actisys IR220L+ (adapter to convert serial port into IR) for receiving the IR.

I tried to write from IPAQ to PC via infrared by using the code below

//////////////////////////////////////////////////////////////////////

CommPortIdentifier cpi =null;

for(Enumeration e=CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();){

CommPortIdentifier tmp = (CommPortIdentifier)e.nextElement();

if (tmp.getName().equals("COM3:")){

cpi = tmp;

break;

}

}

try{

SerialPort porte = (SerialPort) cpi.open("My app name", 1000);

//OutputStream cos = porte.getOutputStream();

//String messageString = "print something";

//cos.write(messageString.getBytes());

PrintWriter print_writer =new PrintWriter(porte.getOutputStream());

print_writer.print("print something");

}catch (Throwable e){

//Failed opening port

System.err.println(e.toString());

}

//////////////////////////////////////////////////////////////////////

my question is:

if I use the cos.write(messageString.getBytes()); I encountered "The security account database contains an internal inconsistency" after it sent garbage with my ipaq ID.

and if I use the print_writer.print("print something"); I just get the garbage with my ipaq ID.

can anyone help me with this? I'm just trying to send simple text from IPAQ to PC. and receiving the actual text in the PC side.

is there some procedure that I have to follow to communicate with IPAQ?

and any idea how to convert the garbage text?

and lastly what is the meaning for "The security account database contains an internal inconsistency"?

thanks in advance.

[2548 byte] By [ecco16] at [2007-9-30 21:05:20]
# 1

Hello,

I am having the same problem (Pocket PC 2003, COM3, IR) and wondering if you found any solution or workaround of the problem, or at leasr cause of the problem. I am doing it in Embedded Visual C++ though.

Thanks for your time and looking forward tohearing from you.

Regards,

Jabran

jabran.asghar@futureit.ch

asgharj at 2007-7-7 2:37:06 > top of Java-index,Administration Tools,Sun Connection...
# 2
I found out that the garbage is actually a protocol for irda.so i'm using the rawIR, which is COM2: instead of COM3: on IPAQ 4150.
ecco16 at 2007-7-7 2:37:06 > top of Java-index,Administration Tools,Sun Connection...
# 3

Hi

I am using a HP iPaq h2210 with build-in infra red port, which can be read/written through COM2.

I wrote a little Java app using CEJavaComm 0.7 :

import javax.comm.*;

import java.io.*;

public class Test {

private static CommPortIdentifier portId;

private static CommPortIdentifier somePortId;

private static SerialPort serialPort;

private static InputStream is;

private static BufferedReader cmd = ( new BufferedReader( new InputStreamReader( System.in ) ) );

private static int buffer;

public static void main(String[] args)

{

try

{

CommDriver driver =

(CommDriver)Class.forName("com.sun.comm.Win32Driver").newInstance();

driver.initialize();

} catch (Exception e) {

System.out.println( e.getMessage () );

}

java.util.Enumeration ports = CommPortIdentifier.getPortIdentifiers();

System.out.println( "Ports found :" );

while( ports.hasMoreElements() )

{

somePortId = (CommPortIdentifier) ports.nextElement();

System.out.println(

somePortId.getName()

+ " used by "

+ somePortId.getCurrentOwner()

);

if( somePortId.getName().equals("COM2:") )

{

portId = somePortId;

}

}

System.out.println( "End ports found" );

if( portId != null )

{

try

{

System.out.println( "Opening " + portId.getName() + " ..." );

serialPort = (SerialPort) portId.open("Test", 2000);

is = serialPort.getInputStream();

while( true )

{

System.out.print( "-" );

buffer = is.read();

System.out.print( buffer );

}

}

catch( Exception e )

{

e.printStackTrace();

}

}

try

{

cmd.readLine();

}

catch( IOException e)

{

e.printStackTrace();

}

}

}

- I can found all COM ports without any problem

- all ports are said to be free (not owned)

- I can open COM1 and read data

but when I try the same with COM2 (infra-red) I get a PortInUseException saying that the port is currently owned by other app, or cannot be accessed. As the port is free (and should be as I磎 not running anything else) there must be some other reason... do you have any idea ?

I happened to find a web page saying CEJavaComm can be used with COM ports and *maybe* IRCOM :

"Description: A driver implementation for the Java Communications API for the WindowsCE/Pocket PC architecture. This driver supports RS232 (serial) ports (and possibly IRCOM but untested)."

Could this be the reason ?

Thanks for your help

Stephane_INSA at 2007-7-7 2:37:06 > top of Java-index,Administration Tools,Sun Connection...
# 4

try closing the port first before you try to open the same port to get/send data again for COM2:

btw, what CEJAVACOMM package are you using?

I used teilo package and it works fine for the raw IR.

as long as I know, the statement

"Description: A driver implementation for the Java Communications API for the WindowsCE/Pocket PC architecture. This driver supports RS232 (serial) ports (and possibly IRCOM but untested)."

the IR works the same as the RS232, but I use the RS232 infrared and not the USB.

ecco16 at 2007-7-7 2:37:06 > top of Java-index,Administration Tools,Sun Connection...
# 5
hi,i can not get teilo package to devellop application on my pocket pc.can you tell me where to get it, or if you have it send to me, pleasethanks
fvasiliu at 2007-7-7 2:37:06 > top of Java-index,Administration Tools,Sun Connection...
# 6
try http://www.teilo.net/software/CEJavaComm/or try to email in the discussion list cejavacomm@teilo.net
ecco16 at 2007-7-7 2:37:06 > top of Java-index,Administration Tools,Sun Connection...
# 7
i try to download from link but it does not work the downlod.i sent them one email, i hope to response thanks
fvasiliu at 2007-7-7 2:37:06 > top of Java-index,Administration Tools,Sun Connection...
# 8

i also want to read raw ir data using the serial comm api. i've tried to use the CEJavaComm 0.8, but it did not work.

you wrote that it the teilo implementation worked, but i cannot download it from the location. could you send me a copy of the api via mail?

best regards

Ulrich

nafs@gmx.de at 2007-7-7 2:37:06 > top of Java-index,Administration Tools,Sun Connection...