From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi@qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sun Oct 21 11:38:45 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sun, 21 Oct 2007 11:38:45 -0600
Subject: [Rxtx] [Action Required?] The list is going live again.
Message-ID: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
http://mailman.qbang.org/mailman/options/rxtx
If you enter your email address and hit the remind button, a password will be emailed to you.
I'll try to wait a while before opening the gates. We have several emails pending.
--
Trent Jarvi
tjarvi at qbang.org
From lists2006.wayne at gmail.com Mon Oct 22 04:27:35 2007
From: lists2006.wayne at gmail.com (Wayne Gemmell)
Date: Mon, 22 Oct 2007 12:27:35 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
Message-ID: <200710221227.36046.wayne@flashmedia.co.za>
Hi All
I have a program the monitors USSD sessions using a wavecom modem. About 2% of
my transactions come back with funny characters in the first 10 or so
characters (I'm not monitoring it they are happening later.). This is
illustrated in the logging output below. I've added the receiving code below.
Has anyone seen similar results?
2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
(time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
private String readInput() {
int numBytes,count = 1;
StringBuffer sb = new StringBuffer();
byte [] readBuffer = new byte[50];
waitForInput=true;
while(waitForInput)
try {
Thread.sleep(count * 100);
count++;
if(count == 50) {
logger.error("Time out waiting for response");
return null;
}
while (inputStream.available() > 0) {
numBytes = inputStream.read(readBuffer);
if(numBytes<=1)
continue;
sb.append(new String(readBuffer)).substring(0,numBytes);
for(int i=0;i
public void serialEvent(SerialPortEvent event) {
// TODO Auto-generated method stub
switch (event.getEventType()) {
case SerialPortEvent.DATA_AVAILABLE:
waitForInput = false;
}
}
--
Regards
Wayne
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sun Oct 21 11:38:45 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sun, 21 Oct 2007 11:38:45 -0600
Subject: [Rxtx] [Action Required?] The list is going live again.
Message-ID: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
http://mailman.qbang.org/mailman/options/rxtx
If you enter your email address and hit the remind button, a password will be emailed to you.
I'll try to wait a while before opening the gates. We have several emails pending.
--
Trent Jarvi
tjarvi at qbang.org
From lists2006.wayne at gmail.com Mon Oct 22 04:27:35 2007
From: lists2006.wayne at gmail.com (Wayne Gemmell)
Date: Mon, 22 Oct 2007 12:27:35 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
Message-ID: <200710221227.36046.wayne@flashmedia.co.za>
Hi All
I have a program the monitors USSD sessions using a wavecom modem. About 2% of
my transactions come back with funny characters in the first 10 or so
characters (I'm not monitoring it they are happening later.). This is
illustrated in the logging output below. I've added the receiving code below.
Has anyone seen similar results?
2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
(time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
private String readInput() {
int numBytes,count = 1;
StringBuffer sb = new StringBuffer();
byte [] readBuffer = new byte[50];
waitForInput=true;
while(waitForInput)
try {
Thread.sleep(count * 100);
count++;
if(count == 50) {
logger.error("Time out waiting for response");
return null;
}
while (inputStream.available() > 0) {
numBytes = inputStream.read(readBuffer);
if(numBytes<=1)
continue;
sb.append(new String(readBuffer)).substring(0,numBytes);
for(int i=0;i
public void serialEvent(SerialPortEvent event) {
// TODO Auto-generated method stub
switch (event.getEventType()) {
case SerialPortEvent.DATA_AVAILABLE:
waitForInput = false;
}
}
--
Regards
Wayne
From netbeans at gatworks.com Mon Oct 22 13:50:37 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 15:50:37 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <471CFF0D.4030601@gatworks.com>
Is it a USB modem? Or a real serial modem?
When serialUSB ( kernel module ) starts up, i usually get some funny
characters from the GPS receiver. After that it appears ok.
maybe a bit of rxtx debugging is in order.
BTW: those funny chars is '\0' or null, or a control-@ ( as i vaguely
remember )
Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2% of
> my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code below.
> Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
> tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new String(readBuffer)).substring(0,numBytes);
> for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From netbeans at gatworks.com Mon Oct 22 16:03:54 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 18:03:54 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <471CFF0D.4030601@gatworks.com>
References: <200710221227.36046.wayne@flashmedia.co.za>
<471CFF0D.4030601@gatworks.com>
Message-ID: <471D1E4A.4080601@gatworks.com>
Also, are u shure this works?
does not a new CharAt(i) get shifted down from the length of the string?
i like to do this in reverse ( for ( int i = sb.length-1; i > 0 ; i-- )
{ if(sb.charAt(i)==0) sb.deleteCharAt(i); }
just a thought :}
>> for(int i=0;i> if(sb.charAt(i)==0)
>> sb.deleteCharAt(i);
>> }
>>
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sun Oct 21 11:38:45 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sun, 21 Oct 2007 11:38:45 -0600
Subject: [Rxtx] [Action Required?] The list is going live again.
Message-ID: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
http://mailman.qbang.org/mailman/options/rxtx
If you enter your email address and hit the remind button, a password will be emailed to you.
I'll try to wait a while before opening the gates. We have several emails pending.
--
Trent Jarvi
tjarvi at qbang.org
From lists2006.wayne at gmail.com Mon Oct 22 04:27:35 2007
From: lists2006.wayne at gmail.com (Wayne Gemmell)
Date: Mon, 22 Oct 2007 12:27:35 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
Message-ID: <200710221227.36046.wayne@flashmedia.co.za>
Hi All
I have a program the monitors USSD sessions using a wavecom modem. About 2% of
my transactions come back with funny characters in the first 10 or so
characters (I'm not monitoring it they are happening later.). This is
illustrated in the logging output below. I've added the receiving code below.
Has anyone seen similar results?
2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
(time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
private String readInput() {
int numBytes,count = 1;
StringBuffer sb = new StringBuffer();
byte [] readBuffer = new byte[50];
waitForInput=true;
while(waitForInput)
try {
Thread.sleep(count * 100);
count++;
if(count == 50) {
logger.error("Time out waiting for response");
return null;
}
while (inputStream.available() > 0) {
numBytes = inputStream.read(readBuffer);
if(numBytes<=1)
continue;
sb.append(new String(readBuffer)).substring(0,numBytes);
for(int i=0;i
public void serialEvent(SerialPortEvent event) {
// TODO Auto-generated method stub
switch (event.getEventType()) {
case SerialPortEvent.DATA_AVAILABLE:
waitForInput = false;
}
}
--
Regards
Wayne
From netbeans at gatworks.com Mon Oct 22 13:50:37 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 15:50:37 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <471CFF0D.4030601@gatworks.com>
Is it a USB modem? Or a real serial modem?
When serialUSB ( kernel module ) starts up, i usually get some funny
characters from the GPS receiver. After that it appears ok.
maybe a bit of rxtx debugging is in order.
BTW: those funny chars is '\0' or null, or a control-@ ( as i vaguely
remember )
Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2% of
> my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code below.
> Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
> tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new String(readBuffer)).substring(0,numBytes);
> for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From netbeans at gatworks.com Mon Oct 22 16:03:54 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 18:03:54 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <471CFF0D.4030601@gatworks.com>
References: <200710221227.36046.wayne@flashmedia.co.za>
<471CFF0D.4030601@gatworks.com>
Message-ID: <471D1E4A.4080601@gatworks.com>
Also, are u shure this works?
does not a new CharAt(i) get shifted down from the length of the string?
i like to do this in reverse ( for ( int i = sb.length-1; i > 0 ; i-- )
{ if(sb.charAt(i)==0) sb.deleteCharAt(i); }
just a thought :}
>> for(int i=0;i> if(sb.charAt(i)==0)
>> sb.deleteCharAt(i);
>> }
>>
From Martin.Oberhuber at windriver.com Tue Oct 23 10:57:46 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Tue, 23 Oct 2007 18:57:46 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Hello,
I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
Terminal in Eclipse.
On initial startup of my application, /dev/term/b is always
detected. But when I call getPortIdentifier(), the nested
getPortIdentifiers() does not detect it any more. It seems
that testRead() fails when RXTX is being re-initialized.
It fails not always, but approximately 8 times out of 10 tries.
It looks like the code is broken due to the fix in
CommPortIdentifier which was added for
http://bugzilla.qbang.org/show_bug.cgi?id=48
Has anybody seen this before, or can give any advice?
Unfortunately, I currently don't have a compile
environment available on Solaris such that I could
try a debug version to see what's causing the port
detection to fail in native code. Does anybody have
a Solaris debug version available?
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From will.tatam at red61.com Tue Oct 23 12:26:29 2007
From: will.tatam at red61.com (Will Tatam)
Date: Tue, 23 Oct 2007 19:26:29 +0100
Subject: [Rxtx] Release date for 2.2
Message-ID: <471E3CD5.4030605@red61.com>
Before everything went tits up with the server there was talk about
preparing for a 2.2 release. Is there a timescale for this and is there
a document somewhere as to what changes this will contain ?
--
Will Tatam
Systems Architect
Red Sixty One LTD
0845 867 2203 ext 103
From tjarvi at qbang.org Tue Oct 23 17:07:37 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:07:37 -0600 (MDT)
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Message-ID:
On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
> Hello,
>
> I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> Terminal in Eclipse.
>
> On initial startup of my application, /dev/term/b is always
> detected. But when I call getPortIdentifier(), the nested
> getPortIdentifiers() does not detect it any more. It seems
> that testRead() fails when RXTX is being re-initialized.
>
> It fails not always, but approximately 8 times out of 10 tries.
>
> It looks like the code is broken due to the fix in
> CommPortIdentifier which was added for
> http://bugzilla.qbang.org/show_bug.cgi?id=48
>
> Has anybody seen this before, or can give any advice?
>
> Unfortunately, I currently don't have a compile
> environment available on Solaris such that I could
> try a debug version to see what's causing the port
> detection to fail in native code. Does anybody have
> a Solaris debug version available?
>
Hi Martin,
I built an Ad Hoc version for sol10 with -g for you and put it in the
ToyBox.
http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/sparc-sun-solaris2.10-debug
r2 was a second build so its all just 2.1-7.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:12:09 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:12:09 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E3CD5.4030605@red61.com>
References: <471E3CD5.4030605@red61.com>
Message-ID:
On Tue, 23 Oct 2007, Will Tatam wrote:
> Before everything went tits up with the server there was talk about
> preparing for a 2.2 release. Is there a timescale for this and is there
> a document somewhere as to what changes this will contain ?
>
>
Hi Will,
So far, I've been doing the best I can just to pull rxtx out of a pile of
inodes.
We can start looking at a new release now. The first thing I want to do
is go back ane encorperate the changes Martin has been working on. I'll
have a few minor changes also. This is a good time to get the release
out.
There isn't a list of changes right now. What we could do is have Martin
post his changes to the list again and start there. Or I can dig though
my email and find them if he does not have them handy.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:57:40 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:57:40 -0600 (MDT)
Subject: [Rxtx] Wiki and Spambots
In-Reply-To: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
References: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
Message-ID:
On Tue, 17 Jul 2007, Andre-John Mas wrote:
> Hi,
>
> Looks like spambots are wrecking havoc on the Wiki. Had to correct:
>
> http://rxtx.qbang.org/wiki/index.php/Examples
> http://rxtx.qbang.org/wiki/index.php/
> Two_way_communcation_with_the_serial_port
>
> Any chance we can add a captcha for account creation?
>
Late but Done. We actually had spambots trying to write over each other.
I also locked the front page but left everything else editable by anyone
willing to create an account. The pages should be clean again.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 18:29:55 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:29:55 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
Message-ID: <471E9203.9010105@gatworks.com>
> There isn't a list of changes right now. What we could do is have Martin
> post his changes to the list again and start there. Or I can dig though
> my email and find them if he does not have them handy.
here is a diff of the changes I made to my local rxtx ,
gimme a shout when u get ready to review.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071023/66665b8a/attachment-0001.pl
From netbeans at gatworks.com Tue Oct 23 18:37:24 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:37:24 -0400
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID: <471E93C4.4020501@gatworks.com>
a
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so it
> cant take 115200!!!!!!!!!!!!!!
can u tell me why? int is approx +/- 2gig
From tod at todbot.com Tue Oct 23 18:41:29 2007
From: tod at todbot.com (Tod E. Kurt)
Date: Tue, 23 Oct 2007 17:41:29 -0700
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID:
In Java, ints go from -2147483648 to 2147483647, inclusive.
http://java.sun.com/docs/books/jls/third_edition/html/
typesValues.html#4.2.1
On Jul 31, 2007, at 8:27 a, arnab bhaumik wrote:
> hi all,
>
> i am wondering how to get this speed (115.2kbps) with rxtx????
>
>
>
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so
> it cant take 115200!!!!!!!!!!!!!!
>
> please help me
> arnab
>
> --
> Arnab Bhaumik / VU2BPW
>
> Proprietor and Design Engineer,
>
> AB Telecomm.
> Rajchandrapur, PO- Ghoshpara(Bally).
> Howrah, West Bengal.
> Pin - 711227
> Ph- (033) 26716307
> Mob- 9433927150
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Tue Oct 23 19:44:08 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 19:44:08 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E9203.9010105@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>> There isn't a list of changes right now. What we could do is have Martin
>> post his changes to the list again and start there. Or I can dig though my
>> email and find them if he does not have them handy.
>
> here is a diff of the changes I made to my local rxtx ,
> gimme a shout when u get ready to review.
>
Great stuff Uncle George,
I just looked through the diff for flag and discuss items. I'll look
again tomorrow night a little closer. Have you tried the code that
replaces ...
-#if defined(TIOCSERGETLSR)
int change;
if( !ioctl( fd, TIOCSERGETLSR, &change ) ) {
return(1);
}
-#endif /* TIOCSERGETLSR */
... with ...
+ return check_line_status_register_with_GETLSR( eis );
+
+ return check_line_status_register_without_GETLSR( eis );
... on a Solaris/*BSD machine? There is obviously the problem with
multiport serial cards that do not support the ioctl but on systems other
than Linux, there isn't a define for the TIOCSERGETLSR.
It could be that I'm just missing a detail by looking only at the diff.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 20:11:45 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 22:11:45 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID: <471EA9E1.7070707@gatworks.com>
> ... on a Solaris/*BSD machine? There is obviously the problem with
> multiport serial cards that do not support the ioctl but on systems
> other than Linux, there isn't a define for the TIOCSERGETLSR.
>
> It could be that I'm just missing a detail by looking only at the diff.
The issue was on (linux) systems that have TIOCSERGETLSR defined for an
ioctl, but the (USB) device driver itself may or may not have any code
for processing the TIOCSERGETLSR. So u have to support both as if
TIOCSERGETLSR does and does not exist - at run time.
So what happens on a sys that fully implements TIOCSERGETLSR? What
happens on a system that does not implement (define) TIOCSERGETLSR.
I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
appropriate, but I wont be able to test the issue with unplugging the
USB device, and rxtx spinning as a result.
From tjarvi at qbang.org Tue Oct 23 20:39:31 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 20:39:31 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471EA9E1.7070707@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
<471EA9E1.7070707@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>
>> ... on a Solaris/*BSD machine? There is obviously the problem with
>> multiport serial cards that do not support the ioctl but on systems other
>> than Linux, there isn't a define for the TIOCSERGETLSR.
>>
>> It could be that I'm just missing a detail by looking only at the diff.
>
> The issue was on (linux) systems that have TIOCSERGETLSR defined for an
> ioctl, but the (USB) device driver itself may or may not have any code for
> processing the TIOCSERGETLSR. So u have to support both as if TIOCSERGETLSR
> does and does not exist - at run time.
>
> So what happens on a sys that fully implements TIOCSERGETLSR? What happens on
> a system that does not implement (define) TIOCSERGETLSR.
>
> I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
> appropriate, but I wont be able to test the issue with unplugging the USB
> device, and rxtx spinning as a result.
>
Hmm OK.
I had not thought about USB/bluetooth dongles.
We should be able to do what you require and handle the systems that don't
implement the call. It will just take a bit more work. I'll look into it
more tomorrow.
Thanks George
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 22:21:12 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 22:21:12 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471EA9E1.7070707@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
<471EA9E1.7070707@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>
>> ... on a Solaris/*BSD machine? There is obviously the problem with
>> multiport serial cards that do not support the ioctl but on systems other
>> than Linux, there isn't a define for the TIOCSERGETLSR.
>>
>> It could be that I'm just missing a detail by looking only at the diff.
>
> The issue was on (linux) systems that have TIOCSERGETLSR defined for an
> ioctl, but the (USB) device driver itself may or may not have any code for
> processing the TIOCSERGETLSR. So u have to support both as if TIOCSERGETLSR
> does and does not exist - at run time.
>
> So what happens on a sys that fully implements TIOCSERGETLSR? What happens on
> a system that does not implement (define) TIOCSERGETLSR.
>
> I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
> appropriate, but I wont be able to test the issue with unplugging the USB
> device, and rxtx spinning as a result.
>
As a quick followup, this is easy enough to try on Linux. Just undef
TIOCSERGETLSR after the includes and build. When it blows up, thats what
will happen on the traditional systems.
--
Trent Jarvi
tjarvi at qbang.org
From wayne at flashmedia.co.za Wed Oct 24 01:04:06 2007
From: wayne at flashmedia.co.za (Wayne Gemmell)
Date: Wed, 24 Oct 2007 09:04:06 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <200710240904.06544.wayne@flashmedia.co.za>
Hi all
Sorry for the re-post but did this post get through on Monday? I see theres
plenty email today.
Thanks
Wayne
On Monday 22 October 2007 12:27:35 Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2%
> of my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code
> below. Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,
>s tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new
> String(readBuffer)).substring(0,numBytes); for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From Martin.Oberhuber at windriver.com Wed Oct 24 03:17:04 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:17:04 +0200
Subject: [Rxtx] RXTX cannot connect a specific board without HW flow control
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C671@ism-mail03.corp.ad.wrs.com>
Re-sending due to mailing list issue:
Hi RXTX community,
we have an odd problem here: there is one specific board that
RXTX connot connect to at 9600 baud / 8n1 / no flow-control:
I see absolutely no output from the remote.
When I enable flow control, it connects fine.
HyperTerminal connets fine both with and without flow control.
Other boards of the same making (i.e. same electronics, different
physical hardware) connect ok both with and without flow control.
Has anybody seen such behavior before?
Any ideas what could be causing this?
It seems that RXTX is less fault tolerant than HyperTerminal
when it comes to flow control...
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From Martin.Oberhuber at windriver.com Wed Oct 24 03:18:21 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:18:21 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
Re-sending due to mailing list issues
Hi all,
I have uploaded an exact description of the issue, and
a fix which I think is good, to RXTX Bugzilla:
http://bugzilla.qbang.org/show_bug.cgi?id=83
Please consider including this into the code base.
The fix on Bugzilla is slightly updated compared to
what I sent before, and works around another potential
deadlock.
We're using this fixed version for our commercial product,
and it's included in the Eclipse bundles at
http://rxtx.qbang.org/eclipse/
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Oberhuber, Martin
> Sent: Thursday, September 20, 2007 3:11 PM
> To: Trent Jarvi; taj at www.linux.org.uk; tjarvi at mathworks.com;
> rxtx at qbang.org
> Cc: Stieber, Uwe; Gutschelhofer, Martin; Scharf, Michael
> Subject: Deadlock in RXTX 2.1-7
>
> Hello,
>
> We have run into a deadlock with RXTX, see attached thread dump.
> this is critical for our commercial application picking up RXTX,
> and it might be critical for others as well.
>
> The problem occurs when multiple threads (parts of the application)
> try to open a CommPort at the same time - especially in the following
> situation:
> * Client 1 opens COM1
> * Client 2 tries to open with a wait time of e.g. 5 sec
> - PortOwnership notification is sent
> - Client 2 waits 5 sec to own port
> * If Client 3 tries an open() during these 5 sec it will deadlock.
>
> Here is the problematic Code, from CommPortIdentifier:
>
> public synchronized CommPort open(String TheOwner, int i)
> throws gnu.io.PortInUseException
> {
> if(debug)
> System.out.println("CommPortIdentifier:open("+TheOwner
> + ", " +i+")");
> if (Available == false)
> {
> synchronized (Sync)
> {
>
>
> fireOwnershipEvent(CommPortOwnershipListener.PORT_OWNERSHIP_RE
> QUESTED);
> try
> {
> wait(i);
> }
> catch ( InterruptedException e )
> {
> Thread.currentThread().interrupt();
> }
> }
> }
>
>
> And here is what happens:
> * Thread 1 does open() and locks "this",
> then it locks "Sync",
> then it releases the lock on "this" because going into wait()
>
> * While Thread 1 is waiting, thread 2 now locks "this",
> but it cannot continue locking "Sync" because it is still
> owned by Thread 2. So it keeps locking "this" forever
>
> * Therefore, Thread 1 cannot return from the wait()
>
> Holding two locks is very problematic here, and I think that holding
> the global "synchronized(Sync)" should be avoided. That lock is for
> protecting the list of CommPorts; but here, we are dealing
> with parties
> interested in one specific CommPort only so the given
> CommPortIdentifier
> we are dealing with should not be affected. Or was the original
> Intent to ensure that nobody can call getPortIdentifiers() while
> Negotiation between the port owners is going on?
>
> In general, the whole concept of re-initializing RXTX in the
> getPortIdentifiers() Method is very problematic, because
> 1.) it creates new instances of CommPortIdentifier; therefore,
> a "notify" against a given CommPortIdentifier may not wake
> up other threads waiting on a different CommPortIdentifier
> object that's been instanciated for the same port. This
> might be the reason for the comment
> /* this tosses null pointer?? */
> In internalClosePort().
> 2.) Anybody is free to call getPortIdentifiers() at any
> time. Couldn't re-initializing RXTX break any data
> transmissions that others are currently having?
>
> I've been trying to come up with a fix, but I don't think I
> know enough about RXTX to understand how to better update the
> List of known ports in getPortIdentifiers() without having
> to re-initialize everything. So, my fix seems to be more of
> a workaround, although it should address the most burning
> issues of deadlock.
>
> Find attached the new version of CommPortIdentifier that
> I have come up with. Please review and let me know what
> You think! I think that a real fix needs to get the list of
> CommPort names out of the RXTXDriver without re-initializing
> Everything, but I'd like to get your comments.
>
> Thanks,
> --
> Martin Oberhuber
> Wind River Systems, Inc.
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
>
>
From Martin.Oberhuber at windriver.com Wed Oct 24 03:35:03 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:35:03 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C6B5@ism-mail03.corp.ad.wrs.com>
Hello Trent,
thanks for your efforts - but it doesn't run on my box.
Looks like you built for SPARC64 but I need SPARC32 ?
java.lang.UnsatisfiedLinkError:
/folk/mober/RSETest/sol-3.3.1/eclipse/plugins/gnu.io.rxtx.solaris.sparc_
2.1.7.3_v20071015/os/solaris/sparc/librxtxSerial.so: ld.so.1: eclipse:
fatal:
/folk/mober/RSETest/sol-3.3.1/eclipse/plugins/gnu.io.rxtx.solaris.sparc_
2.1.7.3_v20071015/os/solaris/sparc/librxtxSerial.so: wrong ELF class:
ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver
And actually, I was not looking for a build with -g but
rather for a build with macros
DEBUG_VERBOSE
ENTER
LEAVE
or whatever else makes sense for logging enabled...
in SerialImp.c, I found the macros mentioned though
you might know better what logging makes sense
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Wednesday, October 24, 2007 1:08 AM
> To: Oberhuber, Martin
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] NoSuchPortException in
> getPortIdentifier() on Solaris
>
> I built an Ad Hoc version for sol10 with -g for you and put it in the
> ToyBox.
>
> http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/spa
> rc-sun-solaris2.10-debug
>
> r2 was a second build so its all just 2.1-7.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:05:45 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:05:45 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C70B@ism-mail03.corp.ad.wrs.com>
Hi Trent,
I found a Java fix which works most of the time:
in getPortIdentifier(), do not re-initialize RXTX
all the time but only when it is necessary.
I uploaded a full description, patch and updated
.java file to
http://bugzilla.qbang.org/show_bug.cgi?id=48
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Wednesday, October 24, 2007 1:08 AM
> To: Oberhuber, Martin
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] NoSuchPortException in
> getPortIdentifier() on Solaris
>
> On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
>
> > Hello,
> >
> > I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> > Terminal in Eclipse.
> >
> > On initial startup of my application, /dev/term/b is always
> > detected. But when I call getPortIdentifier(), the nested
> > getPortIdentifiers() does not detect it any more. It seems
> > that testRead() fails when RXTX is being re-initialized.
> >
> > It fails not always, but approximately 8 times out of 10 tries.
> >
> > It looks like the code is broken due to the fix in
> > CommPortIdentifier which was added for
> > http://bugzilla.qbang.org/show_bug.cgi?id=48
> >
> > Has anybody seen this before, or can give any advice?
> >
> > Unfortunately, I currently don't have a compile
> > environment available on Solaris such that I could
> > try a debug version to see what's causing the port
> > detection to fail in native code. Does anybody have
> > a Solaris debug version available?
> >
>
> Hi Martin,
>
> I built an Ad Hoc version for sol10 with -g for you and put it in the
> ToyBox.
>
> http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/spa
> rc-sun-solaris2.10-debug
>
> r2 was a second build so its all just 2.1-7.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:08:03 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:08:03 +0200
Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port
In-Reply-To: <460801A4097E3D4CA04CC64EE6485848020CB5CC@ism-mail03.corp.ad.wrs.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com>
Hi Greg and others,
I think that the issue is actually fixed by the updates I've submitted
for CommPortIdentifier recently.
With these fixes, it is no longer necessary to get a fresh
CommPortIdentifier.
The problem was, that RXTX had re-initialized its CommPortIdentifier
list
too often, thus losing the context info; that was a problem for other
applications
as well (sharing access to a com port; deadlocks).
All my fixes are included in the patch on
http://bugzilla.qbang.org/show_bug.cgi?id=48
More explanations, and an older interim version of my patches are on
http://bugzilla.qbang.org/show_bug.cgi?id=83
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On
Behalf Of Oberhuber, Martin
Sent: Thursday, June 28, 2007 1:23 PM
To: greg.johnson at esrf.fr
Cc: RXTX Developers and Users; ruskin at pwlinda.mt.umist.ac.uk
Subject: Re: [Rxtx] PortInUseException - Cannot close and reopen
serial port
Hi Greg,
Many many thanks!
Getting a fresh CommPortIdentifier helped indeed.
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: Greg Johnson
[mailto:greg.johnson at manchester.ac.uk]
Sent: Wednesday, June 27, 2007 5:50 PM
To: Oberhuber, Martin
Cc: RXTX Developers and Users;
ruskin at pwlinda.mt.umist.ac.uk
Subject: Re: [Rxtx] PortInUseException - Cannot close
and reopen serial port
Hello Martin,
We found that we had to get a fresh CommPortIdentifier
each time - reusing the previous one, even though the port had been
closed, caused this to barf.
while (true) {
portId=CommPortIdentifier.getPortIdentifier(pName);
Thread.sleep(2000); // or else USB dongles barf
serialport = (SerialPort) portId.open("MyApp",100);
// do something interesting
serialport.close();
}
Previously, we just tried to do
serialport = (SerialPort) portId.open("MyApp,100);
or
SerialPort serialport2 = ...
a second time, but that gave the so-called
PortInUseException.
We're now limping along. Still struggling with
USB-dongles - seems to need a full 2s after insertion to reliably be
able to open the serial port.
This was a problem on OSX and WinXPSP2 both. We
downloaded the "2.1-8" (which reports itself as 2.1-7) from CSV - it
helped on the OSX side as it stopped flooding the console with
irrelevant locking warnings. Other than that, we saw no change in
behaviour.
Cheers,
greg
------------------------------------------------------------------------
-
Greg Johnson
Research Fellow at University of Manchester
Scientific Collaborator at ESRF - European Synchrotron
greg.johnson at esrf.fr
greg.johnson at ieee.org
+33 (0)4 76 88 28 37
On 27 Jun 2007, at 17:35, Oberhuber, Martin wrote:
Hello,
did anybody find a solution for the issue on
Windows, where after
port.close() the port cannot be opened
immediately but throws
a PortInUseException?
There were Reports that it took 30 seconds
before the port got
actually free again, did anybody dig any deeper
and find the
real issue?
This is about rxtx-2.1-7r2 on Windows XP SP2.
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: rxtx-bounces at qbang.org
[mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson
Sent: Wednesday, March 28, 2007 10:43 PM
To: rxtx at qbang.org
Cc: ruskin at pwlinda.mt.umist.ac.uk
Subject: [Rxtx] Cannot close and reopen
serial port
Dear all,
It appears I cannot close a port
properly:
SerialPort serialport =
portid.open("myprog",100);
// do some stuff, all works fine
serialport.close(); // all seems fine
but...
SerialPort sp2 =
portid.open("myprog",100);
throws PortInUseException.
And when I dig into the rxtx code, I
find in CommPort.java, in close():
CommPortIdentifier cp =
CommPortIdentifier.getPortIdentifier(this);
(line 64 or there abouts)
but this throws a NoSuchPortException
which is caught but ignored (line 74ish).
Can anyone suggest how this could
happen: a port that was valid, opened, and used, throws a NSPE when it
comes to closing it? I'm pulling my (remaining) hair out over this one!
Cheers,
greg
PS And thanks for RXTX - it's great to
have!
PPS (21.-7. winxp/osx both, java 1.5)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071024/ea1ddbfa/attachment-0001.html
From Martin.Oberhuber at windriver.com Wed Oct 24 04:09:16 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:09:16 +0200
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C716@ism-mail03.corp.ad.wrs.com>
Hi Trent and Will,
All of my changes are actually in CommPortIdentifier.java only.
The most recent version is attached to
http://bugzilla.qbang.org/show_bug.cgi?id=48
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Trent Jarvi
> Sent: Wednesday, October 24, 2007 1:12 AM
> To: Will Tatam
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] Release date for 2.2
>
> On Tue, 23 Oct 2007, Will Tatam wrote:
>
> > Before everything went tits up with the server there was talk about
> > preparing for a 2.2 release. Is there a timescale for this
> and is there
> > a document somewhere as to what changes this will contain ?
> >
> >
>
> Hi Will,
>
> So far, I've been doing the best I can just to pull rxtx out
> of a pile of
> inodes.
>
> We can start looking at a new release now. The first thing I
> want to do
> is go back ane encorperate the changes Martin has been
> working on. I'll
> have a few minor changes also. This is a good time to get
> the release
> out.
>
> There isn't a list of changes right now. What we could do is
> have Martin
> post his changes to the list again and start there. Or I can
> dig though
> my email and find them if he does not have them handy.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:17:11 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:17:11 +0200
Subject: [Rxtx] virtual serial port
In-Reply-To: <1183556787.10682.6.camel@alvin>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C72F@ism-mail03.corp.ad.wrs.com>
Hi Joshua,
I think it's undocumented, but if you look at the
code in RXTXCommDriver.java you'll see that there
are several options to manually specify ports
which RXTX does not detect automatically.
One of them is this:
System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/myPort");
it also takes a list of ports, separated by
path.separator
Note that when you manually specify the ports, it
will not even try to scan ports itself any more.
So scanned ports need to be added to the System
Property.
Hope this helps,
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Joshua Chambers
> Sent: Wednesday, July 04, 2007 3:46 PM
> To: rxtx at qbang.org
> Subject: [Rxtx] virtual serial port
>
> Hello!
>
> Okay, I am trying to write a cross-platform application that
> talks to a
> custom little micro-controller box. This box uses a virtual serial
> port, which happens to have nice support under linux. When
> you plug it
> in, it creates a serial port at /dev/ttyACM0 which I can
> connect to and
> talk to with a regular serial port terminal.
>
> I've also tried this in windows, and with the proper .inf file it uses
> usbser.sys and works fine, I can talk with it. I've had different
> unsuccessful behavior from this library on each platform so far.
>
> Under linux, it seems to be unable to see the port. when I try to do
> CommPortIdentifier.getPortIdentifier("/dev/ttyACM0") I get a
> NoSuchPortException and when I enumerate the ports, I get only
> one, /dev/ttyS0.
>
> Is this any reason I shouldn't be able to point this thing to my
> functioning virtual serial port?
>
> In windows, the port IS listed in the enumeration, but when I try to
> open it, I get a PortInUseException, however when I query to find out
> who the owner is, I get null.
>
> Any help is so greatly appreciated! Thank you!
> Joshua
>
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From netbeans at gatworks.com Wed Oct 24 04:34:22 2007
From: netbeans at gatworks.com (U. George)
Date: Wed, 24 Oct 2007 06:34:22 -0400
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
Message-ID: <471F1FAE.1010407@gatworks.com>
> Re-sending due to mailing list issues
>
> Hi all,
>
> I have uploaded an exact description of the issue, and
>
I think issues will again appear when you realize that serial (usb)
devices can disappear and reappear from the initial scan ( even with
different device names ) .
At startup, there was only a ttyUSB0. But later ttyUSB0 disappears, and
ttyUSB1 appears. This happens on linux when one un-plugs the USB device
while its in the open() state, and reinserts the usb device back. The
kernel now gives hard failures to the ioctls BUT wont release resources
until close() for ttyUSB0, Since you plugged the USB device back in, the
kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
ttyUSB0 is closed, that device (ttyUSB0) will also disappear from /dev (
as it is now officially called ttyUSB1 ) .
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sun Oct 21 11:38:45 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sun, 21 Oct 2007 11:38:45 -0600
Subject: [Rxtx] [Action Required?] The list is going live again.
Message-ID: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
http://mailman.qbang.org/mailman/options/rxtx
If you enter your email address and hit the remind button, a password will be emailed to you.
I'll try to wait a while before opening the gates. We have several emails pending.
--
Trent Jarvi
tjarvi at qbang.org
From lists2006.wayne at gmail.com Mon Oct 22 04:27:35 2007
From: lists2006.wayne at gmail.com (Wayne Gemmell)
Date: Mon, 22 Oct 2007 12:27:35 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
Message-ID: <200710221227.36046.wayne@flashmedia.co.za>
Hi All
I have a program the monitors USSD sessions using a wavecom modem. About 2% of
my transactions come back with funny characters in the first 10 or so
characters (I'm not monitoring it they are happening later.). This is
illustrated in the logging output below. I've added the receiving code below.
Has anyone seen similar results?
2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
(time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
private String readInput() {
int numBytes,count = 1;
StringBuffer sb = new StringBuffer();
byte [] readBuffer = new byte[50];
waitForInput=true;
while(waitForInput)
try {
Thread.sleep(count * 100);
count++;
if(count == 50) {
logger.error("Time out waiting for response");
return null;
}
while (inputStream.available() > 0) {
numBytes = inputStream.read(readBuffer);
if(numBytes<=1)
continue;
sb.append(new String(readBuffer)).substring(0,numBytes);
for(int i=0;i
public void serialEvent(SerialPortEvent event) {
// TODO Auto-generated method stub
switch (event.getEventType()) {
case SerialPortEvent.DATA_AVAILABLE:
waitForInput = false;
}
}
--
Regards
Wayne
From netbeans at gatworks.com Mon Oct 22 13:50:37 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 15:50:37 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <471CFF0D.4030601@gatworks.com>
Is it a USB modem? Or a real serial modem?
When serialUSB ( kernel module ) starts up, i usually get some funny
characters from the GPS receiver. After that it appears ok.
maybe a bit of rxtx debugging is in order.
BTW: those funny chars is '\0' or null, or a control-@ ( as i vaguely
remember )
Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2% of
> my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code below.
> Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
> tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new String(readBuffer)).substring(0,numBytes);
> for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From netbeans at gatworks.com Mon Oct 22 16:03:54 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 18:03:54 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <471CFF0D.4030601@gatworks.com>
References: <200710221227.36046.wayne@flashmedia.co.za>
<471CFF0D.4030601@gatworks.com>
Message-ID: <471D1E4A.4080601@gatworks.com>
Also, are u shure this works?
does not a new CharAt(i) get shifted down from the length of the string?
i like to do this in reverse ( for ( int i = sb.length-1; i > 0 ; i-- )
{ if(sb.charAt(i)==0) sb.deleteCharAt(i); }
just a thought :}
>> for(int i=0;i> if(sb.charAt(i)==0)
>> sb.deleteCharAt(i);
>> }
>>
From Martin.Oberhuber at windriver.com Tue Oct 23 10:57:46 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Tue, 23 Oct 2007 18:57:46 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Hello,
I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
Terminal in Eclipse.
On initial startup of my application, /dev/term/b is always
detected. But when I call getPortIdentifier(), the nested
getPortIdentifiers() does not detect it any more. It seems
that testRead() fails when RXTX is being re-initialized.
It fails not always, but approximately 8 times out of 10 tries.
It looks like the code is broken due to the fix in
CommPortIdentifier which was added for
http://bugzilla.qbang.org/show_bug.cgi?id=48
Has anybody seen this before, or can give any advice?
Unfortunately, I currently don't have a compile
environment available on Solaris such that I could
try a debug version to see what's causing the port
detection to fail in native code. Does anybody have
a Solaris debug version available?
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From will.tatam at red61.com Tue Oct 23 12:26:29 2007
From: will.tatam at red61.com (Will Tatam)
Date: Tue, 23 Oct 2007 19:26:29 +0100
Subject: [Rxtx] Release date for 2.2
Message-ID: <471E3CD5.4030605@red61.com>
Before everything went tits up with the server there was talk about
preparing for a 2.2 release. Is there a timescale for this and is there
a document somewhere as to what changes this will contain ?
--
Will Tatam
Systems Architect
Red Sixty One LTD
0845 867 2203 ext 103
From tjarvi at qbang.org Tue Oct 23 17:07:37 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:07:37 -0600 (MDT)
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Message-ID:
On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
> Hello,
>
> I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> Terminal in Eclipse.
>
> On initial startup of my application, /dev/term/b is always
> detected. But when I call getPortIdentifier(), the nested
> getPortIdentifiers() does not detect it any more. It seems
> that testRead() fails when RXTX is being re-initialized.
>
> It fails not always, but approximately 8 times out of 10 tries.
>
> It looks like the code is broken due to the fix in
> CommPortIdentifier which was added for
> http://bugzilla.qbang.org/show_bug.cgi?id=48
>
> Has anybody seen this before, or can give any advice?
>
> Unfortunately, I currently don't have a compile
> environment available on Solaris such that I could
> try a debug version to see what's causing the port
> detection to fail in native code. Does anybody have
> a Solaris debug version available?
>
Hi Martin,
I built an Ad Hoc version for sol10 with -g for you and put it in the
ToyBox.
http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/sparc-sun-solaris2.10-debug
r2 was a second build so its all just 2.1-7.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:12:09 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:12:09 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E3CD5.4030605@red61.com>
References: <471E3CD5.4030605@red61.com>
Message-ID:
On Tue, 23 Oct 2007, Will Tatam wrote:
> Before everything went tits up with the server there was talk about
> preparing for a 2.2 release. Is there a timescale for this and is there
> a document somewhere as to what changes this will contain ?
>
>
Hi Will,
So far, I've been doing the best I can just to pull rxtx out of a pile of
inodes.
We can start looking at a new release now. The first thing I want to do
is go back ane encorperate the changes Martin has been working on. I'll
have a few minor changes also. This is a good time to get the release
out.
There isn't a list of changes right now. What we could do is have Martin
post his changes to the list again and start there. Or I can dig though
my email and find them if he does not have them handy.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:57:40 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:57:40 -0600 (MDT)
Subject: [Rxtx] Wiki and Spambots
In-Reply-To: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
References: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
Message-ID:
On Tue, 17 Jul 2007, Andre-John Mas wrote:
> Hi,
>
> Looks like spambots are wrecking havoc on the Wiki. Had to correct:
>
> http://rxtx.qbang.org/wiki/index.php/Examples
> http://rxtx.qbang.org/wiki/index.php/
> Two_way_communcation_with_the_serial_port
>
> Any chance we can add a captcha for account creation?
>
Late but Done. We actually had spambots trying to write over each other.
I also locked the front page but left everything else editable by anyone
willing to create an account. The pages should be clean again.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 18:29:55 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:29:55 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
Message-ID: <471E9203.9010105@gatworks.com>
> There isn't a list of changes right now. What we could do is have Martin
> post his changes to the list again and start there. Or I can dig though
> my email and find them if he does not have them handy.
here is a diff of the changes I made to my local rxtx ,
gimme a shout when u get ready to review.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071023/66665b8a/attachment-0002.pl
From netbeans at gatworks.com Tue Oct 23 18:37:24 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:37:24 -0400
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID: <471E93C4.4020501@gatworks.com>
a
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so it
> cant take 115200!!!!!!!!!!!!!!
can u tell me why? int is approx +/- 2gig
From tod at todbot.com Tue Oct 23 18:41:29 2007
From: tod at todbot.com (Tod E. Kurt)
Date: Tue, 23 Oct 2007 17:41:29 -0700
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID:
In Java, ints go from -2147483648 to 2147483647, inclusive.
http://java.sun.com/docs/books/jls/third_edition/html/
typesValues.html#4.2.1
On Jul 31, 2007, at 8:27 a, arnab bhaumik wrote:
> hi all,
>
> i am wondering how to get this speed (115.2kbps) with rxtx????
>
>
>
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so
> it cant take 115200!!!!!!!!!!!!!!
>
> please help me
> arnab
>
> --
> Arnab Bhaumik / VU2BPW
>
> Proprietor and Design Engineer,
>
> AB Telecomm.
> Rajchandrapur, PO- Ghoshpara(Bally).
> Howrah, West Bengal.
> Pin - 711227
> Ph- (033) 26716307
> Mob- 9433927150
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Tue Oct 23 19:44:08 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 19:44:08 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E9203.9010105@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>> There isn't a list of changes right now. What we could do is have Martin
>> post his changes to the list again and start there. Or I can dig though my
>> email and find them if he does not have them handy.
>
> here is a diff of the changes I made to my local rxtx ,
> gimme a shout when u get ready to review.
>
Great stuff Uncle George,
I just looked through the diff for flag and discuss items. I'll look
again tomorrow night a little closer. Have you tried the code that
replaces ...
-#if defined(TIOCSERGETLSR)
int change;
if( !ioctl( fd, TIOCSERGETLSR, &change ) ) {
return(1);
}
-#endif /* TIOCSERGETLSR */
... with ...
+ return check_line_status_register_with_GETLSR( eis );
+
+ return check_line_status_register_without_GETLSR( eis );
... on a Solaris/*BSD machine? There is obviously the problem with
multiport serial cards that do not support the ioctl but on systems other
than Linux, there isn't a define for the TIOCSERGETLSR.
It could be that I'm just missing a detail by looking only at the diff.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 20:11:45 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 22:11:45 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID: <471EA9E1.7070707@gatworks.com>
> ... on a Solaris/*BSD machine? There is obviously the problem with
> multiport serial cards that do not support the ioctl but on systems
> other than Linux, there isn't a define for the TIOCSERGETLSR.
>
> It could be that I'm just missing a detail by looking only at the diff.
The issue was on (linux) systems that have TIOCSERGETLSR defined for an
ioctl, but the (USB) device driver itself may or may not have any code
for processing the TIOCSERGETLSR. So u have to support both as if
TIOCSERGETLSR does and does not exist - at run time.
So what happens on a sys that fully implements TIOCSERGETLSR? What
happens on a system that does not implement (define) TIOCSERGETLSR.
I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
appropriate, but I wont be able to test the issue with unplugging the
USB device, and rxtx spinning as a result.
From tjarvi at qbang.org Tue Oct 23 20:39:31 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 20:39:31 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471EA9E1.7070707@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
<471EA9E1.7070707@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>
>> ... on a Solaris/*BSD machine? There is obviously the problem with
>> multiport serial cards that do not support the ioctl but on systems other
>> than Linux, there isn't a define for the TIOCSERGETLSR.
>>
>> It could be that I'm just missing a detail by looking only at the diff.
>
> The issue was on (linux) systems that have TIOCSERGETLSR defined for an
> ioctl, but the (USB) device driver itself may or may not have any code for
> processing the TIOCSERGETLSR. So u have to support both as if TIOCSERGETLSR
> does and does not exist - at run time.
>
> So what happens on a sys that fully implements TIOCSERGETLSR? What happens on
> a system that does not implement (define) TIOCSERGETLSR.
>
> I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
> appropriate, but I wont be able to test the issue with unplugging the USB
> device, and rxtx spinning as a result.
>
Hmm OK.
I had not thought about USB/bluetooth dongles.
We should be able to do what you require and handle the systems that don't
implement the call. It will just take a bit more work. I'll look into it
more tomorrow.
Thanks George
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 22:21:12 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 22:21:12 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471EA9E1.7070707@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
<471EA9E1.7070707@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>
>> ... on a Solaris/*BSD machine? There is obviously the problem with
>> multiport serial cards that do not support the ioctl but on systems other
>> than Linux, there isn't a define for the TIOCSERGETLSR.
>>
>> It could be that I'm just missing a detail by looking only at the diff.
>
> The issue was on (linux) systems that have TIOCSERGETLSR defined for an
> ioctl, but the (USB) device driver itself may or may not have any code for
> processing the TIOCSERGETLSR. So u have to support both as if TIOCSERGETLSR
> does and does not exist - at run time.
>
> So what happens on a sys that fully implements TIOCSERGETLSR? What happens on
> a system that does not implement (define) TIOCSERGETLSR.
>
> I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
> appropriate, but I wont be able to test the issue with unplugging the USB
> device, and rxtx spinning as a result.
>
As a quick followup, this is easy enough to try on Linux. Just undef
TIOCSERGETLSR after the includes and build. When it blows up, thats what
will happen on the traditional systems.
--
Trent Jarvi
tjarvi at qbang.org
From wayne at flashmedia.co.za Wed Oct 24 01:04:06 2007
From: wayne at flashmedia.co.za (Wayne Gemmell)
Date: Wed, 24 Oct 2007 09:04:06 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <200710240904.06544.wayne@flashmedia.co.za>
Hi all
Sorry for the re-post but did this post get through on Monday? I see theres
plenty email today.
Thanks
Wayne
On Monday 22 October 2007 12:27:35 Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2%
> of my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code
> below. Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,
>s tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new
> String(readBuffer)).substring(0,numBytes); for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From Martin.Oberhuber at windriver.com Wed Oct 24 03:17:04 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:17:04 +0200
Subject: [Rxtx] RXTX cannot connect a specific board without HW flow control
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C671@ism-mail03.corp.ad.wrs.com>
Re-sending due to mailing list issue:
Hi RXTX community,
we have an odd problem here: there is one specific board that
RXTX connot connect to at 9600 baud / 8n1 / no flow-control:
I see absolutely no output from the remote.
When I enable flow control, it connects fine.
HyperTerminal connets fine both with and without flow control.
Other boards of the same making (i.e. same electronics, different
physical hardware) connect ok both with and without flow control.
Has anybody seen such behavior before?
Any ideas what could be causing this?
It seems that RXTX is less fault tolerant than HyperTerminal
when it comes to flow control...
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From Martin.Oberhuber at windriver.com Wed Oct 24 03:18:21 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:18:21 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
Re-sending due to mailing list issues
Hi all,
I have uploaded an exact description of the issue, and
a fix which I think is good, to RXTX Bugzilla:
http://bugzilla.qbang.org/show_bug.cgi?id=83
Please consider including this into the code base.
The fix on Bugzilla is slightly updated compared to
what I sent before, and works around another potential
deadlock.
We're using this fixed version for our commercial product,
and it's included in the Eclipse bundles at
http://rxtx.qbang.org/eclipse/
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Oberhuber, Martin
> Sent: Thursday, September 20, 2007 3:11 PM
> To: Trent Jarvi; taj at www.linux.org.uk; tjarvi at mathworks.com;
> rxtx at qbang.org
> Cc: Stieber, Uwe; Gutschelhofer, Martin; Scharf, Michael
> Subject: Deadlock in RXTX 2.1-7
>
> Hello,
>
> We have run into a deadlock with RXTX, see attached thread dump.
> this is critical for our commercial application picking up RXTX,
> and it might be critical for others as well.
>
> The problem occurs when multiple threads (parts of the application)
> try to open a CommPort at the same time - especially in the following
> situation:
> * Client 1 opens COM1
> * Client 2 tries to open with a wait time of e.g. 5 sec
> - PortOwnership notification is sent
> - Client 2 waits 5 sec to own port
> * If Client 3 tries an open() during these 5 sec it will deadlock.
>
> Here is the problematic Code, from CommPortIdentifier:
>
> public synchronized CommPort open(String TheOwner, int i)
> throws gnu.io.PortInUseException
> {
> if(debug)
> System.out.println("CommPortIdentifier:open("+TheOwner
> + ", " +i+")");
> if (Available == false)
> {
> synchronized (Sync)
> {
>
>
> fireOwnershipEvent(CommPortOwnershipListener.PORT_OWNERSHIP_RE
> QUESTED);
> try
> {
> wait(i);
> }
> catch ( InterruptedException e )
> {
> Thread.currentThread().interrupt();
> }
> }
> }
>
>
> And here is what happens:
> * Thread 1 does open() and locks "this",
> then it locks "Sync",
> then it releases the lock on "this" because going into wait()
>
> * While Thread 1 is waiting, thread 2 now locks "this",
> but it cannot continue locking "Sync" because it is still
> owned by Thread 2. So it keeps locking "this" forever
>
> * Therefore, Thread 1 cannot return from the wait()
>
> Holding two locks is very problematic here, and I think that holding
> the global "synchronized(Sync)" should be avoided. That lock is for
> protecting the list of CommPorts; but here, we are dealing
> with parties
> interested in one specific CommPort only so the given
> CommPortIdentifier
> we are dealing with should not be affected. Or was the original
> Intent to ensure that nobody can call getPortIdentifiers() while
> Negotiation between the port owners is going on?
>
> In general, the whole concept of re-initializing RXTX in the
> getPortIdentifiers() Method is very problematic, because
> 1.) it creates new instances of CommPortIdentifier; therefore,
> a "notify" against a given CommPortIdentifier may not wake
> up other threads waiting on a different CommPortIdentifier
> object that's been instanciated for the same port. This
> might be the reason for the comment
> /* this tosses null pointer?? */
> In internalClosePort().
> 2.) Anybody is free to call getPortIdentifiers() at any
> time. Couldn't re-initializing RXTX break any data
> transmissions that others are currently having?
>
> I've been trying to come up with a fix, but I don't think I
> know enough about RXTX to understand how to better update the
> List of known ports in getPortIdentifiers() without having
> to re-initialize everything. So, my fix seems to be more of
> a workaround, although it should address the most burning
> issues of deadlock.
>
> Find attached the new version of CommPortIdentifier that
> I have come up with. Please review and let me know what
> You think! I think that a real fix needs to get the list of
> CommPort names out of the RXTXDriver without re-initializing
> Everything, but I'd like to get your comments.
>
> Thanks,
> --
> Martin Oberhuber
> Wind River Systems, Inc.
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
>
>
From Martin.Oberhuber at windriver.com Wed Oct 24 03:35:03 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:35:03 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C6B5@ism-mail03.corp.ad.wrs.com>
Hello Trent,
thanks for your efforts - but it doesn't run on my box.
Looks like you built for SPARC64 but I need SPARC32 ?
java.lang.UnsatisfiedLinkError:
/folk/mober/RSETest/sol-3.3.1/eclipse/plugins/gnu.io.rxtx.solaris.sparc_
2.1.7.3_v20071015/os/solaris/sparc/librxtxSerial.so: ld.so.1: eclipse:
fatal:
/folk/mober/RSETest/sol-3.3.1/eclipse/plugins/gnu.io.rxtx.solaris.sparc_
2.1.7.3_v20071015/os/solaris/sparc/librxtxSerial.so: wrong ELF class:
ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver
And actually, I was not looking for a build with -g but
rather for a build with macros
DEBUG_VERBOSE
ENTER
LEAVE
or whatever else makes sense for logging enabled...
in SerialImp.c, I found the macros mentioned though
you might know better what logging makes sense
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Wednesday, October 24, 2007 1:08 AM
> To: Oberhuber, Martin
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] NoSuchPortException in
> getPortIdentifier() on Solaris
>
> I built an Ad Hoc version for sol10 with -g for you and put it in the
> ToyBox.
>
> http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/spa
> rc-sun-solaris2.10-debug
>
> r2 was a second build so its all just 2.1-7.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:05:45 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:05:45 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C70B@ism-mail03.corp.ad.wrs.com>
Hi Trent,
I found a Java fix which works most of the time:
in getPortIdentifier(), do not re-initialize RXTX
all the time but only when it is necessary.
I uploaded a full description, patch and updated
.java file to
http://bugzilla.qbang.org/show_bug.cgi?id=48
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Wednesday, October 24, 2007 1:08 AM
> To: Oberhuber, Martin
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] NoSuchPortException in
> getPortIdentifier() on Solaris
>
> On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
>
> > Hello,
> >
> > I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> > Terminal in Eclipse.
> >
> > On initial startup of my application, /dev/term/b is always
> > detected. But when I call getPortIdentifier(), the nested
> > getPortIdentifiers() does not detect it any more. It seems
> > that testRead() fails when RXTX is being re-initialized.
> >
> > It fails not always, but approximately 8 times out of 10 tries.
> >
> > It looks like the code is broken due to the fix in
> > CommPortIdentifier which was added for
> > http://bugzilla.qbang.org/show_bug.cgi?id=48
> >
> > Has anybody seen this before, or can give any advice?
> >
> > Unfortunately, I currently don't have a compile
> > environment available on Solaris such that I could
> > try a debug version to see what's causing the port
> > detection to fail in native code. Does anybody have
> > a Solaris debug version available?
> >
>
> Hi Martin,
>
> I built an Ad Hoc version for sol10 with -g for you and put it in the
> ToyBox.
>
> http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/spa
> rc-sun-solaris2.10-debug
>
> r2 was a second build so its all just 2.1-7.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:08:03 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:08:03 +0200
Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port
In-Reply-To: <460801A4097E3D4CA04CC64EE6485848020CB5CC@ism-mail03.corp.ad.wrs.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com>
Hi Greg and others,
I think that the issue is actually fixed by the updates I've submitted
for CommPortIdentifier recently.
With these fixes, it is no longer necessary to get a fresh
CommPortIdentifier.
The problem was, that RXTX had re-initialized its CommPortIdentifier
list
too often, thus losing the context info; that was a problem for other
applications
as well (sharing access to a com port; deadlocks).
All my fixes are included in the patch on
http://bugzilla.qbang.org/show_bug.cgi?id=48
More explanations, and an older interim version of my patches are on
http://bugzilla.qbang.org/show_bug.cgi?id=83
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On
Behalf Of Oberhuber, Martin
Sent: Thursday, June 28, 2007 1:23 PM
To: greg.johnson at esrf.fr
Cc: RXTX Developers and Users; ruskin at pwlinda.mt.umist.ac.uk
Subject: Re: [Rxtx] PortInUseException - Cannot close and reopen
serial port
Hi Greg,
Many many thanks!
Getting a fresh CommPortIdentifier helped indeed.
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: Greg Johnson
[mailto:greg.johnson at manchester.ac.uk]
Sent: Wednesday, June 27, 2007 5:50 PM
To: Oberhuber, Martin
Cc: RXTX Developers and Users;
ruskin at pwlinda.mt.umist.ac.uk
Subject: Re: [Rxtx] PortInUseException - Cannot close
and reopen serial port
Hello Martin,
We found that we had to get a fresh CommPortIdentifier
each time - reusing the previous one, even though the port had been
closed, caused this to barf.
while (true) {
portId=CommPortIdentifier.getPortIdentifier(pName);
Thread.sleep(2000); // or else USB dongles barf
serialport = (SerialPort) portId.open("MyApp",100);
// do something interesting
serialport.close();
}
Previously, we just tried to do
serialport = (SerialPort) portId.open("MyApp,100);
or
SerialPort serialport2 = ...
a second time, but that gave the so-called
PortInUseException.
We're now limping along. Still struggling with
USB-dongles - seems to need a full 2s after insertion to reliably be
able to open the serial port.
This was a problem on OSX and WinXPSP2 both. We
downloaded the "2.1-8" (which reports itself as 2.1-7) from CSV - it
helped on the OSX side as it stopped flooding the console with
irrelevant locking warnings. Other than that, we saw no change in
behaviour.
Cheers,
greg
------------------------------------------------------------------------
-
Greg Johnson
Research Fellow at University of Manchester
Scientific Collaborator at ESRF - European Synchrotron
greg.johnson at esrf.fr
greg.johnson at ieee.org
+33 (0)4 76 88 28 37
On 27 Jun 2007, at 17:35, Oberhuber, Martin wrote:
Hello,
did anybody find a solution for the issue on
Windows, where after
port.close() the port cannot be opened
immediately but throws
a PortInUseException?
There were Reports that it took 30 seconds
before the port got
actually free again, did anybody dig any deeper
and find the
real issue?
This is about rxtx-2.1-7r2 on Windows XP SP2.
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: rxtx-bounces at qbang.org
[mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson
Sent: Wednesday, March 28, 2007 10:43 PM
To: rxtx at qbang.org
Cc: ruskin at pwlinda.mt.umist.ac.uk
Subject: [Rxtx] Cannot close and reopen
serial port
Dear all,
It appears I cannot close a port
properly:
SerialPort serialport =
portid.open("myprog",100);
// do some stuff, all works fine
serialport.close(); // all seems fine
but...
SerialPort sp2 =
portid.open("myprog",100);
throws PortInUseException.
And when I dig into the rxtx code, I
find in CommPort.java, in close():
CommPortIdentifier cp =
CommPortIdentifier.getPortIdentifier(this);
(line 64 or there abouts)
but this throws a NoSuchPortException
which is caught but ignored (line 74ish).
Can anyone suggest how this could
happen: a port that was valid, opened, and used, throws a NSPE when it
comes to closing it? I'm pulling my (remaining) hair out over this one!
Cheers,
greg
PS And thanks for RXTX - it's great to
have!
PPS (21.-7. winxp/osx both, java 1.5)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071024/ea1ddbfa/attachment-0002.html
From Martin.Oberhuber at windriver.com Wed Oct 24 04:09:16 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:09:16 +0200
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C716@ism-mail03.corp.ad.wrs.com>
Hi Trent and Will,
All of my changes are actually in CommPortIdentifier.java only.
The most recent version is attached to
http://bugzilla.qbang.org/show_bug.cgi?id=48
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Trent Jarvi
> Sent: Wednesday, October 24, 2007 1:12 AM
> To: Will Tatam
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] Release date for 2.2
>
> On Tue, 23 Oct 2007, Will Tatam wrote:
>
> > Before everything went tits up with the server there was talk about
> > preparing for a 2.2 release. Is there a timescale for this
> and is there
> > a document somewhere as to what changes this will contain ?
> >
> >
>
> Hi Will,
>
> So far, I've been doing the best I can just to pull rxtx out
> of a pile of
> inodes.
>
> We can start looking at a new release now. The first thing I
> want to do
> is go back ane encorperate the changes Martin has been
> working on. I'll
> have a few minor changes also. This is a good time to get
> the release
> out.
>
> There isn't a list of changes right now. What we could do is
> have Martin
> post his changes to the list again and start there. Or I can
> dig though
> my email and find them if he does not have them handy.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:17:11 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:17:11 +0200
Subject: [Rxtx] virtual serial port
In-Reply-To: <1183556787.10682.6.camel@alvin>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C72F@ism-mail03.corp.ad.wrs.com>
Hi Joshua,
I think it's undocumented, but if you look at the
code in RXTXCommDriver.java you'll see that there
are several options to manually specify ports
which RXTX does not detect automatically.
One of them is this:
System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/myPort");
it also takes a list of ports, separated by
path.separator
Note that when you manually specify the ports, it
will not even try to scan ports itself any more.
So scanned ports need to be added to the System
Property.
Hope this helps,
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Joshua Chambers
> Sent: Wednesday, July 04, 2007 3:46 PM
> To: rxtx at qbang.org
> Subject: [Rxtx] virtual serial port
>
> Hello!
>
> Okay, I am trying to write a cross-platform application that
> talks to a
> custom little micro-controller box. This box uses a virtual serial
> port, which happens to have nice support under linux. When
> you plug it
> in, it creates a serial port at /dev/ttyACM0 which I can
> connect to and
> talk to with a regular serial port terminal.
>
> I've also tried this in windows, and with the proper .inf file it uses
> usbser.sys and works fine, I can talk with it. I've had different
> unsuccessful behavior from this library on each platform so far.
>
> Under linux, it seems to be unable to see the port. when I try to do
> CommPortIdentifier.getPortIdentifier("/dev/ttyACM0") I get a
> NoSuchPortException and when I enumerate the ports, I get only
> one, /dev/ttyS0.
>
> Is this any reason I shouldn't be able to point this thing to my
> functioning virtual serial port?
>
> In windows, the port IS listed in the enumeration, but when I try to
> open it, I get a PortInUseException, however when I query to find out
> who the owner is, I get null.
>
> Any help is so greatly appreciated! Thank you!
> Joshua
>
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From netbeans at gatworks.com Wed Oct 24 04:34:22 2007
From: netbeans at gatworks.com (U. George)
Date: Wed, 24 Oct 2007 06:34:22 -0400
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
Message-ID: <471F1FAE.1010407@gatworks.com>
> Re-sending due to mailing list issues
>
> Hi all,
>
> I have uploaded an exact description of the issue, and
>
I think issues will again appear when you realize that serial (usb)
devices can disappear and reappear from the initial scan ( even with
different device names ) .
At startup, there was only a ttyUSB0. But later ttyUSB0 disappears, and
ttyUSB1 appears. This happens on linux when one un-plugs the USB device
while its in the open() state, and reinserts the usb device back. The
kernel now gives hard failures to the ioctls BUT wont release resources
until close() for ttyUSB0, Since you plugged the USB device back in, the
kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
ttyUSB0 is closed, that device (ttyUSB0) will also disappear from /dev (
as it is now officially called ttyUSB1 ) .
From Martin.Oberhuber at windriver.com Wed Oct 24 08:04:24 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 16:04:24 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <471F1FAE.1010407@gatworks.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C8C4@ism-mail03.corp.ad.wrs.com>
Hello George,
note that we are talking about
CommPortIdentifier.getPortIdentifier(String portName)
where User asks for a specific portName.
If we already have an identifier for that name, just use it.
If device has been unplugged, error will happen when user
tries to use that identifier (wherease before my patch,
getPortIdentifier would return null).
When user asks for a portName that we have not seen before,
it will still rescan with my patch.
My patch did not change behavior of getPortIdentifiers().
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of U. George
> Sent: Wednesday, October 24, 2007 12:34 PM
> To: rxtx at qbang.org
> Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
>
> > Re-sending due to mailing list issues
> >
> > Hi all,
> >
> > I have uploaded an exact description of the issue, and
> >
> I think issues will again appear when you realize that serial (usb)
> devices can disappear and reappear from the initial scan ( even with
> different device names ) .
> At startup, there was only a ttyUSB0. But later ttyUSB0
> disappears, and
> ttyUSB1 appears. This happens on linux when one un-plugs the
> USB device
> while its in the open() state, and reinserts the usb device back. The
> kernel now gives hard failures to the ioctls BUT wont release
> resources
> until close() for ttyUSB0, Since you plugged the USB device
> back in, the
> kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
>
> Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
> ttyUSB0 is closed, that device (ttyUSB0) will also disappear
> from /dev (
> as it is now officially called ttyUSB1 ) .
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From tjarvi at qbang.org Wed Oct 24 15:36:21 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Wed, 24 Oct 2007 15:36:21 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <471FA070.5000400@mobilebox.pl>
References: <471FA070.5000400@mobilebox.pl>
Message-ID:
On Wed, 24 Oct 2007, Leszek Gawron wrote:
> Hello,
> as the user list seems inactive you are my last hope to resolve the problem.
> I've had some serious issues with javax comm API so I finally decided to
> switch to RXTX. I keep getting these:
>
>> ERROR 2007-10-24 10:20.10:375 [MessagePoller] smsPoller: error occurred
>> while iterating messages, restarting after delay
>> java.lang.RuntimeException: unable to execute command
>> at com.mobilebox.modem.Modem.execute(Modem.java:330)
>> at com.mobilebox.modem.at.sms.ListMessages.run(ListMessages.java:40)
>> at com.mobilebox.modem.Modem.execute(Modem.java:328)
>> at
>> com.mobilebox.mail2sms.service.impl.SmsService.iterateMessages(SmsService.java:62)
>> at
>> com.mobilebox.mail2sms.service.MessagePoller.run(MessagePoller.java:97)
>> at java.lang.Thread.run(Unknown Source)
>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
>> at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
>> at sun.nio.cs.StreamDecoder.read(Unknown Source)
>> at java.io.InputStreamReader.read(Unknown Source)
>> at java.io.BufferedReader.fill(Unknown Source)
>> at java.io.BufferedReader.read(Unknown Source)
>> at com.mobilebox.modem.Modem.readStopAware(Modem.java:173)
>> at com.mobilebox.modem.Modem.readSingleLine(Modem.java:155)
>> at com.mobilebox.modem.Modem.readSingleLine(Modem.java:150)
>> at com.mobilebox.modem.Modem.readBasicResponse(Modem.java:135)
>> at
>> com.mobilebox.modem.at.SimpleAtCommand.run(SimpleAtCommand.java:41)
>> at com.mobilebox.modem.Modem.execute(Modem.java:328)
>> ... 5 more
>
>
> The code is dead simple:
>
>> private synchronized String readStopAware( String stopFor ) throws
>> IOException {
>> StringBuffer buffer = new StringBuffer();
>> int ch = -1;
>>
>> int bufferPos = 0;
>> boolean stopForMatches = true;
>>
>> while ( true ) {
>> ch = in.read();
>>
>> if ( ch == -1 )
>> break;
>>
>> if ( ch == '\r' )
>> continue;
>>
>> if ( ch == '\n' )
>> break;
>>
>> buffer.append( (char) ch );
>>
>> // if single character differs - no need to check
>> further
>> if ( stopFor != null && stopForMatches ) {
>> if ( stopFor.charAt( bufferPos ) ==
>> buffer.charAt( bufferPos ) ) {
>> bufferPos++;
>> if ( bufferPos == stopFor.length() )
>> break;
>> } else
>> stopForMatches = false;
>> }
>> }
>> if ( ch == -1 && buffer.length() == 0 )
>> return null;
>>
>> return buffer.toString();
>> }
>
> The connection is established like this:
>> public synchronized void connect() {
>> logger.info( "opening comm port: " + getPort() );
>> CommPortIdentifier portId = getPortIdentifier();
>>
>> try {
>> serialPort = (SerialPort) portId.open(
>> getPortOwnerName(),
>> PORT_TIMEOUT
>> );
>> } catch ( PortInUseException e ) {
>> throw new RuntimeException( "port " + getPort() + "
>> currently owned by " + e.currentOwner
>> + ", unable to
>> proceed" );
>> }
>>
>> try {
>> serialPort.setSerialPortParams( getSpeed(),
>> SerialPort.DATABITS_8,
>> SerialPort.STOPBITS_1,
>> SerialPort.PARITY_NONE
>> );
>> } catch ( UnsupportedCommOperationException e ) {
>> throw new RuntimeException( "unable to set port
>> parameters", e );
>> }
>>
>> serialPort.disableReceiveTimeout();
>>
>> try {
>> this.in = new BufferedReader( new InputStreamReader(
>> serialPort.getInputStream() ) );
>> this.out = new BufferedWriter( new
>> OutputStreamWriter( serialPort.getOutputStream() ) );
>> } catch ( IOException e ) {
>> disconnect();
>> throw new RuntimeException( "unable to connect to
>> modem", e );
>> }
>>
>> logger.info( "done." );
>> }
>
>
> This happens while connecting to a GSM modem over serial line. Even better:
> this happens even if there is no device connected to RS232 port.
>
> I've tried:
> JDK 1.6, JDK 1.5
>
> Windows XP SP1, Windows Server 2003
>
> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
>
> None of the combinations of these seem to work properly.
>
Hi Leszek
The rxtx mail-list just started up again this week.
I suspect that you need to alter the Timeout and Threshold to match your
expected behavior. I thought timeout and threshold behaved but they may
not be handling some error condition properly.
Perhaps Try the following?
SerialPort.enableReceiveTimeout(0);
SerialPort.enableReceiveThreshold(1);
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Wed Oct 24 16:50:21 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Wed, 24 Oct 2007 16:50:21 -0600 (MDT)
Subject: [Rxtx] [Action Required?] The list is going live again.
In-Reply-To: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
References: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
Message-ID:
On Sun, 21 Oct 2007, tjarvi at qbang.org wrote:
>
> The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
>
> http://mailman.qbang.org/mailman/options/rxtx
>
> If you enter your email address and hit the remind button, a password will be emailed to you.
>
> I'll try to wait a while before opening the gates. We have several emails pending.
>
For those of you that had problems changing your preferences on the
server, I've updated the server configuration and expect you should have
no problems changing them now. It was a security module setting.
Please let me know if you have any problems. It did work for me.
--
Trent Jarvi
tjarvi at qbang.org
From Martin.Oberhuber at windriver.com Thu Oct 25 04:30:10 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Thu, 25 Oct 2007 12:30:10 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C8C4@ism-mail03.corp.ad.wrs.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480358CFC2@ism-mail03.corp.ad.wrs.com>
PS
attached is a simplified version of the patch which only
addresses this particular issue.
Here it's more clear to see what I actually changed.
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Oberhuber, Martin
> Sent: Wednesday, October 24, 2007 4:04 PM
> To: U. George; rxtx at qbang.org
> Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
>
> Hello George,
>
> note that we are talking about
> CommPortIdentifier.getPortIdentifier(String portName)
> where User asks for a specific portName.
>
> If we already have an identifier for that name, just use it.
> If device has been unplugged, error will happen when user
> tries to use that identifier (wherease before my patch,
> getPortIdentifier would return null).
>
> When user asks for a portName that we have not seen before,
> it will still rescan with my patch.
>
> My patch did not change behavior of getPortIdentifiers().
>
> Cheers,
> --
> Martin Oberhuber
> Wind River Systems, Inc.
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
>
> > -----Original Message-----
> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> > On Behalf Of U. George
> > Sent: Wednesday, October 24, 2007 12:34 PM
> > To: rxtx at qbang.org
> > Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
> >
> > > Re-sending due to mailing list issues
> > >
> > > Hi all,
> > >
> > > I have uploaded an exact description of the issue, and
> > >
> > I think issues will again appear when you realize that serial (usb)
> > devices can disappear and reappear from the initial scan (
> even with
> > different device names ) .
> > At startup, there was only a ttyUSB0. But later ttyUSB0
> > disappears, and
> > ttyUSB1 appears. This happens on linux when one un-plugs the
> > USB device
> > while its in the open() state, and reinserts the usb device
> back. The
> > kernel now gives hard failures to the ioctls BUT wont release
> > resources
> > until close() for ttyUSB0, Since you plugged the USB device
> > back in, the
> > kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
> >
> > Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
> > ttyUSB0 is closed, that device (ttyUSB0) will also disappear
> > from /dev (
> > as it is now officially called ttyUSB1 ) .
> > _______________________________________________
> > Rxtx mailing list
> > Rxtx at qbang.org
> > http://mailman.qbang.org/mailman/listinfo/rxtx
> >
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rxtx_48_noSuchPort.diff.txt
Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071025/bb61b7ab/attachment.txt
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sun Oct 21 11:38:45 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sun, 21 Oct 2007 11:38:45 -0600
Subject: [Rxtx] [Action Required?] The list is going live again.
Message-ID: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
http://mailman.qbang.org/mailman/options/rxtx
If you enter your email address and hit the remind button, a password will be emailed to you.
I'll try to wait a while before opening the gates. We have several emails pending.
--
Trent Jarvi
tjarvi at qbang.org
From lists2006.wayne at gmail.com Mon Oct 22 04:27:35 2007
From: lists2006.wayne at gmail.com (Wayne Gemmell)
Date: Mon, 22 Oct 2007 12:27:35 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
Message-ID: <200710221227.36046.wayne@flashmedia.co.za>
Hi All
I have a program the monitors USSD sessions using a wavecom modem. About 2% of
my transactions come back with funny characters in the first 10 or so
characters (I'm not monitoring it they are happening later.). This is
illustrated in the logging output below. I've added the receiving code below.
Has anyone seen similar results?
2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
(time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
private String readInput() {
int numBytes,count = 1;
StringBuffer sb = new StringBuffer();
byte [] readBuffer = new byte[50];
waitForInput=true;
while(waitForInput)
try {
Thread.sleep(count * 100);
count++;
if(count == 50) {
logger.error("Time out waiting for response");
return null;
}
while (inputStream.available() > 0) {
numBytes = inputStream.read(readBuffer);
if(numBytes<=1)
continue;
sb.append(new String(readBuffer)).substring(0,numBytes);
for(int i=0;i
public void serialEvent(SerialPortEvent event) {
// TODO Auto-generated method stub
switch (event.getEventType()) {
case SerialPortEvent.DATA_AVAILABLE:
waitForInput = false;
}
}
--
Regards
Wayne
From netbeans at gatworks.com Mon Oct 22 13:50:37 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 15:50:37 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <471CFF0D.4030601@gatworks.com>
Is it a USB modem? Or a real serial modem?
When serialUSB ( kernel module ) starts up, i usually get some funny
characters from the GPS receiver. After that it appears ok.
maybe a bit of rxtx debugging is in order.
BTW: those funny chars is '\0' or null, or a control-@ ( as i vaguely
remember )
Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2% of
> my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code below.
> Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
> tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new String(readBuffer)).substring(0,numBytes);
> for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From netbeans at gatworks.com Mon Oct 22 16:03:54 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 18:03:54 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <471CFF0D.4030601@gatworks.com>
References: <200710221227.36046.wayne@flashmedia.co.za>
<471CFF0D.4030601@gatworks.com>
Message-ID: <471D1E4A.4080601@gatworks.com>
Also, are u shure this works?
does not a new CharAt(i) get shifted down from the length of the string?
i like to do this in reverse ( for ( int i = sb.length-1; i > 0 ; i-- )
{ if(sb.charAt(i)==0) sb.deleteCharAt(i); }
just a thought :}
>> for(int i=0;i> if(sb.charAt(i)==0)
>> sb.deleteCharAt(i);
>> }
>>
From Martin.Oberhuber at windriver.com Tue Oct 23 10:57:46 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Tue, 23 Oct 2007 18:57:46 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Hello,
I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
Terminal in Eclipse.
On initial startup of my application, /dev/term/b is always
detected. But when I call getPortIdentifier(), the nested
getPortIdentifiers() does not detect it any more. It seems
that testRead() fails when RXTX is being re-initialized.
It fails not always, but approximately 8 times out of 10 tries.
It looks like the code is broken due to the fix in
CommPortIdentifier which was added for
http://bugzilla.qbang.org/show_bug.cgi?id=48
Has anybody seen this before, or can give any advice?
Unfortunately, I currently don't have a compile
environment available on Solaris such that I could
try a debug version to see what's causing the port
detection to fail in native code. Does anybody have
a Solaris debug version available?
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From will.tatam at red61.com Tue Oct 23 12:26:29 2007
From: will.tatam at red61.com (Will Tatam)
Date: Tue, 23 Oct 2007 19:26:29 +0100
Subject: [Rxtx] Release date for 2.2
Message-ID: <471E3CD5.4030605@red61.com>
Before everything went tits up with the server there was talk about
preparing for a 2.2 release. Is there a timescale for this and is there
a document somewhere as to what changes this will contain ?
--
Will Tatam
Systems Architect
Red Sixty One LTD
0845 867 2203 ext 103
From tjarvi at qbang.org Tue Oct 23 17:07:37 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:07:37 -0600 (MDT)
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Message-ID:
On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
> Hello,
>
> I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> Terminal in Eclipse.
>
> On initial startup of my application, /dev/term/b is always
> detected. But when I call getPortIdentifier(), the nested
> getPortIdentifiers() does not detect it any more. It seems
> that testRead() fails when RXTX is being re-initialized.
>
> It fails not always, but approximately 8 times out of 10 tries.
>
> It looks like the code is broken due to the fix in
> CommPortIdentifier which was added for
> http://bugzilla.qbang.org/show_bug.cgi?id=48
>
> Has anybody seen this before, or can give any advice?
>
> Unfortunately, I currently don't have a compile
> environment available on Solaris such that I could
> try a debug version to see what's causing the port
> detection to fail in native code. Does anybody have
> a Solaris debug version available?
>
Hi Martin,
I built an Ad Hoc version for sol10 with -g for you and put it in the
ToyBox.
http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/sparc-sun-solaris2.10-debug
r2 was a second build so its all just 2.1-7.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:12:09 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:12:09 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E3CD5.4030605@red61.com>
References: <471E3CD5.4030605@red61.com>
Message-ID:
On Tue, 23 Oct 2007, Will Tatam wrote:
> Before everything went tits up with the server there was talk about
> preparing for a 2.2 release. Is there a timescale for this and is there
> a document somewhere as to what changes this will contain ?
>
>
Hi Will,
So far, I've been doing the best I can just to pull rxtx out of a pile of
inodes.
We can start looking at a new release now. The first thing I want to do
is go back ane encorperate the changes Martin has been working on. I'll
have a few minor changes also. This is a good time to get the release
out.
There isn't a list of changes right now. What we could do is have Martin
post his changes to the list again and start there. Or I can dig though
my email and find them if he does not have them handy.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:57:40 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:57:40 -0600 (MDT)
Subject: [Rxtx] Wiki and Spambots
In-Reply-To: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
References: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
Message-ID:
On Tue, 17 Jul 2007, Andre-John Mas wrote:
> Hi,
>
> Looks like spambots are wrecking havoc on the Wiki. Had to correct:
>
> http://rxtx.qbang.org/wiki/index.php/Examples
> http://rxtx.qbang.org/wiki/index.php/
> Two_way_communcation_with_the_serial_port
>
> Any chance we can add a captcha for account creation?
>
Late but Done. We actually had spambots trying to write over each other.
I also locked the front page but left everything else editable by anyone
willing to create an account. The pages should be clean again.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 18:29:55 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:29:55 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
Message-ID: <471E9203.9010105@gatworks.com>
> There isn't a list of changes right now. What we could do is have Martin
> post his changes to the list again and start there. Or I can dig though
> my email and find them if he does not have them handy.
here is a diff of the changes I made to my local rxtx ,
gimme a shout when u get ready to review.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071023/66665b8a/attachment-0003.pl
From netbeans at gatworks.com Tue Oct 23 18:37:24 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:37:24 -0400
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID: <471E93C4.4020501@gatworks.com>
a
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so it
> cant take 115200!!!!!!!!!!!!!!
can u tell me why? int is approx +/- 2gig
From tod at todbot.com Tue Oct 23 18:41:29 2007
From: tod at todbot.com (Tod E. Kurt)
Date: Tue, 23 Oct 2007 17:41:29 -0700
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID:
In Java, ints go from -2147483648 to 2147483647, inclusive.
http://java.sun.com/docs/books/jls/third_edition/html/
typesValues.html#4.2.1
On Jul 31, 2007, at 8:27 a, arnab bhaumik wrote:
> hi all,
>
> i am wondering how to get this speed (115.2kbps) with rxtx????
>
>
>
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so
> it cant take 115200!!!!!!!!!!!!!!
>
> please help me
> arnab
>
> --
> Arnab Bhaumik / VU2BPW
>
> Proprietor and Design Engineer,
>
> AB Telecomm.
> Rajchandrapur, PO- Ghoshpara(Bally).
> Howrah, West Bengal.
> Pin - 711227
> Ph- (033) 26716307
> Mob- 9433927150
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Tue Oct 23 19:44:08 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 19:44:08 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E9203.9010105@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>> There isn't a list of changes right now. What we could do is have Martin
>> post his changes to the list again and start there. Or I can dig though my
>> email and find them if he does not have them handy.
>
> here is a diff of the changes I made to my local rxtx ,
> gimme a shout when u get ready to review.
>
Great stuff Uncle George,
I just looked through the diff for flag and discuss items. I'll look
again tomorrow night a little closer. Have you tried the code that
replaces ...
-#if defined(TIOCSERGETLSR)
int change;
if( !ioctl( fd, TIOCSERGETLSR, &change ) ) {
return(1);
}
-#endif /* TIOCSERGETLSR */
... with ...
+ return check_line_status_register_with_GETLSR( eis );
+
+ return check_line_status_register_without_GETLSR( eis );
... on a Solaris/*BSD machine? There is obviously the problem with
multiport serial cards that do not support the ioctl but on systems other
than Linux, there isn't a define for the TIOCSERGETLSR.
It could be that I'm just missing a detail by looking only at the diff.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 20:11:45 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 22:11:45 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID: <471EA9E1.7070707@gatworks.com>
> ... on a Solaris/*BSD machine? There is obviously the problem with
> multiport serial cards that do not support the ioctl but on systems
> other than Linux, there isn't a define for the TIOCSERGETLSR.
>
> It could be that I'm just missing a detail by looking only at the diff.
The issue was on (linux) systems that have TIOCSERGETLSR defined for an
ioctl, but the (USB) device driver itself may or may not have any code
for processing the TIOCSERGETLSR. So u have to support both as if
TIOCSERGETLSR does and does not exist - at run time.
So what happens on a sys that fully implements TIOCSERGETLSR? What
happens on a system that does not implement (define) TIOCSERGETLSR.
I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
appropriate, but I wont be able to test the issue with unplugging the
USB device, and rxtx spinning as a result.
From tjarvi at qbang.org Tue Oct 23 20:39:31 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 20:39:31 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471EA9E1.7070707@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
<471EA9E1.7070707@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>
>> ... on a Solaris/*BSD machine? There is obviously the problem with
>> multiport serial cards that do not support the ioctl but on systems other
>> than Linux, there isn't a define for the TIOCSERGETLSR.
>>
>> It could be that I'm just missing a detail by looking only at the diff.
>
> The issue was on (linux) systems that have TIOCSERGETLSR defined for an
> ioctl, but the (USB) device driver itself may or may not have any code for
> processing the TIOCSERGETLSR. So u have to support both as if TIOCSERGETLSR
> does and does not exist - at run time.
>
> So what happens on a sys that fully implements TIOCSERGETLSR? What happens on
> a system that does not implement (define) TIOCSERGETLSR.
>
> I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
> appropriate, but I wont be able to test the issue with unplugging the USB
> device, and rxtx spinning as a result.
>
Hmm OK.
I had not thought about USB/bluetooth dongles.
We should be able to do what you require and handle the systems that don't
implement the call. It will just take a bit more work. I'll look into it
more tomorrow.
Thanks George
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 22:21:12 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 22:21:12 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471EA9E1.7070707@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
<471EA9E1.7070707@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>
>> ... on a Solaris/*BSD machine? There is obviously the problem with
>> multiport serial cards that do not support the ioctl but on systems other
>> than Linux, there isn't a define for the TIOCSERGETLSR.
>>
>> It could be that I'm just missing a detail by looking only at the diff.
>
> The issue was on (linux) systems that have TIOCSERGETLSR defined for an
> ioctl, but the (USB) device driver itself may or may not have any code for
> processing the TIOCSERGETLSR. So u have to support both as if TIOCSERGETLSR
> does and does not exist - at run time.
>
> So what happens on a sys that fully implements TIOCSERGETLSR? What happens on
> a system that does not implement (define) TIOCSERGETLSR.
>
> I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
> appropriate, but I wont be able to test the issue with unplugging the USB
> device, and rxtx spinning as a result.
>
As a quick followup, this is easy enough to try on Linux. Just undef
TIOCSERGETLSR after the includes and build. When it blows up, thats what
will happen on the traditional systems.
--
Trent Jarvi
tjarvi at qbang.org
From wayne at flashmedia.co.za Wed Oct 24 01:04:06 2007
From: wayne at flashmedia.co.za (Wayne Gemmell)
Date: Wed, 24 Oct 2007 09:04:06 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <200710240904.06544.wayne@flashmedia.co.za>
Hi all
Sorry for the re-post but did this post get through on Monday? I see theres
plenty email today.
Thanks
Wayne
On Monday 22 October 2007 12:27:35 Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2%
> of my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code
> below. Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,
>s tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new
> String(readBuffer)).substring(0,numBytes); for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From Martin.Oberhuber at windriver.com Wed Oct 24 03:17:04 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:17:04 +0200
Subject: [Rxtx] RXTX cannot connect a specific board without HW flow control
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C671@ism-mail03.corp.ad.wrs.com>
Re-sending due to mailing list issue:
Hi RXTX community,
we have an odd problem here: there is one specific board that
RXTX connot connect to at 9600 baud / 8n1 / no flow-control:
I see absolutely no output from the remote.
When I enable flow control, it connects fine.
HyperTerminal connets fine both with and without flow control.
Other boards of the same making (i.e. same electronics, different
physical hardware) connect ok both with and without flow control.
Has anybody seen such behavior before?
Any ideas what could be causing this?
It seems that RXTX is less fault tolerant than HyperTerminal
when it comes to flow control...
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From Martin.Oberhuber at windriver.com Wed Oct 24 03:18:21 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:18:21 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
Re-sending due to mailing list issues
Hi all,
I have uploaded an exact description of the issue, and
a fix which I think is good, to RXTX Bugzilla:
http://bugzilla.qbang.org/show_bug.cgi?id=83
Please consider including this into the code base.
The fix on Bugzilla is slightly updated compared to
what I sent before, and works around another potential
deadlock.
We're using this fixed version for our commercial product,
and it's included in the Eclipse bundles at
http://rxtx.qbang.org/eclipse/
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Oberhuber, Martin
> Sent: Thursday, September 20, 2007 3:11 PM
> To: Trent Jarvi; taj at www.linux.org.uk; tjarvi at mathworks.com;
> rxtx at qbang.org
> Cc: Stieber, Uwe; Gutschelhofer, Martin; Scharf, Michael
> Subject: Deadlock in RXTX 2.1-7
>
> Hello,
>
> We have run into a deadlock with RXTX, see attached thread dump.
> this is critical for our commercial application picking up RXTX,
> and it might be critical for others as well.
>
> The problem occurs when multiple threads (parts of the application)
> try to open a CommPort at the same time - especially in the following
> situation:
> * Client 1 opens COM1
> * Client 2 tries to open with a wait time of e.g. 5 sec
> - PortOwnership notification is sent
> - Client 2 waits 5 sec to own port
> * If Client 3 tries an open() during these 5 sec it will deadlock.
>
> Here is the problematic Code, from CommPortIdentifier:
>
> public synchronized CommPort open(String TheOwner, int i)
> throws gnu.io.PortInUseException
> {
> if(debug)
> System.out.println("CommPortIdentifier:open("+TheOwner
> + ", " +i+")");
> if (Available == false)
> {
> synchronized (Sync)
> {
>
>
> fireOwnershipEvent(CommPortOwnershipListener.PORT_OWNERSHIP_RE
> QUESTED);
> try
> {
> wait(i);
> }
> catch ( InterruptedException e )
> {
> Thread.currentThread().interrupt();
> }
> }
> }
>
>
> And here is what happens:
> * Thread 1 does open() and locks "this",
> then it locks "Sync",
> then it releases the lock on "this" because going into wait()
>
> * While Thread 1 is waiting, thread 2 now locks "this",
> but it cannot continue locking "Sync" because it is still
> owned by Thread 2. So it keeps locking "this" forever
>
> * Therefore, Thread 1 cannot return from the wait()
>
> Holding two locks is very problematic here, and I think that holding
> the global "synchronized(Sync)" should be avoided. That lock is for
> protecting the list of CommPorts; but here, we are dealing
> with parties
> interested in one specific CommPort only so the given
> CommPortIdentifier
> we are dealing with should not be affected. Or was the original
> Intent to ensure that nobody can call getPortIdentifiers() while
> Negotiation between the port owners is going on?
>
> In general, the whole concept of re-initializing RXTX in the
> getPortIdentifiers() Method is very problematic, because
> 1.) it creates new instances of CommPortIdentifier; therefore,
> a "notify" against a given CommPortIdentifier may not wake
> up other threads waiting on a different CommPortIdentifier
> object that's been instanciated for the same port. This
> might be the reason for the comment
> /* this tosses null pointer?? */
> In internalClosePort().
> 2.) Anybody is free to call getPortIdentifiers() at any
> time. Couldn't re-initializing RXTX break any data
> transmissions that others are currently having?
>
> I've been trying to come up with a fix, but I don't think I
> know enough about RXTX to understand how to better update the
> List of known ports in getPortIdentifiers() without having
> to re-initialize everything. So, my fix seems to be more of
> a workaround, although it should address the most burning
> issues of deadlock.
>
> Find attached the new version of CommPortIdentifier that
> I have come up with. Please review and let me know what
> You think! I think that a real fix needs to get the list of
> CommPort names out of the RXTXDriver without re-initializing
> Everything, but I'd like to get your comments.
>
> Thanks,
> --
> Martin Oberhuber
> Wind River Systems, Inc.
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
>
>
From Martin.Oberhuber at windriver.com Wed Oct 24 03:35:03 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:35:03 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C6B5@ism-mail03.corp.ad.wrs.com>
Hello Trent,
thanks for your efforts - but it doesn't run on my box.
Looks like you built for SPARC64 but I need SPARC32 ?
java.lang.UnsatisfiedLinkError:
/folk/mober/RSETest/sol-3.3.1/eclipse/plugins/gnu.io.rxtx.solaris.sparc_
2.1.7.3_v20071015/os/solaris/sparc/librxtxSerial.so: ld.so.1: eclipse:
fatal:
/folk/mober/RSETest/sol-3.3.1/eclipse/plugins/gnu.io.rxtx.solaris.sparc_
2.1.7.3_v20071015/os/solaris/sparc/librxtxSerial.so: wrong ELF class:
ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver
And actually, I was not looking for a build with -g but
rather for a build with macros
DEBUG_VERBOSE
ENTER
LEAVE
or whatever else makes sense for logging enabled...
in SerialImp.c, I found the macros mentioned though
you might know better what logging makes sense
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Wednesday, October 24, 2007 1:08 AM
> To: Oberhuber, Martin
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] NoSuchPortException in
> getPortIdentifier() on Solaris
>
> I built an Ad Hoc version for sol10 with -g for you and put it in the
> ToyBox.
>
> http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/spa
> rc-sun-solaris2.10-debug
>
> r2 was a second build so its all just 2.1-7.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:05:45 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:05:45 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C70B@ism-mail03.corp.ad.wrs.com>
Hi Trent,
I found a Java fix which works most of the time:
in getPortIdentifier(), do not re-initialize RXTX
all the time but only when it is necessary.
I uploaded a full description, patch and updated
.java file to
http://bugzilla.qbang.org/show_bug.cgi?id=48
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Wednesday, October 24, 2007 1:08 AM
> To: Oberhuber, Martin
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] NoSuchPortException in
> getPortIdentifier() on Solaris
>
> On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
>
> > Hello,
> >
> > I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> > Terminal in Eclipse.
> >
> > On initial startup of my application, /dev/term/b is always
> > detected. But when I call getPortIdentifier(), the nested
> > getPortIdentifiers() does not detect it any more. It seems
> > that testRead() fails when RXTX is being re-initialized.
> >
> > It fails not always, but approximately 8 times out of 10 tries.
> >
> > It looks like the code is broken due to the fix in
> > CommPortIdentifier which was added for
> > http://bugzilla.qbang.org/show_bug.cgi?id=48
> >
> > Has anybody seen this before, or can give any advice?
> >
> > Unfortunately, I currently don't have a compile
> > environment available on Solaris such that I could
> > try a debug version to see what's causing the port
> > detection to fail in native code. Does anybody have
> > a Solaris debug version available?
> >
>
> Hi Martin,
>
> I built an Ad Hoc version for sol10 with -g for you and put it in the
> ToyBox.
>
> http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/spa
> rc-sun-solaris2.10-debug
>
> r2 was a second build so its all just 2.1-7.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:08:03 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:08:03 +0200
Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port
In-Reply-To: <460801A4097E3D4CA04CC64EE6485848020CB5CC@ism-mail03.corp.ad.wrs.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com>
Hi Greg and others,
I think that the issue is actually fixed by the updates I've submitted
for CommPortIdentifier recently.
With these fixes, it is no longer necessary to get a fresh
CommPortIdentifier.
The problem was, that RXTX had re-initialized its CommPortIdentifier
list
too often, thus losing the context info; that was a problem for other
applications
as well (sharing access to a com port; deadlocks).
All my fixes are included in the patch on
http://bugzilla.qbang.org/show_bug.cgi?id=48
More explanations, and an older interim version of my patches are on
http://bugzilla.qbang.org/show_bug.cgi?id=83
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On
Behalf Of Oberhuber, Martin
Sent: Thursday, June 28, 2007 1:23 PM
To: greg.johnson at esrf.fr
Cc: RXTX Developers and Users; ruskin at pwlinda.mt.umist.ac.uk
Subject: Re: [Rxtx] PortInUseException - Cannot close and reopen
serial port
Hi Greg,
Many many thanks!
Getting a fresh CommPortIdentifier helped indeed.
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: Greg Johnson
[mailto:greg.johnson at manchester.ac.uk]
Sent: Wednesday, June 27, 2007 5:50 PM
To: Oberhuber, Martin
Cc: RXTX Developers and Users;
ruskin at pwlinda.mt.umist.ac.uk
Subject: Re: [Rxtx] PortInUseException - Cannot close
and reopen serial port
Hello Martin,
We found that we had to get a fresh CommPortIdentifier
each time - reusing the previous one, even though the port had been
closed, caused this to barf.
while (true) {
portId=CommPortIdentifier.getPortIdentifier(pName);
Thread.sleep(2000); // or else USB dongles barf
serialport = (SerialPort) portId.open("MyApp",100);
// do something interesting
serialport.close();
}
Previously, we just tried to do
serialport = (SerialPort) portId.open("MyApp,100);
or
SerialPort serialport2 = ...
a second time, but that gave the so-called
PortInUseException.
We're now limping along. Still struggling with
USB-dongles - seems to need a full 2s after insertion to reliably be
able to open the serial port.
This was a problem on OSX and WinXPSP2 both. We
downloaded the "2.1-8" (which reports itself as 2.1-7) from CSV - it
helped on the OSX side as it stopped flooding the console with
irrelevant locking warnings. Other than that, we saw no change in
behaviour.
Cheers,
greg
------------------------------------------------------------------------
-
Greg Johnson
Research Fellow at University of Manchester
Scientific Collaborator at ESRF - European Synchrotron
greg.johnson at esrf.fr
greg.johnson at ieee.org
+33 (0)4 76 88 28 37
On 27 Jun 2007, at 17:35, Oberhuber, Martin wrote:
Hello,
did anybody find a solution for the issue on
Windows, where after
port.close() the port cannot be opened
immediately but throws
a PortInUseException?
There were Reports that it took 30 seconds
before the port got
actually free again, did anybody dig any deeper
and find the
real issue?
This is about rxtx-2.1-7r2 on Windows XP SP2.
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: rxtx-bounces at qbang.org
[mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson
Sent: Wednesday, March 28, 2007 10:43 PM
To: rxtx at qbang.org
Cc: ruskin at pwlinda.mt.umist.ac.uk
Subject: [Rxtx] Cannot close and reopen
serial port
Dear all,
It appears I cannot close a port
properly:
SerialPort serialport =
portid.open("myprog",100);
// do some stuff, all works fine
serialport.close(); // all seems fine
but...
SerialPort sp2 =
portid.open("myprog",100);
throws PortInUseException.
And when I dig into the rxtx code, I
find in CommPort.java, in close():
CommPortIdentifier cp =
CommPortIdentifier.getPortIdentifier(this);
(line 64 or there abouts)
but this throws a NoSuchPortException
which is caught but ignored (line 74ish).
Can anyone suggest how this could
happen: a port that was valid, opened, and used, throws a NSPE when it
comes to closing it? I'm pulling my (remaining) hair out over this one!
Cheers,
greg
PS And thanks for RXTX - it's great to
have!
PPS (21.-7. winxp/osx both, java 1.5)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071024/ea1ddbfa/attachment-0003.html
From Martin.Oberhuber at windriver.com Wed Oct 24 04:09:16 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:09:16 +0200
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C716@ism-mail03.corp.ad.wrs.com>
Hi Trent and Will,
All of my changes are actually in CommPortIdentifier.java only.
The most recent version is attached to
http://bugzilla.qbang.org/show_bug.cgi?id=48
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Trent Jarvi
> Sent: Wednesday, October 24, 2007 1:12 AM
> To: Will Tatam
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] Release date for 2.2
>
> On Tue, 23 Oct 2007, Will Tatam wrote:
>
> > Before everything went tits up with the server there was talk about
> > preparing for a 2.2 release. Is there a timescale for this
> and is there
> > a document somewhere as to what changes this will contain ?
> >
> >
>
> Hi Will,
>
> So far, I've been doing the best I can just to pull rxtx out
> of a pile of
> inodes.
>
> We can start looking at a new release now. The first thing I
> want to do
> is go back ane encorperate the changes Martin has been
> working on. I'll
> have a few minor changes also. This is a good time to get
> the release
> out.
>
> There isn't a list of changes right now. What we could do is
> have Martin
> post his changes to the list again and start there. Or I can
> dig though
> my email and find them if he does not have them handy.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:17:11 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:17:11 +0200
Subject: [Rxtx] virtual serial port
In-Reply-To: <1183556787.10682.6.camel@alvin>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C72F@ism-mail03.corp.ad.wrs.com>
Hi Joshua,
I think it's undocumented, but if you look at the
code in RXTXCommDriver.java you'll see that there
are several options to manually specify ports
which RXTX does not detect automatically.
One of them is this:
System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/myPort");
it also takes a list of ports, separated by
path.separator
Note that when you manually specify the ports, it
will not even try to scan ports itself any more.
So scanned ports need to be added to the System
Property.
Hope this helps,
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Joshua Chambers
> Sent: Wednesday, July 04, 2007 3:46 PM
> To: rxtx at qbang.org
> Subject: [Rxtx] virtual serial port
>
> Hello!
>
> Okay, I am trying to write a cross-platform application that
> talks to a
> custom little micro-controller box. This box uses a virtual serial
> port, which happens to have nice support under linux. When
> you plug it
> in, it creates a serial port at /dev/ttyACM0 which I can
> connect to and
> talk to with a regular serial port terminal.
>
> I've also tried this in windows, and with the proper .inf file it uses
> usbser.sys and works fine, I can talk with it. I've had different
> unsuccessful behavior from this library on each platform so far.
>
> Under linux, it seems to be unable to see the port. when I try to do
> CommPortIdentifier.getPortIdentifier("/dev/ttyACM0") I get a
> NoSuchPortException and when I enumerate the ports, I get only
> one, /dev/ttyS0.
>
> Is this any reason I shouldn't be able to point this thing to my
> functioning virtual serial port?
>
> In windows, the port IS listed in the enumeration, but when I try to
> open it, I get a PortInUseException, however when I query to find out
> who the owner is, I get null.
>
> Any help is so greatly appreciated! Thank you!
> Joshua
>
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From netbeans at gatworks.com Wed Oct 24 04:34:22 2007
From: netbeans at gatworks.com (U. George)
Date: Wed, 24 Oct 2007 06:34:22 -0400
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
Message-ID: <471F1FAE.1010407@gatworks.com>
> Re-sending due to mailing list issues
>
> Hi all,
>
> I have uploaded an exact description of the issue, and
>
I think issues will again appear when you realize that serial (usb)
devices can disappear and reappear from the initial scan ( even with
different device names ) .
At startup, there was only a ttyUSB0. But later ttyUSB0 disappears, and
ttyUSB1 appears. This happens on linux when one un-plugs the USB device
while its in the open() state, and reinserts the usb device back. The
kernel now gives hard failures to the ioctls BUT wont release resources
until close() for ttyUSB0, Since you plugged the USB device back in, the
kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
ttyUSB0 is closed, that device (ttyUSB0) will also disappear from /dev (
as it is now officially called ttyUSB1 ) .
From Martin.Oberhuber at windriver.com Wed Oct 24 08:04:24 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 16:04:24 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <471F1FAE.1010407@gatworks.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C8C4@ism-mail03.corp.ad.wrs.com>
Hello George,
note that we are talking about
CommPortIdentifier.getPortIdentifier(String portName)
where User asks for a specific portName.
If we already have an identifier for that name, just use it.
If device has been unplugged, error will happen when user
tries to use that identifier (wherease before my patch,
getPortIdentifier would return null).
When user asks for a portName that we have not seen before,
it will still rescan with my patch.
My patch did not change behavior of getPortIdentifiers().
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of U. George
> Sent: Wednesday, October 24, 2007 12:34 PM
> To: rxtx at qbang.org
> Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
>
> > Re-sending due to mailing list issues
> >
> > Hi all,
> >
> > I have uploaded an exact description of the issue, and
> >
> I think issues will again appear when you realize that serial (usb)
> devices can disappear and reappear from the initial scan ( even with
> different device names ) .
> At startup, there was only a ttyUSB0. But later ttyUSB0
> disappears, and
> ttyUSB1 appears. This happens on linux when one un-plugs the
> USB device
> while its in the open() state, and reinserts the usb device back. The
> kernel now gives hard failures to the ioctls BUT wont release
> resources
> until close() for ttyUSB0, Since you plugged the USB device
> back in, the
> kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
>
> Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
> ttyUSB0 is closed, that device (ttyUSB0) will also disappear
> from /dev (
> as it is now officially called ttyUSB1 ) .
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From tjarvi at qbang.org Wed Oct 24 15:36:21 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Wed, 24 Oct 2007 15:36:21 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <471FA070.5000400@mobilebox.pl>
References: <471FA070.5000400@mobilebox.pl>
Message-ID:
On Wed, 24 Oct 2007, Leszek Gawron wrote:
> Hello,
> as the user list seems inactive you are my last hope to resolve the problem.
> I've had some serious issues with javax comm API so I finally decided to
> switch to RXTX. I keep getting these:
>
>> ERROR 2007-10-24 10:20.10:375 [MessagePoller] smsPoller: error occurred
>> while iterating messages, restarting after delay
>> java.lang.RuntimeException: unable to execute command
>> at com.mobilebox.modem.Modem.execute(Modem.java:330)
>> at com.mobilebox.modem.at.sms.ListMessages.run(ListMessages.java:40)
>> at com.mobilebox.modem.Modem.execute(Modem.java:328)
>> at
>> com.mobilebox.mail2sms.service.impl.SmsService.iterateMessages(SmsService.java:62)
>> at
>> com.mobilebox.mail2sms.service.MessagePoller.run(MessagePoller.java:97)
>> at java.lang.Thread.run(Unknown Source)
>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
>> at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
>> at sun.nio.cs.StreamDecoder.read(Unknown Source)
>> at java.io.InputStreamReader.read(Unknown Source)
>> at java.io.BufferedReader.fill(Unknown Source)
>> at java.io.BufferedReader.read(Unknown Source)
>> at com.mobilebox.modem.Modem.readStopAware(Modem.java:173)
>> at com.mobilebox.modem.Modem.readSingleLine(Modem.java:155)
>> at com.mobilebox.modem.Modem.readSingleLine(Modem.java:150)
>> at com.mobilebox.modem.Modem.readBasicResponse(Modem.java:135)
>> at
>> com.mobilebox.modem.at.SimpleAtCommand.run(SimpleAtCommand.java:41)
>> at com.mobilebox.modem.Modem.execute(Modem.java:328)
>> ... 5 more
>
>
> The code is dead simple:
>
>> private synchronized String readStopAware( String stopFor ) throws
>> IOException {
>> StringBuffer buffer = new StringBuffer();
>> int ch = -1;
>>
>> int bufferPos = 0;
>> boolean stopForMatches = true;
>>
>> while ( true ) {
>> ch = in.read();
>>
>> if ( ch == -1 )
>> break;
>>
>> if ( ch == '\r' )
>> continue;
>>
>> if ( ch == '\n' )
>> break;
>>
>> buffer.append( (char) ch );
>>
>> // if single character differs - no need to check
>> further
>> if ( stopFor != null && stopForMatches ) {
>> if ( stopFor.charAt( bufferPos ) ==
>> buffer.charAt( bufferPos ) ) {
>> bufferPos++;
>> if ( bufferPos == stopFor.length() )
>> break;
>> } else
>> stopForMatches = false;
>> }
>> }
>> if ( ch == -1 && buffer.length() == 0 )
>> return null;
>>
>> return buffer.toString();
>> }
>
> The connection is established like this:
>> public synchronized void connect() {
>> logger.info( "opening comm port: " + getPort() );
>> CommPortIdentifier portId = getPortIdentifier();
>>
>> try {
>> serialPort = (SerialPort) portId.open(
>> getPortOwnerName(),
>> PORT_TIMEOUT
>> );
>> } catch ( PortInUseException e ) {
>> throw new RuntimeException( "port " + getPort() + "
>> currently owned by " + e.currentOwner
>> + ", unable to
>> proceed" );
>> }
>>
>> try {
>> serialPort.setSerialPortParams( getSpeed(),
>> SerialPort.DATABITS_8,
>> SerialPort.STOPBITS_1,
>> SerialPort.PARITY_NONE
>> );
>> } catch ( UnsupportedCommOperationException e ) {
>> throw new RuntimeException( "unable to set port
>> parameters", e );
>> }
>>
>> serialPort.disableReceiveTimeout();
>>
>> try {
>> this.in = new BufferedReader( new InputStreamReader(
>> serialPort.getInputStream() ) );
>> this.out = new BufferedWriter( new
>> OutputStreamWriter( serialPort.getOutputStream() ) );
>> } catch ( IOException e ) {
>> disconnect();
>> throw new RuntimeException( "unable to connect to
>> modem", e );
>> }
>>
>> logger.info( "done." );
>> }
>
>
> This happens while connecting to a GSM modem over serial line. Even better:
> this happens even if there is no device connected to RS232 port.
>
> I've tried:
> JDK 1.6, JDK 1.5
>
> Windows XP SP1, Windows Server 2003
>
> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
>
> None of the combinations of these seem to work properly.
>
Hi Leszek
The rxtx mail-list just started up again this week.
I suspect that you need to alter the Timeout and Threshold to match your
expected behavior. I thought timeout and threshold behaved but they may
not be handling some error condition properly.
Perhaps Try the following?
SerialPort.enableReceiveTimeout(0);
SerialPort.enableReceiveThreshold(1);
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Wed Oct 24 16:50:21 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Wed, 24 Oct 2007 16:50:21 -0600 (MDT)
Subject: [Rxtx] [Action Required?] The list is going live again.
In-Reply-To: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
References: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
Message-ID:
On Sun, 21 Oct 2007, tjarvi at qbang.org wrote:
>
> The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
>
> http://mailman.qbang.org/mailman/options/rxtx
>
> If you enter your email address and hit the remind button, a password will be emailed to you.
>
> I'll try to wait a while before opening the gates. We have several emails pending.
>
For those of you that had problems changing your preferences on the
server, I've updated the server configuration and expect you should have
no problems changing them now. It was a security module setting.
Please let me know if you have any problems. It did work for me.
--
Trent Jarvi
tjarvi at qbang.org
From Martin.Oberhuber at windriver.com Thu Oct 25 04:30:10 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Thu, 25 Oct 2007 12:30:10 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C8C4@ism-mail03.corp.ad.wrs.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480358CFC2@ism-mail03.corp.ad.wrs.com>
PS
attached is a simplified version of the patch which only
addresses this particular issue.
Here it's more clear to see what I actually changed.
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Oberhuber, Martin
> Sent: Wednesday, October 24, 2007 4:04 PM
> To: U. George; rxtx at qbang.org
> Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
>
> Hello George,
>
> note that we are talking about
> CommPortIdentifier.getPortIdentifier(String portName)
> where User asks for a specific portName.
>
> If we already have an identifier for that name, just use it.
> If device has been unplugged, error will happen when user
> tries to use that identifier (wherease before my patch,
> getPortIdentifier would return null).
>
> When user asks for a portName that we have not seen before,
> it will still rescan with my patch.
>
> My patch did not change behavior of getPortIdentifiers().
>
> Cheers,
> --
> Martin Oberhuber
> Wind River Systems, Inc.
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
>
> > -----Original Message-----
> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> > On Behalf Of U. George
> > Sent: Wednesday, October 24, 2007 12:34 PM
> > To: rxtx at qbang.org
> > Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
> >
> > > Re-sending due to mailing list issues
> > >
> > > Hi all,
> > >
> > > I have uploaded an exact description of the issue, and
> > >
> > I think issues will again appear when you realize that serial (usb)
> > devices can disappear and reappear from the initial scan (
> even with
> > different device names ) .
> > At startup, there was only a ttyUSB0. But later ttyUSB0
> > disappears, and
> > ttyUSB1 appears. This happens on linux when one un-plugs the
> > USB device
> > while its in the open() state, and reinserts the usb device
> back. The
> > kernel now gives hard failures to the ioctls BUT wont release
> > resources
> > until close() for ttyUSB0, Since you plugged the USB device
> > back in, the
> > kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
> >
> > Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
> > ttyUSB0 is closed, that device (ttyUSB0) will also disappear
> > from /dev (
> > as it is now officially called ttyUSB1 ) .
> > _______________________________________________
> > Rxtx mailing list
> > Rxtx at qbang.org
> > http://mailman.qbang.org/mailman/listinfo/rxtx
> >
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rxtx_48_noSuchPort.diff.txt
Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071025/bb61b7ab/attachment-0001.txt
From sebastien.jean at inrialpes.fr Thu Oct 25 12:51:10 2007
From: sebastien.jean at inrialpes.fr (=?ISO-8859-1?Q?S=E9bastien_Jean?=)
Date: Thu, 25 Oct 2007 20:51:10 +0200
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID: <4CF602F8-2376-464E-8E9A-C7205E36E2D4@inrialpes.fr>
hi arnab,
As Java "int" type is related to a 32 bits signed value, you can
easily set he baudrate to 115200 if you want.
You might have made confusion with the "short" Java type, that is 16
bits long.
S?bastien.
Le 31 juil. 07 ? 17:27, arnab bhaumik a ?crit :
> hi all,
>
> i am wondering how to get this speed (115.2kbps) with rxtx????
>
>
>
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so
> it cant take 115200!!!!!!!!!!!!!!
>
> please help me
> arnab
>
> --
> Arnab Bhaumik / VU2BPW
>
> Proprietor and Design Engineer,
>
> AB Telecomm.
> Rajchandrapur, PO- Ghoshpara(Bally).
> Howrah, West Bengal.
> Pin - 711227
> Ph- (033) 26716307
> Mob- 9433927150
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
From netbeans at gatworks.com Thu Oct 25 15:04:27 2007
From: netbeans at gatworks.com (U. George)
Date: Thu, 25 Oct 2007 17:04:27 -0400
Subject: [Rxtx] rxtx problem
In-Reply-To:
References: <471FA070.5000400@mobilebox.pl>
Message-ID: <472104DB.9070106@gatworks.com>
What it seems to be saying is that there is an error in how rxtx.read()
is suppose to behave.
sun.nio.cs.StreamDecoder.readBytes() thinks that there should be some
bytes returned, or, i suppose, an I/O exception is/should be thrown when
there are no bytes to be returned.
this also needs to be resolved so that readBytes() can handle timeout
exceptions, presuming that rxtx throws that exception in the case of
your device.
>>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
From netbeans at gatworks.com Thu Oct 25 17:26:33 2007
From: netbeans at gatworks.com (U. George)
Date: Thu, 25 Oct 2007 19:26:33 -0400
Subject: [Rxtx] rxtx problem
In-Reply-To: <472104DB.9070106@gatworks.com>
References: <471FA070.5000400@mobilebox.pl>
<472104DB.9070106@gatworks.com>
Message-ID: <47212629.6080304@gatworks.com>
U. George wrote:
> What it seems to be saying is that there is an error in how rxtx.read()
> is suppose to behave.
> sun.nio.cs.StreamDecoder.readBytes() thinks that there should be some
> bytes returned, or, i suppose, an I/O exception is/should be thrown when
> there are no bytes to be returned.
>
> this also needs to be resolved so that readBytes() can handle timeout
> exceptions, presuming that rxtx throws that exception in the case of
> your device.
>
>>>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>>>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
this is the relevant code segment from openjava sources:
try {
> // Read from the input stream, and then update the buffer
> .................
> int n = in.read(bb.array(), bb.arrayOffset() + pos, rem);
> .................
> if (n == 0)
> throw new IOException("Underlying input stream returned zero bytes");
> ..................
> }
> } finally {
> .............
> }
I suppose I have to ask where did the timeout exception go?
From tjarvi at qbang.org Thu Oct 25 17:36:15 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Thu, 25 Oct 2007 17:36:15 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <47212629.6080304@gatworks.com>
References: <471FA070.5000400@mobilebox.pl>
<472104DB.9070106@gatworks.com> <47212629.6080304@gatworks.com>
Message-ID:
On Thu, 25 Oct 2007, U. George wrote:
> U. George wrote:
>> What it seems to be saying is that there is an error in how rxtx.read() is
>> suppose to behave.
>> sun.nio.cs.StreamDecoder.readBytes() thinks that there should be some bytes
>> returned, or, i suppose, an I/O exception is/should be thrown when there
>> are no bytes to be returned.
>>
>> this also needs to be resolved so that readBytes() can handle timeout
>> exceptions, presuming that rxtx throws that exception in the case of your
>> device.
>>
>>>>> Caused by: java.io.IOException: Underlying input stream returned zero
>>>>> bytes
>>>>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
>
> this is the relevant code segment from openjava sources:
> try {
>> // Read from the input stream, and then update the buffer
>> .................
>> int n = in.read(bb.array(), bb.arrayOffset() + pos, rem);
>> .................
>> if (n == 0)
>> throw new IOException("Underlying input stream returned
>> zero bytes");
>> ..................
>> }
>> } finally {
>> .............
>> }
>
> I suppose I have to ask where did the timeout exception go?
>
Hmm
My first thought was I had made very sure the timeouts and thresholds
worked in rxtx. But disabletimeout was used so I wasnt sure if something
different may happen - does not appear so.
I can easily picture rxtx throwing an exception - even an inappropriate
one. But it would just timeout and return if there was a timeout enabled.
There must be an error condition that isn't handled well.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Thu Oct 25 18:22:24 2007
From: netbeans at gatworks.com (U. George)
Date: Thu, 25 Oct 2007 20:22:24 -0400
Subject: [Rxtx] rxtx problem
In-Reply-To:
References: <471FA070.5000400@mobilebox.pl>
Message-ID: <47213340.8090809@gatworks.com>
>>
>> This happens while connecting to a GSM modem over serial line. Even better:
>> this happens even if there is no device connected to RS232 port.
>>
>> I've tried:
>> JDK 1.6, JDK 1.5
>>
>> Windows XP SP1, Windows Server 2003
>>
>> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
OOps, this is a windoz issue ( i hope ). This leaves me out of any
further analysis - :-}
From tjarvi at qbang.org Thu Oct 25 19:04:29 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Thu, 25 Oct 2007 19:04:29 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <47213340.8090809@gatworks.com>
References: <471FA070.5000400@mobilebox.pl>
<47213340.8090809@gatworks.com>
Message-ID:
On Thu, 25 Oct 2007, U. George wrote:
>>>
>>> This happens while connecting to a GSM modem over serial line. Even better:
>>> this happens even if there is no device connected to RS232 port.
>>>
>>> I've tried:
>>> JDK 1.6, JDK 1.5
>>>
>>> Windows XP SP1, Windows Server 2003
>>>
>>> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
>
> OOps, this is a windoz issue ( i hope ). This leaves me out of any
> further analysis - :-}
Perhaps but RXTX just puts a wrapper around windows and treats it as
POSIX.
Thats probably important to remember when we revisit your patch :)
--
Trent Jarvi
tjarvi at qbang.org
From andy.reid at logicacmg.com Fri Oct 26 00:56:09 2007
From: andy.reid at logicacmg.com (Reid, Andy (Space & Defence))
Date: Fri, 26 Oct 2007 07:56:09 +0100
Subject: [Rxtx] Multiple ports
Message-ID:
Hi,
I have a problem in trying to open, write to and then close multiple
ports.
I have a java class for accessing and controlling my com port, if I
create several instances of the class for different com ports and use
the ports after I have opened and closed them several times I often get
problems trying to access one of them.
If I use javax.comm I don't get these problems so I'm trying to
understand if there's something I'm not doing when closing and then
re-opening a port.
I can post code snippets if that would help but I've resisted posting
the whole class for now.
Cheers
Andy
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071026/5b393f73/attachment.html
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sun Oct 21 11:38:45 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sun, 21 Oct 2007 11:38:45 -0600
Subject: [Rxtx] [Action Required?] The list is going live again.
Message-ID: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
http://mailman.qbang.org/mailman/options/rxtx
If you enter your email address and hit the remind button, a password will be emailed to you.
I'll try to wait a while before opening the gates. We have several emails pending.
--
Trent Jarvi
tjarvi at qbang.org
From lists2006.wayne at gmail.com Mon Oct 22 04:27:35 2007
From: lists2006.wayne at gmail.com (Wayne Gemmell)
Date: Mon, 22 Oct 2007 12:27:35 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
Message-ID: <200710221227.36046.wayne@flashmedia.co.za>
Hi All
I have a program the monitors USSD sessions using a wavecom modem. About 2% of
my transactions come back with funny characters in the first 10 or so
characters (I'm not monitoring it they are happening later.). This is
illustrated in the logging output below. I've added the receiving code below.
Has anyone seen similar results?
2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
(time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
private String readInput() {
int numBytes,count = 1;
StringBuffer sb = new StringBuffer();
byte [] readBuffer = new byte[50];
waitForInput=true;
while(waitForInput)
try {
Thread.sleep(count * 100);
count++;
if(count == 50) {
logger.error("Time out waiting for response");
return null;
}
while (inputStream.available() > 0) {
numBytes = inputStream.read(readBuffer);
if(numBytes<=1)
continue;
sb.append(new String(readBuffer)).substring(0,numBytes);
for(int i=0;i
public void serialEvent(SerialPortEvent event) {
// TODO Auto-generated method stub
switch (event.getEventType()) {
case SerialPortEvent.DATA_AVAILABLE:
waitForInput = false;
}
}
--
Regards
Wayne
From netbeans at gatworks.com Mon Oct 22 13:50:37 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 15:50:37 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <471CFF0D.4030601@gatworks.com>
Is it a USB modem? Or a real serial modem?
When serialUSB ( kernel module ) starts up, i usually get some funny
characters from the GPS receiver. After that it appears ok.
maybe a bit of rxtx debugging is in order.
BTW: those funny chars is '\0' or null, or a control-@ ( as i vaguely
remember )
Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2% of
> my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code below.
> Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
> tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new String(readBuffer)).substring(0,numBytes);
> for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From netbeans at gatworks.com Mon Oct 22 16:03:54 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 18:03:54 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <471CFF0D.4030601@gatworks.com>
References: <200710221227.36046.wayne@flashmedia.co.za>
<471CFF0D.4030601@gatworks.com>
Message-ID: <471D1E4A.4080601@gatworks.com>
Also, are u shure this works?
does not a new CharAt(i) get shifted down from the length of the string?
i like to do this in reverse ( for ( int i = sb.length-1; i > 0 ; i-- )
{ if(sb.charAt(i)==0) sb.deleteCharAt(i); }
just a thought :}
>> for(int i=0;i> if(sb.charAt(i)==0)
>> sb.deleteCharAt(i);
>> }
>>
From Martin.Oberhuber at windriver.com Tue Oct 23 10:57:46 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Tue, 23 Oct 2007 18:57:46 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Hello,
I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
Terminal in Eclipse.
On initial startup of my application, /dev/term/b is always
detected. But when I call getPortIdentifier(), the nested
getPortIdentifiers() does not detect it any more. It seems
that testRead() fails when RXTX is being re-initialized.
It fails not always, but approximately 8 times out of 10 tries.
It looks like the code is broken due to the fix in
CommPortIdentifier which was added for
http://bugzilla.qbang.org/show_bug.cgi?id=48
Has anybody seen this before, or can give any advice?
Unfortunately, I currently don't have a compile
environment available on Solaris such that I could
try a debug version to see what's causing the port
detection to fail in native code. Does anybody have
a Solaris debug version available?
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From will.tatam at red61.com Tue Oct 23 12:26:29 2007
From: will.tatam at red61.com (Will Tatam)
Date: Tue, 23 Oct 2007 19:26:29 +0100
Subject: [Rxtx] Release date for 2.2
Message-ID: <471E3CD5.4030605@red61.com>
Before everything went tits up with the server there was talk about
preparing for a 2.2 release. Is there a timescale for this and is there
a document somewhere as to what changes this will contain ?
--
Will Tatam
Systems Architect
Red Sixty One LTD
0845 867 2203 ext 103
From tjarvi at qbang.org Tue Oct 23 17:07:37 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:07:37 -0600 (MDT)
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Message-ID:
On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
> Hello,
>
> I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> Terminal in Eclipse.
>
> On initial startup of my application, /dev/term/b is always
> detected. But when I call getPortIdentifier(), the nested
> getPortIdentifiers() does not detect it any more. It seems
> that testRead() fails when RXTX is being re-initialized.
>
> It fails not always, but approximately 8 times out of 10 tries.
>
> It looks like the code is broken due to the fix in
> CommPortIdentifier which was added for
> http://bugzilla.qbang.org/show_bug.cgi?id=48
>
> Has anybody seen this before, or can give any advice?
>
> Unfortunately, I currently don't have a compile
> environment available on Solaris such that I could
> try a debug version to see what's causing the port
> detection to fail in native code. Does anybody have
> a Solaris debug version available?
>
Hi Martin,
I built an Ad Hoc version for sol10 with -g for you and put it in the
ToyBox.
http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/sparc-sun-solaris2.10-debug
r2 was a second build so its all just 2.1-7.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:12:09 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:12:09 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E3CD5.4030605@red61.com>
References: <471E3CD5.4030605@red61.com>
Message-ID:
On Tue, 23 Oct 2007, Will Tatam wrote:
> Before everything went tits up with the server there was talk about
> preparing for a 2.2 release. Is there a timescale for this and is there
> a document somewhere as to what changes this will contain ?
>
>
Hi Will,
So far, I've been doing the best I can just to pull rxtx out of a pile of
inodes.
We can start looking at a new release now. The first thing I want to do
is go back ane encorperate the changes Martin has been working on. I'll
have a few minor changes also. This is a good time to get the release
out.
There isn't a list of changes right now. What we could do is have Martin
post his changes to the list again and start there. Or I can dig though
my email and find them if he does not have them handy.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:57:40 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:57:40 -0600 (MDT)
Subject: [Rxtx] Wiki and Spambots
In-Reply-To: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
References: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
Message-ID:
On Tue, 17 Jul 2007, Andre-John Mas wrote:
> Hi,
>
> Looks like spambots are wrecking havoc on the Wiki. Had to correct:
>
> http://rxtx.qbang.org/wiki/index.php/Examples
> http://rxtx.qbang.org/wiki/index.php/
> Two_way_communcation_with_the_serial_port
>
> Any chance we can add a captcha for account creation?
>
Late but Done. We actually had spambots trying to write over each other.
I also locked the front page but left everything else editable by anyone
willing to create an account. The pages should be clean again.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 18:29:55 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:29:55 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
Message-ID: <471E9203.9010105@gatworks.com>
> There isn't a list of changes right now. What we could do is have Martin
> post his changes to the list again and start there. Or I can dig though
> my email and find them if he does not have them handy.
here is a diff of the changes I made to my local rxtx ,
gimme a shout when u get ready to review.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071023/66665b8a/attachment-0004.pl
From netbeans at gatworks.com Tue Oct 23 18:37:24 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:37:24 -0400
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID: <471E93C4.4020501@gatworks.com>
a
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so it
> cant take 115200!!!!!!!!!!!!!!
can u tell me why? int is approx +/- 2gig
From tod at todbot.com Tue Oct 23 18:41:29 2007
From: tod at todbot.com (Tod E. Kurt)
Date: Tue, 23 Oct 2007 17:41:29 -0700
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID:
In Java, ints go from -2147483648 to 2147483647, inclusive.
http://java.sun.com/docs/books/jls/third_edition/html/
typesValues.html#4.2.1
On Jul 31, 2007, at 8:27 a, arnab bhaumik wrote:
> hi all,
>
> i am wondering how to get this speed (115.2kbps) with rxtx????
>
>
>
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so
> it cant take 115200!!!!!!!!!!!!!!
>
> please help me
> arnab
>
> --
> Arnab Bhaumik / VU2BPW
>
> Proprietor and Design Engineer,
>
> AB Telecomm.
> Rajchandrapur, PO- Ghoshpara(Bally).
> Howrah, West Bengal.
> Pin - 711227
> Ph- (033) 26716307
> Mob- 9433927150
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Tue Oct 23 19:44:08 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 19:44:08 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E9203.9010105@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>> There isn't a list of changes right now. What we could do is have Martin
>> post his changes to the list again and start there. Or I can dig though my
>> email and find them if he does not have them handy.
>
> here is a diff of the changes I made to my local rxtx ,
> gimme a shout when u get ready to review.
>
Great stuff Uncle George,
I just looked through the diff for flag and discuss items. I'll look
again tomorrow night a little closer. Have you tried the code that
replaces ...
-#if defined(TIOCSERGETLSR)
int change;
if( !ioctl( fd, TIOCSERGETLSR, &change ) ) {
return(1);
}
-#endif /* TIOCSERGETLSR */
... with ...
+ return check_line_status_register_with_GETLSR( eis );
+
+ return check_line_status_register_without_GETLSR( eis );
... on a Solaris/*BSD machine? There is obviously the problem with
multiport serial cards that do not support the ioctl but on systems other
than Linux, there isn't a define for the TIOCSERGETLSR.
It could be that I'm just missing a detail by looking only at the diff.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 20:11:45 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 22:11:45 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID: <471EA9E1.7070707@gatworks.com>
> ... on a Solaris/*BSD machine? There is obviously the problem with
> multiport serial cards that do not support the ioctl but on systems
> other than Linux, there isn't a define for the TIOCSERGETLSR.
>
> It could be that I'm just missing a detail by looking only at the diff.
The issue was on (linux) systems that have TIOCSERGETLSR defined for an
ioctl, but the (USB) device driver itself may or may not have any code
for processing the TIOCSERGETLSR. So u have to support both as if
TIOCSERGETLSR does and does not exist - at run time.
So what happens on a sys that fully implements TIOCSERGETLSR? What
happens on a system that does not implement (define) TIOCSERGETLSR.
I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
appropriate, but I wont be able to test the issue with unplugging the
USB device, and rxtx spinning as a result.
From tjarvi at qbang.org Tue Oct 23 20:39:31 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 20:39:31 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471EA9E1.7070707@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
<471EA9E1.7070707@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>
>> ... on a Solaris/*BSD machine? There is obviously the problem with
>> multiport serial cards that do not support the ioctl but on systems other
>> than Linux, there isn't a define for the TIOCSERGETLSR.
>>
>> It could be that I'm just missing a detail by looking only at the diff.
>
> The issue was on (linux) systems that have TIOCSERGETLSR defined for an
> ioctl, but the (USB) device driver itself may or may not have any code for
> processing the TIOCSERGETLSR. So u have to support both as if TIOCSERGETLSR
> does and does not exist - at run time.
>
> So what happens on a sys that fully implements TIOCSERGETLSR? What happens on
> a system that does not implement (define) TIOCSERGETLSR.
>
> I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
> appropriate, but I wont be able to test the issue with unplugging the USB
> device, and rxtx spinning as a result.
>
Hmm OK.
I had not thought about USB/bluetooth dongles.
We should be able to do what you require and handle the systems that don't
implement the call. It will just take a bit more work. I'll look into it
more tomorrow.
Thanks George
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 22:21:12 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 22:21:12 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471EA9E1.7070707@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
<471EA9E1.7070707@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>
>> ... on a Solaris/*BSD machine? There is obviously the problem with
>> multiport serial cards that do not support the ioctl but on systems other
>> than Linux, there isn't a define for the TIOCSERGETLSR.
>>
>> It could be that I'm just missing a detail by looking only at the diff.
>
> The issue was on (linux) systems that have TIOCSERGETLSR defined for an
> ioctl, but the (USB) device driver itself may or may not have any code for
> processing the TIOCSERGETLSR. So u have to support both as if TIOCSERGETLSR
> does and does not exist - at run time.
>
> So what happens on a sys that fully implements TIOCSERGETLSR? What happens on
> a system that does not implement (define) TIOCSERGETLSR.
>
> I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
> appropriate, but I wont be able to test the issue with unplugging the USB
> device, and rxtx spinning as a result.
>
As a quick followup, this is easy enough to try on Linux. Just undef
TIOCSERGETLSR after the includes and build. When it blows up, thats what
will happen on the traditional systems.
--
Trent Jarvi
tjarvi at qbang.org
From wayne at flashmedia.co.za Wed Oct 24 01:04:06 2007
From: wayne at flashmedia.co.za (Wayne Gemmell)
Date: Wed, 24 Oct 2007 09:04:06 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <200710240904.06544.wayne@flashmedia.co.za>
Hi all
Sorry for the re-post but did this post get through on Monday? I see theres
plenty email today.
Thanks
Wayne
On Monday 22 October 2007 12:27:35 Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2%
> of my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code
> below. Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,
>s tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new
> String(readBuffer)).substring(0,numBytes); for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From Martin.Oberhuber at windriver.com Wed Oct 24 03:17:04 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:17:04 +0200
Subject: [Rxtx] RXTX cannot connect a specific board without HW flow control
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C671@ism-mail03.corp.ad.wrs.com>
Re-sending due to mailing list issue:
Hi RXTX community,
we have an odd problem here: there is one specific board that
RXTX connot connect to at 9600 baud / 8n1 / no flow-control:
I see absolutely no output from the remote.
When I enable flow control, it connects fine.
HyperTerminal connets fine both with and without flow control.
Other boards of the same making (i.e. same electronics, different
physical hardware) connect ok both with and without flow control.
Has anybody seen such behavior before?
Any ideas what could be causing this?
It seems that RXTX is less fault tolerant than HyperTerminal
when it comes to flow control...
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From Martin.Oberhuber at windriver.com Wed Oct 24 03:18:21 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:18:21 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
Re-sending due to mailing list issues
Hi all,
I have uploaded an exact description of the issue, and
a fix which I think is good, to RXTX Bugzilla:
http://bugzilla.qbang.org/show_bug.cgi?id=83
Please consider including this into the code base.
The fix on Bugzilla is slightly updated compared to
what I sent before, and works around another potential
deadlock.
We're using this fixed version for our commercial product,
and it's included in the Eclipse bundles at
http://rxtx.qbang.org/eclipse/
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Oberhuber, Martin
> Sent: Thursday, September 20, 2007 3:11 PM
> To: Trent Jarvi; taj at www.linux.org.uk; tjarvi at mathworks.com;
> rxtx at qbang.org
> Cc: Stieber, Uwe; Gutschelhofer, Martin; Scharf, Michael
> Subject: Deadlock in RXTX 2.1-7
>
> Hello,
>
> We have run into a deadlock with RXTX, see attached thread dump.
> this is critical for our commercial application picking up RXTX,
> and it might be critical for others as well.
>
> The problem occurs when multiple threads (parts of the application)
> try to open a CommPort at the same time - especially in the following
> situation:
> * Client 1 opens COM1
> * Client 2 tries to open with a wait time of e.g. 5 sec
> - PortOwnership notification is sent
> - Client 2 waits 5 sec to own port
> * If Client 3 tries an open() during these 5 sec it will deadlock.
>
> Here is the problematic Code, from CommPortIdentifier:
>
> public synchronized CommPort open(String TheOwner, int i)
> throws gnu.io.PortInUseException
> {
> if(debug)
> System.out.println("CommPortIdentifier:open("+TheOwner
> + ", " +i+")");
> if (Available == false)
> {
> synchronized (Sync)
> {
>
>
> fireOwnershipEvent(CommPortOwnershipListener.PORT_OWNERSHIP_RE
> QUESTED);
> try
> {
> wait(i);
> }
> catch ( InterruptedException e )
> {
> Thread.currentThread().interrupt();
> }
> }
> }
>
>
> And here is what happens:
> * Thread 1 does open() and locks "this",
> then it locks "Sync",
> then it releases the lock on "this" because going into wait()
>
> * While Thread 1 is waiting, thread 2 now locks "this",
> but it cannot continue locking "Sync" because it is still
> owned by Thread 2. So it keeps locking "this" forever
>
> * Therefore, Thread 1 cannot return from the wait()
>
> Holding two locks is very problematic here, and I think that holding
> the global "synchronized(Sync)" should be avoided. That lock is for
> protecting the list of CommPorts; but here, we are dealing
> with parties
> interested in one specific CommPort only so the given
> CommPortIdentifier
> we are dealing with should not be affected. Or was the original
> Intent to ensure that nobody can call getPortIdentifiers() while
> Negotiation between the port owners is going on?
>
> In general, the whole concept of re-initializing RXTX in the
> getPortIdentifiers() Method is very problematic, because
> 1.) it creates new instances of CommPortIdentifier; therefore,
> a "notify" against a given CommPortIdentifier may not wake
> up other threads waiting on a different CommPortIdentifier
> object that's been instanciated for the same port. This
> might be the reason for the comment
> /* this tosses null pointer?? */
> In internalClosePort().
> 2.) Anybody is free to call getPortIdentifiers() at any
> time. Couldn't re-initializing RXTX break any data
> transmissions that others are currently having?
>
> I've been trying to come up with a fix, but I don't think I
> know enough about RXTX to understand how to better update the
> List of known ports in getPortIdentifiers() without having
> to re-initialize everything. So, my fix seems to be more of
> a workaround, although it should address the most burning
> issues of deadlock.
>
> Find attached the new version of CommPortIdentifier that
> I have come up with. Please review and let me know what
> You think! I think that a real fix needs to get the list of
> CommPort names out of the RXTXDriver without re-initializing
> Everything, but I'd like to get your comments.
>
> Thanks,
> --
> Martin Oberhuber
> Wind River Systems, Inc.
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
>
>
From Martin.Oberhuber at windriver.com Wed Oct 24 03:35:03 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:35:03 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C6B5@ism-mail03.corp.ad.wrs.com>
Hello Trent,
thanks for your efforts - but it doesn't run on my box.
Looks like you built for SPARC64 but I need SPARC32 ?
java.lang.UnsatisfiedLinkError:
/folk/mober/RSETest/sol-3.3.1/eclipse/plugins/gnu.io.rxtx.solaris.sparc_
2.1.7.3_v20071015/os/solaris/sparc/librxtxSerial.so: ld.so.1: eclipse:
fatal:
/folk/mober/RSETest/sol-3.3.1/eclipse/plugins/gnu.io.rxtx.solaris.sparc_
2.1.7.3_v20071015/os/solaris/sparc/librxtxSerial.so: wrong ELF class:
ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver
And actually, I was not looking for a build with -g but
rather for a build with macros
DEBUG_VERBOSE
ENTER
LEAVE
or whatever else makes sense for logging enabled...
in SerialImp.c, I found the macros mentioned though
you might know better what logging makes sense
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Wednesday, October 24, 2007 1:08 AM
> To: Oberhuber, Martin
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] NoSuchPortException in
> getPortIdentifier() on Solaris
>
> I built an Ad Hoc version for sol10 with -g for you and put it in the
> ToyBox.
>
> http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/spa
> rc-sun-solaris2.10-debug
>
> r2 was a second build so its all just 2.1-7.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:05:45 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:05:45 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C70B@ism-mail03.corp.ad.wrs.com>
Hi Trent,
I found a Java fix which works most of the time:
in getPortIdentifier(), do not re-initialize RXTX
all the time but only when it is necessary.
I uploaded a full description, patch and updated
.java file to
http://bugzilla.qbang.org/show_bug.cgi?id=48
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Wednesday, October 24, 2007 1:08 AM
> To: Oberhuber, Martin
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] NoSuchPortException in
> getPortIdentifier() on Solaris
>
> On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
>
> > Hello,
> >
> > I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> > Terminal in Eclipse.
> >
> > On initial startup of my application, /dev/term/b is always
> > detected. But when I call getPortIdentifier(), the nested
> > getPortIdentifiers() does not detect it any more. It seems
> > that testRead() fails when RXTX is being re-initialized.
> >
> > It fails not always, but approximately 8 times out of 10 tries.
> >
> > It looks like the code is broken due to the fix in
> > CommPortIdentifier which was added for
> > http://bugzilla.qbang.org/show_bug.cgi?id=48
> >
> > Has anybody seen this before, or can give any advice?
> >
> > Unfortunately, I currently don't have a compile
> > environment available on Solaris such that I could
> > try a debug version to see what's causing the port
> > detection to fail in native code. Does anybody have
> > a Solaris debug version available?
> >
>
> Hi Martin,
>
> I built an Ad Hoc version for sol10 with -g for you and put it in the
> ToyBox.
>
> http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/spa
> rc-sun-solaris2.10-debug
>
> r2 was a second build so its all just 2.1-7.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:08:03 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:08:03 +0200
Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port
In-Reply-To: <460801A4097E3D4CA04CC64EE6485848020CB5CC@ism-mail03.corp.ad.wrs.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com>
Hi Greg and others,
I think that the issue is actually fixed by the updates I've submitted
for CommPortIdentifier recently.
With these fixes, it is no longer necessary to get a fresh
CommPortIdentifier.
The problem was, that RXTX had re-initialized its CommPortIdentifier
list
too often, thus losing the context info; that was a problem for other
applications
as well (sharing access to a com port; deadlocks).
All my fixes are included in the patch on
http://bugzilla.qbang.org/show_bug.cgi?id=48
More explanations, and an older interim version of my patches are on
http://bugzilla.qbang.org/show_bug.cgi?id=83
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On
Behalf Of Oberhuber, Martin
Sent: Thursday, June 28, 2007 1:23 PM
To: greg.johnson at esrf.fr
Cc: RXTX Developers and Users; ruskin at pwlinda.mt.umist.ac.uk
Subject: Re: [Rxtx] PortInUseException - Cannot close and reopen
serial port
Hi Greg,
Many many thanks!
Getting a fresh CommPortIdentifier helped indeed.
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: Greg Johnson
[mailto:greg.johnson at manchester.ac.uk]
Sent: Wednesday, June 27, 2007 5:50 PM
To: Oberhuber, Martin
Cc: RXTX Developers and Users;
ruskin at pwlinda.mt.umist.ac.uk
Subject: Re: [Rxtx] PortInUseException - Cannot close
and reopen serial port
Hello Martin,
We found that we had to get a fresh CommPortIdentifier
each time - reusing the previous one, even though the port had been
closed, caused this to barf.
while (true) {
portId=CommPortIdentifier.getPortIdentifier(pName);
Thread.sleep(2000); // or else USB dongles barf
serialport = (SerialPort) portId.open("MyApp",100);
// do something interesting
serialport.close();
}
Previously, we just tried to do
serialport = (SerialPort) portId.open("MyApp,100);
or
SerialPort serialport2 = ...
a second time, but that gave the so-called
PortInUseException.
We're now limping along. Still struggling with
USB-dongles - seems to need a full 2s after insertion to reliably be
able to open the serial port.
This was a problem on OSX and WinXPSP2 both. We
downloaded the "2.1-8" (which reports itself as 2.1-7) from CSV - it
helped on the OSX side as it stopped flooding the console with
irrelevant locking warnings. Other than that, we saw no change in
behaviour.
Cheers,
greg
------------------------------------------------------------------------
-
Greg Johnson
Research Fellow at University of Manchester
Scientific Collaborator at ESRF - European Synchrotron
greg.johnson at esrf.fr
greg.johnson at ieee.org
+33 (0)4 76 88 28 37
On 27 Jun 2007, at 17:35, Oberhuber, Martin wrote:
Hello,
did anybody find a solution for the issue on
Windows, where after
port.close() the port cannot be opened
immediately but throws
a PortInUseException?
There were Reports that it took 30 seconds
before the port got
actually free again, did anybody dig any deeper
and find the
real issue?
This is about rxtx-2.1-7r2 on Windows XP SP2.
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: rxtx-bounces at qbang.org
[mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson
Sent: Wednesday, March 28, 2007 10:43 PM
To: rxtx at qbang.org
Cc: ruskin at pwlinda.mt.umist.ac.uk
Subject: [Rxtx] Cannot close and reopen
serial port
Dear all,
It appears I cannot close a port
properly:
SerialPort serialport =
portid.open("myprog",100);
// do some stuff, all works fine
serialport.close(); // all seems fine
but...
SerialPort sp2 =
portid.open("myprog",100);
throws PortInUseException.
And when I dig into the rxtx code, I
find in CommPort.java, in close():
CommPortIdentifier cp =
CommPortIdentifier.getPortIdentifier(this);
(line 64 or there abouts)
but this throws a NoSuchPortException
which is caught but ignored (line 74ish).
Can anyone suggest how this could
happen: a port that was valid, opened, and used, throws a NSPE when it
comes to closing it? I'm pulling my (remaining) hair out over this one!
Cheers,
greg
PS And thanks for RXTX - it's great to
have!
PPS (21.-7. winxp/osx both, java 1.5)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071024/ea1ddbfa/attachment-0004.html
From Martin.Oberhuber at windriver.com Wed Oct 24 04:09:16 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:09:16 +0200
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C716@ism-mail03.corp.ad.wrs.com>
Hi Trent and Will,
All of my changes are actually in CommPortIdentifier.java only.
The most recent version is attached to
http://bugzilla.qbang.org/show_bug.cgi?id=48
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Trent Jarvi
> Sent: Wednesday, October 24, 2007 1:12 AM
> To: Will Tatam
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] Release date for 2.2
>
> On Tue, 23 Oct 2007, Will Tatam wrote:
>
> > Before everything went tits up with the server there was talk about
> > preparing for a 2.2 release. Is there a timescale for this
> and is there
> > a document somewhere as to what changes this will contain ?
> >
> >
>
> Hi Will,
>
> So far, I've been doing the best I can just to pull rxtx out
> of a pile of
> inodes.
>
> We can start looking at a new release now. The first thing I
> want to do
> is go back ane encorperate the changes Martin has been
> working on. I'll
> have a few minor changes also. This is a good time to get
> the release
> out.
>
> There isn't a list of changes right now. What we could do is
> have Martin
> post his changes to the list again and start there. Or I can
> dig though
> my email and find them if he does not have them handy.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:17:11 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:17:11 +0200
Subject: [Rxtx] virtual serial port
In-Reply-To: <1183556787.10682.6.camel@alvin>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C72F@ism-mail03.corp.ad.wrs.com>
Hi Joshua,
I think it's undocumented, but if you look at the
code in RXTXCommDriver.java you'll see that there
are several options to manually specify ports
which RXTX does not detect automatically.
One of them is this:
System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/myPort");
it also takes a list of ports, separated by
path.separator
Note that when you manually specify the ports, it
will not even try to scan ports itself any more.
So scanned ports need to be added to the System
Property.
Hope this helps,
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Joshua Chambers
> Sent: Wednesday, July 04, 2007 3:46 PM
> To: rxtx at qbang.org
> Subject: [Rxtx] virtual serial port
>
> Hello!
>
> Okay, I am trying to write a cross-platform application that
> talks to a
> custom little micro-controller box. This box uses a virtual serial
> port, which happens to have nice support under linux. When
> you plug it
> in, it creates a serial port at /dev/ttyACM0 which I can
> connect to and
> talk to with a regular serial port terminal.
>
> I've also tried this in windows, and with the proper .inf file it uses
> usbser.sys and works fine, I can talk with it. I've had different
> unsuccessful behavior from this library on each platform so far.
>
> Under linux, it seems to be unable to see the port. when I try to do
> CommPortIdentifier.getPortIdentifier("/dev/ttyACM0") I get a
> NoSuchPortException and when I enumerate the ports, I get only
> one, /dev/ttyS0.
>
> Is this any reason I shouldn't be able to point this thing to my
> functioning virtual serial port?
>
> In windows, the port IS listed in the enumeration, but when I try to
> open it, I get a PortInUseException, however when I query to find out
> who the owner is, I get null.
>
> Any help is so greatly appreciated! Thank you!
> Joshua
>
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From netbeans at gatworks.com Wed Oct 24 04:34:22 2007
From: netbeans at gatworks.com (U. George)
Date: Wed, 24 Oct 2007 06:34:22 -0400
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
Message-ID: <471F1FAE.1010407@gatworks.com>
> Re-sending due to mailing list issues
>
> Hi all,
>
> I have uploaded an exact description of the issue, and
>
I think issues will again appear when you realize that serial (usb)
devices can disappear and reappear from the initial scan ( even with
different device names ) .
At startup, there was only a ttyUSB0. But later ttyUSB0 disappears, and
ttyUSB1 appears. This happens on linux when one un-plugs the USB device
while its in the open() state, and reinserts the usb device back. The
kernel now gives hard failures to the ioctls BUT wont release resources
until close() for ttyUSB0, Since you plugged the USB device back in, the
kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
ttyUSB0 is closed, that device (ttyUSB0) will also disappear from /dev (
as it is now officially called ttyUSB1 ) .
From Martin.Oberhuber at windriver.com Wed Oct 24 08:04:24 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 16:04:24 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <471F1FAE.1010407@gatworks.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C8C4@ism-mail03.corp.ad.wrs.com>
Hello George,
note that we are talking about
CommPortIdentifier.getPortIdentifier(String portName)
where User asks for a specific portName.
If we already have an identifier for that name, just use it.
If device has been unplugged, error will happen when user
tries to use that identifier (wherease before my patch,
getPortIdentifier would return null).
When user asks for a portName that we have not seen before,
it will still rescan with my patch.
My patch did not change behavior of getPortIdentifiers().
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of U. George
> Sent: Wednesday, October 24, 2007 12:34 PM
> To: rxtx at qbang.org
> Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
>
> > Re-sending due to mailing list issues
> >
> > Hi all,
> >
> > I have uploaded an exact description of the issue, and
> >
> I think issues will again appear when you realize that serial (usb)
> devices can disappear and reappear from the initial scan ( even with
> different device names ) .
> At startup, there was only a ttyUSB0. But later ttyUSB0
> disappears, and
> ttyUSB1 appears. This happens on linux when one un-plugs the
> USB device
> while its in the open() state, and reinserts the usb device back. The
> kernel now gives hard failures to the ioctls BUT wont release
> resources
> until close() for ttyUSB0, Since you plugged the USB device
> back in, the
> kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
>
> Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
> ttyUSB0 is closed, that device (ttyUSB0) will also disappear
> from /dev (
> as it is now officially called ttyUSB1 ) .
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From tjarvi at qbang.org Wed Oct 24 15:36:21 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Wed, 24 Oct 2007 15:36:21 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <471FA070.5000400@mobilebox.pl>
References: <471FA070.5000400@mobilebox.pl>
Message-ID:
On Wed, 24 Oct 2007, Leszek Gawron wrote:
> Hello,
> as the user list seems inactive you are my last hope to resolve the problem.
> I've had some serious issues with javax comm API so I finally decided to
> switch to RXTX. I keep getting these:
>
>> ERROR 2007-10-24 10:20.10:375 [MessagePoller] smsPoller: error occurred
>> while iterating messages, restarting after delay
>> java.lang.RuntimeException: unable to execute command
>> at com.mobilebox.modem.Modem.execute(Modem.java:330)
>> at com.mobilebox.modem.at.sms.ListMessages.run(ListMessages.java:40)
>> at com.mobilebox.modem.Modem.execute(Modem.java:328)
>> at
>> com.mobilebox.mail2sms.service.impl.SmsService.iterateMessages(SmsService.java:62)
>> at
>> com.mobilebox.mail2sms.service.MessagePoller.run(MessagePoller.java:97)
>> at java.lang.Thread.run(Unknown Source)
>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
>> at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
>> at sun.nio.cs.StreamDecoder.read(Unknown Source)
>> at java.io.InputStreamReader.read(Unknown Source)
>> at java.io.BufferedReader.fill(Unknown Source)
>> at java.io.BufferedReader.read(Unknown Source)
>> at com.mobilebox.modem.Modem.readStopAware(Modem.java:173)
>> at com.mobilebox.modem.Modem.readSingleLine(Modem.java:155)
>> at com.mobilebox.modem.Modem.readSingleLine(Modem.java:150)
>> at com.mobilebox.modem.Modem.readBasicResponse(Modem.java:135)
>> at
>> com.mobilebox.modem.at.SimpleAtCommand.run(SimpleAtCommand.java:41)
>> at com.mobilebox.modem.Modem.execute(Modem.java:328)
>> ... 5 more
>
>
> The code is dead simple:
>
>> private synchronized String readStopAware( String stopFor ) throws
>> IOException {
>> StringBuffer buffer = new StringBuffer();
>> int ch = -1;
>>
>> int bufferPos = 0;
>> boolean stopForMatches = true;
>>
>> while ( true ) {
>> ch = in.read();
>>
>> if ( ch == -1 )
>> break;
>>
>> if ( ch == '\r' )
>> continue;
>>
>> if ( ch == '\n' )
>> break;
>>
>> buffer.append( (char) ch );
>>
>> // if single character differs - no need to check
>> further
>> if ( stopFor != null && stopForMatches ) {
>> if ( stopFor.charAt( bufferPos ) ==
>> buffer.charAt( bufferPos ) ) {
>> bufferPos++;
>> if ( bufferPos == stopFor.length() )
>> break;
>> } else
>> stopForMatches = false;
>> }
>> }
>> if ( ch == -1 && buffer.length() == 0 )
>> return null;
>>
>> return buffer.toString();
>> }
>
> The connection is established like this:
>> public synchronized void connect() {
>> logger.info( "opening comm port: " + getPort() );
>> CommPortIdentifier portId = getPortIdentifier();
>>
>> try {
>> serialPort = (SerialPort) portId.open(
>> getPortOwnerName(),
>> PORT_TIMEOUT
>> );
>> } catch ( PortInUseException e ) {
>> throw new RuntimeException( "port " + getPort() + "
>> currently owned by " + e.currentOwner
>> + ", unable to
>> proceed" );
>> }
>>
>> try {
>> serialPort.setSerialPortParams( getSpeed(),
>> SerialPort.DATABITS_8,
>> SerialPort.STOPBITS_1,
>> SerialPort.PARITY_NONE
>> );
>> } catch ( UnsupportedCommOperationException e ) {
>> throw new RuntimeException( "unable to set port
>> parameters", e );
>> }
>>
>> serialPort.disableReceiveTimeout();
>>
>> try {
>> this.in = new BufferedReader( new InputStreamReader(
>> serialPort.getInputStream() ) );
>> this.out = new BufferedWriter( new
>> OutputStreamWriter( serialPort.getOutputStream() ) );
>> } catch ( IOException e ) {
>> disconnect();
>> throw new RuntimeException( "unable to connect to
>> modem", e );
>> }
>>
>> logger.info( "done." );
>> }
>
>
> This happens while connecting to a GSM modem over serial line. Even better:
> this happens even if there is no device connected to RS232 port.
>
> I've tried:
> JDK 1.6, JDK 1.5
>
> Windows XP SP1, Windows Server 2003
>
> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
>
> None of the combinations of these seem to work properly.
>
Hi Leszek
The rxtx mail-list just started up again this week.
I suspect that you need to alter the Timeout and Threshold to match your
expected behavior. I thought timeout and threshold behaved but they may
not be handling some error condition properly.
Perhaps Try the following?
SerialPort.enableReceiveTimeout(0);
SerialPort.enableReceiveThreshold(1);
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Wed Oct 24 16:50:21 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Wed, 24 Oct 2007 16:50:21 -0600 (MDT)
Subject: [Rxtx] [Action Required?] The list is going live again.
In-Reply-To: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
References: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
Message-ID:
On Sun, 21 Oct 2007, tjarvi at qbang.org wrote:
>
> The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
>
> http://mailman.qbang.org/mailman/options/rxtx
>
> If you enter your email address and hit the remind button, a password will be emailed to you.
>
> I'll try to wait a while before opening the gates. We have several emails pending.
>
For those of you that had problems changing your preferences on the
server, I've updated the server configuration and expect you should have
no problems changing them now. It was a security module setting.
Please let me know if you have any problems. It did work for me.
--
Trent Jarvi
tjarvi at qbang.org
From Martin.Oberhuber at windriver.com Thu Oct 25 04:30:10 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Thu, 25 Oct 2007 12:30:10 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C8C4@ism-mail03.corp.ad.wrs.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480358CFC2@ism-mail03.corp.ad.wrs.com>
PS
attached is a simplified version of the patch which only
addresses this particular issue.
Here it's more clear to see what I actually changed.
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Oberhuber, Martin
> Sent: Wednesday, October 24, 2007 4:04 PM
> To: U. George; rxtx at qbang.org
> Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
>
> Hello George,
>
> note that we are talking about
> CommPortIdentifier.getPortIdentifier(String portName)
> where User asks for a specific portName.
>
> If we already have an identifier for that name, just use it.
> If device has been unplugged, error will happen when user
> tries to use that identifier (wherease before my patch,
> getPortIdentifier would return null).
>
> When user asks for a portName that we have not seen before,
> it will still rescan with my patch.
>
> My patch did not change behavior of getPortIdentifiers().
>
> Cheers,
> --
> Martin Oberhuber
> Wind River Systems, Inc.
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
>
> > -----Original Message-----
> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> > On Behalf Of U. George
> > Sent: Wednesday, October 24, 2007 12:34 PM
> > To: rxtx at qbang.org
> > Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
> >
> > > Re-sending due to mailing list issues
> > >
> > > Hi all,
> > >
> > > I have uploaded an exact description of the issue, and
> > >
> > I think issues will again appear when you realize that serial (usb)
> > devices can disappear and reappear from the initial scan (
> even with
> > different device names ) .
> > At startup, there was only a ttyUSB0. But later ttyUSB0
> > disappears, and
> > ttyUSB1 appears. This happens on linux when one un-plugs the
> > USB device
> > while its in the open() state, and reinserts the usb device
> back. The
> > kernel now gives hard failures to the ioctls BUT wont release
> > resources
> > until close() for ttyUSB0, Since you plugged the USB device
> > back in, the
> > kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
> >
> > Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
> > ttyUSB0 is closed, that device (ttyUSB0) will also disappear
> > from /dev (
> > as it is now officially called ttyUSB1 ) .
> > _______________________________________________
> > Rxtx mailing list
> > Rxtx at qbang.org
> > http://mailman.qbang.org/mailman/listinfo/rxtx
> >
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rxtx_48_noSuchPort.diff.txt
Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071025/bb61b7ab/attachment-0003.txt
From sebastien.jean at inrialpes.fr Thu Oct 25 12:51:10 2007
From: sebastien.jean at inrialpes.fr (=?ISO-8859-1?Q?S=E9bastien_Jean?=)
Date: Thu, 25 Oct 2007 20:51:10 +0200
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID: <4CF602F8-2376-464E-8E9A-C7205E36E2D4@inrialpes.fr>
hi arnab,
As Java "int" type is related to a 32 bits signed value, you can
easily set he baudrate to 115200 if you want.
You might have made confusion with the "short" Java type, that is 16
bits long.
S?bastien.
Le 31 juil. 07 ? 17:27, arnab bhaumik a ?crit :
> hi all,
>
> i am wondering how to get this speed (115.2kbps) with rxtx????
>
>
>
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so
> it cant take 115200!!!!!!!!!!!!!!
>
> please help me
> arnab
>
> --
> Arnab Bhaumik / VU2BPW
>
> Proprietor and Design Engineer,
>
> AB Telecomm.
> Rajchandrapur, PO- Ghoshpara(Bally).
> Howrah, West Bengal.
> Pin - 711227
> Ph- (033) 26716307
> Mob- 9433927150
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
From netbeans at gatworks.com Thu Oct 25 15:04:27 2007
From: netbeans at gatworks.com (U. George)
Date: Thu, 25 Oct 2007 17:04:27 -0400
Subject: [Rxtx] rxtx problem
In-Reply-To:
References: <471FA070.5000400@mobilebox.pl>
Message-ID: <472104DB.9070106@gatworks.com>
What it seems to be saying is that there is an error in how rxtx.read()
is suppose to behave.
sun.nio.cs.StreamDecoder.readBytes() thinks that there should be some
bytes returned, or, i suppose, an I/O exception is/should be thrown when
there are no bytes to be returned.
this also needs to be resolved so that readBytes() can handle timeout
exceptions, presuming that rxtx throws that exception in the case of
your device.
>>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
From netbeans at gatworks.com Thu Oct 25 17:26:33 2007
From: netbeans at gatworks.com (U. George)
Date: Thu, 25 Oct 2007 19:26:33 -0400
Subject: [Rxtx] rxtx problem
In-Reply-To: <472104DB.9070106@gatworks.com>
References: <471FA070.5000400@mobilebox.pl>
<472104DB.9070106@gatworks.com>
Message-ID: <47212629.6080304@gatworks.com>
U. George wrote:
> What it seems to be saying is that there is an error in how rxtx.read()
> is suppose to behave.
> sun.nio.cs.StreamDecoder.readBytes() thinks that there should be some
> bytes returned, or, i suppose, an I/O exception is/should be thrown when
> there are no bytes to be returned.
>
> this also needs to be resolved so that readBytes() can handle timeout
> exceptions, presuming that rxtx throws that exception in the case of
> your device.
>
>>>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>>>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
this is the relevant code segment from openjava sources:
try {
> // Read from the input stream, and then update the buffer
> .................
> int n = in.read(bb.array(), bb.arrayOffset() + pos, rem);
> .................
> if (n == 0)
> throw new IOException("Underlying input stream returned zero bytes");
> ..................
> }
> } finally {
> .............
> }
I suppose I have to ask where did the timeout exception go?
From tjarvi at qbang.org Thu Oct 25 17:36:15 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Thu, 25 Oct 2007 17:36:15 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <47212629.6080304@gatworks.com>
References: <471FA070.5000400@mobilebox.pl>
<472104DB.9070106@gatworks.com> <47212629.6080304@gatworks.com>
Message-ID:
On Thu, 25 Oct 2007, U. George wrote:
> U. George wrote:
>> What it seems to be saying is that there is an error in how rxtx.read() is
>> suppose to behave.
>> sun.nio.cs.StreamDecoder.readBytes() thinks that there should be some bytes
>> returned, or, i suppose, an I/O exception is/should be thrown when there
>> are no bytes to be returned.
>>
>> this also needs to be resolved so that readBytes() can handle timeout
>> exceptions, presuming that rxtx throws that exception in the case of your
>> device.
>>
>>>>> Caused by: java.io.IOException: Underlying input stream returned zero
>>>>> bytes
>>>>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
>
> this is the relevant code segment from openjava sources:
> try {
>> // Read from the input stream, and then update the buffer
>> .................
>> int n = in.read(bb.array(), bb.arrayOffset() + pos, rem);
>> .................
>> if (n == 0)
>> throw new IOException("Underlying input stream returned
>> zero bytes");
>> ..................
>> }
>> } finally {
>> .............
>> }
>
> I suppose I have to ask where did the timeout exception go?
>
Hmm
My first thought was I had made very sure the timeouts and thresholds
worked in rxtx. But disabletimeout was used so I wasnt sure if something
different may happen - does not appear so.
I can easily picture rxtx throwing an exception - even an inappropriate
one. But it would just timeout and return if there was a timeout enabled.
There must be an error condition that isn't handled well.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Thu Oct 25 18:22:24 2007
From: netbeans at gatworks.com (U. George)
Date: Thu, 25 Oct 2007 20:22:24 -0400
Subject: [Rxtx] rxtx problem
In-Reply-To:
References: <471FA070.5000400@mobilebox.pl>
Message-ID: <47213340.8090809@gatworks.com>
>>
>> This happens while connecting to a GSM modem over serial line. Even better:
>> this happens even if there is no device connected to RS232 port.
>>
>> I've tried:
>> JDK 1.6, JDK 1.5
>>
>> Windows XP SP1, Windows Server 2003
>>
>> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
OOps, this is a windoz issue ( i hope ). This leaves me out of any
further analysis - :-}
From tjarvi at qbang.org Thu Oct 25 19:04:29 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Thu, 25 Oct 2007 19:04:29 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <47213340.8090809@gatworks.com>
References: <471FA070.5000400@mobilebox.pl>
<47213340.8090809@gatworks.com>
Message-ID:
On Thu, 25 Oct 2007, U. George wrote:
>>>
>>> This happens while connecting to a GSM modem over serial line. Even better:
>>> this happens even if there is no device connected to RS232 port.
>>>
>>> I've tried:
>>> JDK 1.6, JDK 1.5
>>>
>>> Windows XP SP1, Windows Server 2003
>>>
>>> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
>
> OOps, this is a windoz issue ( i hope ). This leaves me out of any
> further analysis - :-}
Perhaps but RXTX just puts a wrapper around windows and treats it as
POSIX.
Thats probably important to remember when we revisit your patch :)
--
Trent Jarvi
tjarvi at qbang.org
From andy.reid at logicacmg.com Fri Oct 26 00:56:09 2007
From: andy.reid at logicacmg.com (Reid, Andy (Space & Defence))
Date: Fri, 26 Oct 2007 07:56:09 +0100
Subject: [Rxtx] Multiple ports
Message-ID:
Hi,
I have a problem in trying to open, write to and then close multiple
ports.
I have a java class for accessing and controlling my com port, if I
create several instances of the class for different com ports and use
the ports after I have opened and closed them several times I often get
problems trying to access one of them.
If I use javax.comm I don't get these problems so I'm trying to
understand if there's something I'm not doing when closing and then
re-opening a port.
I can post code snippets if that would help but I've resisted posting
the whole class for now.
Cheers
Andy
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071026/5b393f73/attachment-0001.html
From tjarvi at qbang.org Fri Oct 26 16:42:01 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Fri, 26 Oct 2007 16:42:01 -0600 (MDT)
Subject: [Rxtx] Multiple ports
In-Reply-To:
References:
Message-ID:
On Fri, 26 Oct 2007, Reid, Andy (Space & Defence) wrote:
> Hi,
>
> I have a problem in trying to open, write to and then close multiple
> ports.
> I have a java class for accessing and controlling my com port, if I
> create several instances of the class for different com ports and use
> the ports after I have opened and closed them several times I often get
> problems trying to access one of them.
> If I use javax.comm I don't get these problems so I'm trying to
> understand if there's something I'm not doing when closing and then
> re-opening a port.
>
> I can post code snippets if that would help but I've resisted posting
> the whole class for now.
>
Hi Andy
Do you have a simple application that reproduces the problem? We have had
a report of problems with 256 serial ports but I had no means of
reproducing it.
As I recall, Sun's CommAPI was limited to 4 ports so you may be onto
something.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sun Oct 21 11:38:45 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sun, 21 Oct 2007 11:38:45 -0600
Subject: [Rxtx] [Action Required?] The list is going live again.
Message-ID: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
http://mailman.qbang.org/mailman/options/rxtx
If you enter your email address and hit the remind button, a password will be emailed to you.
I'll try to wait a while before opening the gates. We have several emails pending.
--
Trent Jarvi
tjarvi at qbang.org
From lists2006.wayne at gmail.com Mon Oct 22 04:27:35 2007
From: lists2006.wayne at gmail.com (Wayne Gemmell)
Date: Mon, 22 Oct 2007 12:27:35 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
Message-ID: <200710221227.36046.wayne@flashmedia.co.za>
Hi All
I have a program the monitors USSD sessions using a wavecom modem. About 2% of
my transactions come back with funny characters in the first 10 or so
characters (I'm not monitoring it they are happening later.). This is
illustrated in the logging output below. I've added the receiving code below.
Has anyone seen similar results?
2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
(time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
private String readInput() {
int numBytes,count = 1;
StringBuffer sb = new StringBuffer();
byte [] readBuffer = new byte[50];
waitForInput=true;
while(waitForInput)
try {
Thread.sleep(count * 100);
count++;
if(count == 50) {
logger.error("Time out waiting for response");
return null;
}
while (inputStream.available() > 0) {
numBytes = inputStream.read(readBuffer);
if(numBytes<=1)
continue;
sb.append(new String(readBuffer)).substring(0,numBytes);
for(int i=0;i
public void serialEvent(SerialPortEvent event) {
// TODO Auto-generated method stub
switch (event.getEventType()) {
case SerialPortEvent.DATA_AVAILABLE:
waitForInput = false;
}
}
--
Regards
Wayne
From netbeans at gatworks.com Mon Oct 22 13:50:37 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 15:50:37 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <471CFF0D.4030601@gatworks.com>
Is it a USB modem? Or a real serial modem?
When serialUSB ( kernel module ) starts up, i usually get some funny
characters from the GPS receiver. After that it appears ok.
maybe a bit of rxtx debugging is in order.
BTW: those funny chars is '\0' or null, or a control-@ ( as i vaguely
remember )
Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2% of
> my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code below.
> Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
> tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new String(readBuffer)).substring(0,numBytes);
> for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From netbeans at gatworks.com Mon Oct 22 16:03:54 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 18:03:54 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <471CFF0D.4030601@gatworks.com>
References: <200710221227.36046.wayne@flashmedia.co.za>
<471CFF0D.4030601@gatworks.com>
Message-ID: <471D1E4A.4080601@gatworks.com>
Also, are u shure this works?
does not a new CharAt(i) get shifted down from the length of the string?
i like to do this in reverse ( for ( int i = sb.length-1; i > 0 ; i-- )
{ if(sb.charAt(i)==0) sb.deleteCharAt(i); }
just a thought :}
>> for(int i=0;i> if(sb.charAt(i)==0)
>> sb.deleteCharAt(i);
>> }
>>
From Martin.Oberhuber at windriver.com Tue Oct 23 10:57:46 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Tue, 23 Oct 2007 18:57:46 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Hello,
I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
Terminal in Eclipse.
On initial startup of my application, /dev/term/b is always
detected. But when I call getPortIdentifier(), the nested
getPortIdentifiers() does not detect it any more. It seems
that testRead() fails when RXTX is being re-initialized.
It fails not always, but approximately 8 times out of 10 tries.
It looks like the code is broken due to the fix in
CommPortIdentifier which was added for
http://bugzilla.qbang.org/show_bug.cgi?id=48
Has anybody seen this before, or can give any advice?
Unfortunately, I currently don't have a compile
environment available on Solaris such that I could
try a debug version to see what's causing the port
detection to fail in native code. Does anybody have
a Solaris debug version available?
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From will.tatam at red61.com Tue Oct 23 12:26:29 2007
From: will.tatam at red61.com (Will Tatam)
Date: Tue, 23 Oct 2007 19:26:29 +0100
Subject: [Rxtx] Release date for 2.2
Message-ID: <471E3CD5.4030605@red61.com>
Before everything went tits up with the server there was talk about
preparing for a 2.2 release. Is there a timescale for this and is there
a document somewhere as to what changes this will contain ?
--
Will Tatam
Systems Architect
Red Sixty One LTD
0845 867 2203 ext 103
From tjarvi at qbang.org Tue Oct 23 17:07:37 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:07:37 -0600 (MDT)
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Message-ID:
On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
> Hello,
>
> I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> Terminal in Eclipse.
>
> On initial startup of my application, /dev/term/b is always
> detected. But when I call getPortIdentifier(), the nested
> getPortIdentifiers() does not detect it any more. It seems
> that testRead() fails when RXTX is being re-initialized.
>
> It fails not always, but approximately 8 times out of 10 tries.
>
> It looks like the code is broken due to the fix in
> CommPortIdentifier which was added for
> http://bugzilla.qbang.org/show_bug.cgi?id=48
>
> Has anybody seen this before, or can give any advice?
>
> Unfortunately, I currently don't have a compile
> environment available on Solaris such that I could
> try a debug version to see what's causing the port
> detection to fail in native code. Does anybody have
> a Solaris debug version available?
>
Hi Martin,
I built an Ad Hoc version for sol10 with -g for you and put it in the
ToyBox.
http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/sparc-sun-solaris2.10-debug
r2 was a second build so its all just 2.1-7.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:12:09 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:12:09 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E3CD5.4030605@red61.com>
References: <471E3CD5.4030605@red61.com>
Message-ID:
On Tue, 23 Oct 2007, Will Tatam wrote:
> Before everything went tits up with the server there was talk about
> preparing for a 2.2 release. Is there a timescale for this and is there
> a document somewhere as to what changes this will contain ?
>
>
Hi Will,
So far, I've been doing the best I can just to pull rxtx out of a pile of
inodes.
We can start looking at a new release now. The first thing I want to do
is go back ane encorperate the changes Martin has been working on. I'll
have a few minor changes also. This is a good time to get the release
out.
There isn't a list of changes right now. What we could do is have Martin
post his changes to the list again and start there. Or I can dig though
my email and find them if he does not have them handy.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:57:40 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:57:40 -0600 (MDT)
Subject: [Rxtx] Wiki and Spambots
In-Reply-To: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
References: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
Message-ID:
On Tue, 17 Jul 2007, Andre-John Mas wrote:
> Hi,
>
> Looks like spambots are wrecking havoc on the Wiki. Had to correct:
>
> http://rxtx.qbang.org/wiki/index.php/Examples
> http://rxtx.qbang.org/wiki/index.php/
> Two_way_communcation_with_the_serial_port
>
> Any chance we can add a captcha for account creation?
>
Late but Done. We actually had spambots trying to write over each other.
I also locked the front page but left everything else editable by anyone
willing to create an account. The pages should be clean again.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 18:29:55 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:29:55 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
Message-ID: <471E9203.9010105@gatworks.com>
> There isn't a list of changes right now. What we could do is have Martin
> post his changes to the list again and start there. Or I can dig though
> my email and find them if he does not have them handy.
here is a diff of the changes I made to my local rxtx ,
gimme a shout when u get ready to review.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071023/66665b8a/attachment-0005.pl
From netbeans at gatworks.com Tue Oct 23 18:37:24 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:37:24 -0400
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID: <471E93C4.4020501@gatworks.com>
a
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so it
> cant take 115200!!!!!!!!!!!!!!
can u tell me why? int is approx +/- 2gig
From tod at todbot.com Tue Oct 23 18:41:29 2007
From: tod at todbot.com (Tod E. Kurt)
Date: Tue, 23 Oct 2007 17:41:29 -0700
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID:
In Java, ints go from -2147483648 to 2147483647, inclusive.
http://java.sun.com/docs/books/jls/third_edition/html/
typesValues.html#4.2.1
On Jul 31, 2007, at 8:27 a, arnab bhaumik wrote:
> hi all,
>
> i am wondering how to get this speed (115.2kbps) with rxtx????
>
>
>
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so
> it cant take 115200!!!!!!!!!!!!!!
>
> please help me
> arnab
>
> --
> Arnab Bhaumik / VU2BPW
>
> Proprietor and Design Engineer,
>
> AB Telecomm.
> Rajchandrapur, PO- Ghoshpara(Bally).
> Howrah, West Bengal.
> Pin - 711227
> Ph- (033) 26716307
> Mob- 9433927150
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Tue Oct 23 19:44:08 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 19:44:08 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E9203.9010105@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>> There isn't a list of changes right now. What we could do is have Martin
>> post his changes to the list again and start there. Or I can dig though my
>> email and find them if he does not have them handy.
>
> here is a diff of the changes I made to my local rxtx ,
> gimme a shout when u get ready to review.
>
Great stuff Uncle George,
I just looked through the diff for flag and discuss items. I'll look
again tomorrow night a little closer. Have you tried the code that
replaces ...
-#if defined(TIOCSERGETLSR)
int change;
if( !ioctl( fd, TIOCSERGETLSR, &change ) ) {
return(1);
}
-#endif /* TIOCSERGETLSR */
... with ...
+ return check_line_status_register_with_GETLSR( eis );
+
+ return check_line_status_register_without_GETLSR( eis );
... on a Solaris/*BSD machine? There is obviously the problem with
multiport serial cards that do not support the ioctl but on systems other
than Linux, there isn't a define for the TIOCSERGETLSR.
It could be that I'm just missing a detail by looking only at the diff.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 20:11:45 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 22:11:45 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID: <471EA9E1.7070707@gatworks.com>
> ... on a Solaris/*BSD machine? There is obviously the problem with
> multiport serial cards that do not support the ioctl but on systems
> other than Linux, there isn't a define for the TIOCSERGETLSR.
>
> It could be that I'm just missing a detail by looking only at the diff.
The issue was on (linux) systems that have TIOCSERGETLSR defined for an
ioctl, but the (USB) device driver itself may or may not have any code
for processing the TIOCSERGETLSR. So u have to support both as if
TIOCSERGETLSR does and does not exist - at run time.
So what happens on a sys that fully implements TIOCSERGETLSR? What
happens on a system that does not implement (define) TIOCSERGETLSR.
I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
appropriate, but I wont be able to test the issue with unplugging the
USB device, and rxtx spinning as a result.
From tjarvi at qbang.org Tue Oct 23 20:39:31 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 20:39:31 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471EA9E1.7070707@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
<471EA9E1.7070707@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>
>> ... on a Solaris/*BSD machine? There is obviously the problem with
>> multiport serial cards that do not support the ioctl but on systems other
>> than Linux, there isn't a define for the TIOCSERGETLSR.
>>
>> It could be that I'm just missing a detail by looking only at the diff.
>
> The issue was on (linux) systems that have TIOCSERGETLSR defined for an
> ioctl, but the (USB) device driver itself may or may not have any code for
> processing the TIOCSERGETLSR. So u have to support both as if TIOCSERGETLSR
> does and does not exist - at run time.
>
> So what happens on a sys that fully implements TIOCSERGETLSR? What happens on
> a system that does not implement (define) TIOCSERGETLSR.
>
> I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
> appropriate, but I wont be able to test the issue with unplugging the USB
> device, and rxtx spinning as a result.
>
Hmm OK.
I had not thought about USB/bluetooth dongles.
We should be able to do what you require and handle the systems that don't
implement the call. It will just take a bit more work. I'll look into it
more tomorrow.
Thanks George
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 22:21:12 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 22:21:12 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471EA9E1.7070707@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
<471EA9E1.7070707@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>
>> ... on a Solaris/*BSD machine? There is obviously the problem with
>> multiport serial cards that do not support the ioctl but on systems other
>> than Linux, there isn't a define for the TIOCSERGETLSR.
>>
>> It could be that I'm just missing a detail by looking only at the diff.
>
> The issue was on (linux) systems that have TIOCSERGETLSR defined for an
> ioctl, but the (USB) device driver itself may or may not have any code for
> processing the TIOCSERGETLSR. So u have to support both as if TIOCSERGETLSR
> does and does not exist - at run time.
>
> So what happens on a sys that fully implements TIOCSERGETLSR? What happens on
> a system that does not implement (define) TIOCSERGETLSR.
>
> I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
> appropriate, but I wont be able to test the issue with unplugging the USB
> device, and rxtx spinning as a result.
>
As a quick followup, this is easy enough to try on Linux. Just undef
TIOCSERGETLSR after the includes and build. When it blows up, thats what
will happen on the traditional systems.
--
Trent Jarvi
tjarvi at qbang.org
From wayne at flashmedia.co.za Wed Oct 24 01:04:06 2007
From: wayne at flashmedia.co.za (Wayne Gemmell)
Date: Wed, 24 Oct 2007 09:04:06 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <200710240904.06544.wayne@flashmedia.co.za>
Hi all
Sorry for the re-post but did this post get through on Monday? I see theres
plenty email today.
Thanks
Wayne
On Monday 22 October 2007 12:27:35 Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2%
> of my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code
> below. Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,
>s tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new
> String(readBuffer)).substring(0,numBytes); for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From Martin.Oberhuber at windriver.com Wed Oct 24 03:17:04 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:17:04 +0200
Subject: [Rxtx] RXTX cannot connect a specific board without HW flow control
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C671@ism-mail03.corp.ad.wrs.com>
Re-sending due to mailing list issue:
Hi RXTX community,
we have an odd problem here: there is one specific board that
RXTX connot connect to at 9600 baud / 8n1 / no flow-control:
I see absolutely no output from the remote.
When I enable flow control, it connects fine.
HyperTerminal connets fine both with and without flow control.
Other boards of the same making (i.e. same electronics, different
physical hardware) connect ok both with and without flow control.
Has anybody seen such behavior before?
Any ideas what could be causing this?
It seems that RXTX is less fault tolerant than HyperTerminal
when it comes to flow control...
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From Martin.Oberhuber at windriver.com Wed Oct 24 03:18:21 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:18:21 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
Re-sending due to mailing list issues
Hi all,
I have uploaded an exact description of the issue, and
a fix which I think is good, to RXTX Bugzilla:
http://bugzilla.qbang.org/show_bug.cgi?id=83
Please consider including this into the code base.
The fix on Bugzilla is slightly updated compared to
what I sent before, and works around another potential
deadlock.
We're using this fixed version for our commercial product,
and it's included in the Eclipse bundles at
http://rxtx.qbang.org/eclipse/
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Oberhuber, Martin
> Sent: Thursday, September 20, 2007 3:11 PM
> To: Trent Jarvi; taj at www.linux.org.uk; tjarvi at mathworks.com;
> rxtx at qbang.org
> Cc: Stieber, Uwe; Gutschelhofer, Martin; Scharf, Michael
> Subject: Deadlock in RXTX 2.1-7
>
> Hello,
>
> We have run into a deadlock with RXTX, see attached thread dump.
> this is critical for our commercial application picking up RXTX,
> and it might be critical for others as well.
>
> The problem occurs when multiple threads (parts of the application)
> try to open a CommPort at the same time - especially in the following
> situation:
> * Client 1 opens COM1
> * Client 2 tries to open with a wait time of e.g. 5 sec
> - PortOwnership notification is sent
> - Client 2 waits 5 sec to own port
> * If Client 3 tries an open() during these 5 sec it will deadlock.
>
> Here is the problematic Code, from CommPortIdentifier:
>
> public synchronized CommPort open(String TheOwner, int i)
> throws gnu.io.PortInUseException
> {
> if(debug)
> System.out.println("CommPortIdentifier:open("+TheOwner
> + ", " +i+")");
> if (Available == false)
> {
> synchronized (Sync)
> {
>
>
> fireOwnershipEvent(CommPortOwnershipListener.PORT_OWNERSHIP_RE
> QUESTED);
> try
> {
> wait(i);
> }
> catch ( InterruptedException e )
> {
> Thread.currentThread().interrupt();
> }
> }
> }
>
>
> And here is what happens:
> * Thread 1 does open() and locks "this",
> then it locks "Sync",
> then it releases the lock on "this" because going into wait()
>
> * While Thread 1 is waiting, thread 2 now locks "this",
> but it cannot continue locking "Sync" because it is still
> owned by Thread 2. So it keeps locking "this" forever
>
> * Therefore, Thread 1 cannot return from the wait()
>
> Holding two locks is very problematic here, and I think that holding
> the global "synchronized(Sync)" should be avoided. That lock is for
> protecting the list of CommPorts; but here, we are dealing
> with parties
> interested in one specific CommPort only so the given
> CommPortIdentifier
> we are dealing with should not be affected. Or was the original
> Intent to ensure that nobody can call getPortIdentifiers() while
> Negotiation between the port owners is going on?
>
> In general, the whole concept of re-initializing RXTX in the
> getPortIdentifiers() Method is very problematic, because
> 1.) it creates new instances of CommPortIdentifier; therefore,
> a "notify" against a given CommPortIdentifier may not wake
> up other threads waiting on a different CommPortIdentifier
> object that's been instanciated for the same port. This
> might be the reason for the comment
> /* this tosses null pointer?? */
> In internalClosePort().
> 2.) Anybody is free to call getPortIdentifiers() at any
> time. Couldn't re-initializing RXTX break any data
> transmissions that others are currently having?
>
> I've been trying to come up with a fix, but I don't think I
> know enough about RXTX to understand how to better update the
> List of known ports in getPortIdentifiers() without having
> to re-initialize everything. So, my fix seems to be more of
> a workaround, although it should address the most burning
> issues of deadlock.
>
> Find attached the new version of CommPortIdentifier that
> I have come up with. Please review and let me know what
> You think! I think that a real fix needs to get the list of
> CommPort names out of the RXTXDriver without re-initializing
> Everything, but I'd like to get your comments.
>
> Thanks,
> --
> Martin Oberhuber
> Wind River Systems, Inc.
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
>
>
From Martin.Oberhuber at windriver.com Wed Oct 24 03:35:03 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:35:03 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C6B5@ism-mail03.corp.ad.wrs.com>
Hello Trent,
thanks for your efforts - but it doesn't run on my box.
Looks like you built for SPARC64 but I need SPARC32 ?
java.lang.UnsatisfiedLinkError:
/folk/mober/RSETest/sol-3.3.1/eclipse/plugins/gnu.io.rxtx.solaris.sparc_
2.1.7.3_v20071015/os/solaris/sparc/librxtxSerial.so: ld.so.1: eclipse:
fatal:
/folk/mober/RSETest/sol-3.3.1/eclipse/plugins/gnu.io.rxtx.solaris.sparc_
2.1.7.3_v20071015/os/solaris/sparc/librxtxSerial.so: wrong ELF class:
ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver
And actually, I was not looking for a build with -g but
rather for a build with macros
DEBUG_VERBOSE
ENTER
LEAVE
or whatever else makes sense for logging enabled...
in SerialImp.c, I found the macros mentioned though
you might know better what logging makes sense
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Wednesday, October 24, 2007 1:08 AM
> To: Oberhuber, Martin
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] NoSuchPortException in
> getPortIdentifier() on Solaris
>
> I built an Ad Hoc version for sol10 with -g for you and put it in the
> ToyBox.
>
> http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/spa
> rc-sun-solaris2.10-debug
>
> r2 was a second build so its all just 2.1-7.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:05:45 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:05:45 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C70B@ism-mail03.corp.ad.wrs.com>
Hi Trent,
I found a Java fix which works most of the time:
in getPortIdentifier(), do not re-initialize RXTX
all the time but only when it is necessary.
I uploaded a full description, patch and updated
.java file to
http://bugzilla.qbang.org/show_bug.cgi?id=48
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Wednesday, October 24, 2007 1:08 AM
> To: Oberhuber, Martin
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] NoSuchPortException in
> getPortIdentifier() on Solaris
>
> On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
>
> > Hello,
> >
> > I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> > Terminal in Eclipse.
> >
> > On initial startup of my application, /dev/term/b is always
> > detected. But when I call getPortIdentifier(), the nested
> > getPortIdentifiers() does not detect it any more. It seems
> > that testRead() fails when RXTX is being re-initialized.
> >
> > It fails not always, but approximately 8 times out of 10 tries.
> >
> > It looks like the code is broken due to the fix in
> > CommPortIdentifier which was added for
> > http://bugzilla.qbang.org/show_bug.cgi?id=48
> >
> > Has anybody seen this before, or can give any advice?
> >
> > Unfortunately, I currently don't have a compile
> > environment available on Solaris such that I could
> > try a debug version to see what's causing the port
> > detection to fail in native code. Does anybody have
> > a Solaris debug version available?
> >
>
> Hi Martin,
>
> I built an Ad Hoc version for sol10 with -g for you and put it in the
> ToyBox.
>
> http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/spa
> rc-sun-solaris2.10-debug
>
> r2 was a second build so its all just 2.1-7.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:08:03 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:08:03 +0200
Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port
In-Reply-To: <460801A4097E3D4CA04CC64EE6485848020CB5CC@ism-mail03.corp.ad.wrs.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com>
Hi Greg and others,
I think that the issue is actually fixed by the updates I've submitted
for CommPortIdentifier recently.
With these fixes, it is no longer necessary to get a fresh
CommPortIdentifier.
The problem was, that RXTX had re-initialized its CommPortIdentifier
list
too often, thus losing the context info; that was a problem for other
applications
as well (sharing access to a com port; deadlocks).
All my fixes are included in the patch on
http://bugzilla.qbang.org/show_bug.cgi?id=48
More explanations, and an older interim version of my patches are on
http://bugzilla.qbang.org/show_bug.cgi?id=83
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On
Behalf Of Oberhuber, Martin
Sent: Thursday, June 28, 2007 1:23 PM
To: greg.johnson at esrf.fr
Cc: RXTX Developers and Users; ruskin at pwlinda.mt.umist.ac.uk
Subject: Re: [Rxtx] PortInUseException - Cannot close and reopen
serial port
Hi Greg,
Many many thanks!
Getting a fresh CommPortIdentifier helped indeed.
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: Greg Johnson
[mailto:greg.johnson at manchester.ac.uk]
Sent: Wednesday, June 27, 2007 5:50 PM
To: Oberhuber, Martin
Cc: RXTX Developers and Users;
ruskin at pwlinda.mt.umist.ac.uk
Subject: Re: [Rxtx] PortInUseException - Cannot close
and reopen serial port
Hello Martin,
We found that we had to get a fresh CommPortIdentifier
each time - reusing the previous one, even though the port had been
closed, caused this to barf.
while (true) {
portId=CommPortIdentifier.getPortIdentifier(pName);
Thread.sleep(2000); // or else USB dongles barf
serialport = (SerialPort) portId.open("MyApp",100);
// do something interesting
serialport.close();
}
Previously, we just tried to do
serialport = (SerialPort) portId.open("MyApp,100);
or
SerialPort serialport2 = ...
a second time, but that gave the so-called
PortInUseException.
We're now limping along. Still struggling with
USB-dongles - seems to need a full 2s after insertion to reliably be
able to open the serial port.
This was a problem on OSX and WinXPSP2 both. We
downloaded the "2.1-8" (which reports itself as 2.1-7) from CSV - it
helped on the OSX side as it stopped flooding the console with
irrelevant locking warnings. Other than that, we saw no change in
behaviour.
Cheers,
greg
------------------------------------------------------------------------
-
Greg Johnson
Research Fellow at University of Manchester
Scientific Collaborator at ESRF - European Synchrotron
greg.johnson at esrf.fr
greg.johnson at ieee.org
+33 (0)4 76 88 28 37
On 27 Jun 2007, at 17:35, Oberhuber, Martin wrote:
Hello,
did anybody find a solution for the issue on
Windows, where after
port.close() the port cannot be opened
immediately but throws
a PortInUseException?
There were Reports that it took 30 seconds
before the port got
actually free again, did anybody dig any deeper
and find the
real issue?
This is about rxtx-2.1-7r2 on Windows XP SP2.
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: rxtx-bounces at qbang.org
[mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson
Sent: Wednesday, March 28, 2007 10:43 PM
To: rxtx at qbang.org
Cc: ruskin at pwlinda.mt.umist.ac.uk
Subject: [Rxtx] Cannot close and reopen
serial port
Dear all,
It appears I cannot close a port
properly:
SerialPort serialport =
portid.open("myprog",100);
// do some stuff, all works fine
serialport.close(); // all seems fine
but...
SerialPort sp2 =
portid.open("myprog",100);
throws PortInUseException.
And when I dig into the rxtx code, I
find in CommPort.java, in close():
CommPortIdentifier cp =
CommPortIdentifier.getPortIdentifier(this);
(line 64 or there abouts)
but this throws a NoSuchPortException
which is caught but ignored (line 74ish).
Can anyone suggest how this could
happen: a port that was valid, opened, and used, throws a NSPE when it
comes to closing it? I'm pulling my (remaining) hair out over this one!
Cheers,
greg
PS And thanks for RXTX - it's great to
have!
PPS (21.-7. winxp/osx both, java 1.5)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071024/ea1ddbfa/attachment-0005.html
From Martin.Oberhuber at windriver.com Wed Oct 24 04:09:16 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:09:16 +0200
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C716@ism-mail03.corp.ad.wrs.com>
Hi Trent and Will,
All of my changes are actually in CommPortIdentifier.java only.
The most recent version is attached to
http://bugzilla.qbang.org/show_bug.cgi?id=48
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Trent Jarvi
> Sent: Wednesday, October 24, 2007 1:12 AM
> To: Will Tatam
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] Release date for 2.2
>
> On Tue, 23 Oct 2007, Will Tatam wrote:
>
> > Before everything went tits up with the server there was talk about
> > preparing for a 2.2 release. Is there a timescale for this
> and is there
> > a document somewhere as to what changes this will contain ?
> >
> >
>
> Hi Will,
>
> So far, I've been doing the best I can just to pull rxtx out
> of a pile of
> inodes.
>
> We can start looking at a new release now. The first thing I
> want to do
> is go back ane encorperate the changes Martin has been
> working on. I'll
> have a few minor changes also. This is a good time to get
> the release
> out.
>
> There isn't a list of changes right now. What we could do is
> have Martin
> post his changes to the list again and start there. Or I can
> dig though
> my email and find them if he does not have them handy.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:17:11 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:17:11 +0200
Subject: [Rxtx] virtual serial port
In-Reply-To: <1183556787.10682.6.camel@alvin>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C72F@ism-mail03.corp.ad.wrs.com>
Hi Joshua,
I think it's undocumented, but if you look at the
code in RXTXCommDriver.java you'll see that there
are several options to manually specify ports
which RXTX does not detect automatically.
One of them is this:
System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/myPort");
it also takes a list of ports, separated by
path.separator
Note that when you manually specify the ports, it
will not even try to scan ports itself any more.
So scanned ports need to be added to the System
Property.
Hope this helps,
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Joshua Chambers
> Sent: Wednesday, July 04, 2007 3:46 PM
> To: rxtx at qbang.org
> Subject: [Rxtx] virtual serial port
>
> Hello!
>
> Okay, I am trying to write a cross-platform application that
> talks to a
> custom little micro-controller box. This box uses a virtual serial
> port, which happens to have nice support under linux. When
> you plug it
> in, it creates a serial port at /dev/ttyACM0 which I can
> connect to and
> talk to with a regular serial port terminal.
>
> I've also tried this in windows, and with the proper .inf file it uses
> usbser.sys and works fine, I can talk with it. I've had different
> unsuccessful behavior from this library on each platform so far.
>
> Under linux, it seems to be unable to see the port. when I try to do
> CommPortIdentifier.getPortIdentifier("/dev/ttyACM0") I get a
> NoSuchPortException and when I enumerate the ports, I get only
> one, /dev/ttyS0.
>
> Is this any reason I shouldn't be able to point this thing to my
> functioning virtual serial port?
>
> In windows, the port IS listed in the enumeration, but when I try to
> open it, I get a PortInUseException, however when I query to find out
> who the owner is, I get null.
>
> Any help is so greatly appreciated! Thank you!
> Joshua
>
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From netbeans at gatworks.com Wed Oct 24 04:34:22 2007
From: netbeans at gatworks.com (U. George)
Date: Wed, 24 Oct 2007 06:34:22 -0400
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
Message-ID: <471F1FAE.1010407@gatworks.com>
> Re-sending due to mailing list issues
>
> Hi all,
>
> I have uploaded an exact description of the issue, and
>
I think issues will again appear when you realize that serial (usb)
devices can disappear and reappear from the initial scan ( even with
different device names ) .
At startup, there was only a ttyUSB0. But later ttyUSB0 disappears, and
ttyUSB1 appears. This happens on linux when one un-plugs the USB device
while its in the open() state, and reinserts the usb device back. The
kernel now gives hard failures to the ioctls BUT wont release resources
until close() for ttyUSB0, Since you plugged the USB device back in, the
kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
ttyUSB0 is closed, that device (ttyUSB0) will also disappear from /dev (
as it is now officially called ttyUSB1 ) .
From Martin.Oberhuber at windriver.com Wed Oct 24 08:04:24 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 16:04:24 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <471F1FAE.1010407@gatworks.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C8C4@ism-mail03.corp.ad.wrs.com>
Hello George,
note that we are talking about
CommPortIdentifier.getPortIdentifier(String portName)
where User asks for a specific portName.
If we already have an identifier for that name, just use it.
If device has been unplugged, error will happen when user
tries to use that identifier (wherease before my patch,
getPortIdentifier would return null).
When user asks for a portName that we have not seen before,
it will still rescan with my patch.
My patch did not change behavior of getPortIdentifiers().
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of U. George
> Sent: Wednesday, October 24, 2007 12:34 PM
> To: rxtx at qbang.org
> Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
>
> > Re-sending due to mailing list issues
> >
> > Hi all,
> >
> > I have uploaded an exact description of the issue, and
> >
> I think issues will again appear when you realize that serial (usb)
> devices can disappear and reappear from the initial scan ( even with
> different device names ) .
> At startup, there was only a ttyUSB0. But later ttyUSB0
> disappears, and
> ttyUSB1 appears. This happens on linux when one un-plugs the
> USB device
> while its in the open() state, and reinserts the usb device back. The
> kernel now gives hard failures to the ioctls BUT wont release
> resources
> until close() for ttyUSB0, Since you plugged the USB device
> back in, the
> kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
>
> Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
> ttyUSB0 is closed, that device (ttyUSB0) will also disappear
> from /dev (
> as it is now officially called ttyUSB1 ) .
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From tjarvi at qbang.org Wed Oct 24 15:36:21 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Wed, 24 Oct 2007 15:36:21 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <471FA070.5000400@mobilebox.pl>
References: <471FA070.5000400@mobilebox.pl>
Message-ID:
On Wed, 24 Oct 2007, Leszek Gawron wrote:
> Hello,
> as the user list seems inactive you are my last hope to resolve the problem.
> I've had some serious issues with javax comm API so I finally decided to
> switch to RXTX. I keep getting these:
>
>> ERROR 2007-10-24 10:20.10:375 [MessagePoller] smsPoller: error occurred
>> while iterating messages, restarting after delay
>> java.lang.RuntimeException: unable to execute command
>> at com.mobilebox.modem.Modem.execute(Modem.java:330)
>> at com.mobilebox.modem.at.sms.ListMessages.run(ListMessages.java:40)
>> at com.mobilebox.modem.Modem.execute(Modem.java:328)
>> at
>> com.mobilebox.mail2sms.service.impl.SmsService.iterateMessages(SmsService.java:62)
>> at
>> com.mobilebox.mail2sms.service.MessagePoller.run(MessagePoller.java:97)
>> at java.lang.Thread.run(Unknown Source)
>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
>> at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
>> at sun.nio.cs.StreamDecoder.read(Unknown Source)
>> at java.io.InputStreamReader.read(Unknown Source)
>> at java.io.BufferedReader.fill(Unknown Source)
>> at java.io.BufferedReader.read(Unknown Source)
>> at com.mobilebox.modem.Modem.readStopAware(Modem.java:173)
>> at com.mobilebox.modem.Modem.readSingleLine(Modem.java:155)
>> at com.mobilebox.modem.Modem.readSingleLine(Modem.java:150)
>> at com.mobilebox.modem.Modem.readBasicResponse(Modem.java:135)
>> at
>> com.mobilebox.modem.at.SimpleAtCommand.run(SimpleAtCommand.java:41)
>> at com.mobilebox.modem.Modem.execute(Modem.java:328)
>> ... 5 more
>
>
> The code is dead simple:
>
>> private synchronized String readStopAware( String stopFor ) throws
>> IOException {
>> StringBuffer buffer = new StringBuffer();
>> int ch = -1;
>>
>> int bufferPos = 0;
>> boolean stopForMatches = true;
>>
>> while ( true ) {
>> ch = in.read();
>>
>> if ( ch == -1 )
>> break;
>>
>> if ( ch == '\r' )
>> continue;
>>
>> if ( ch == '\n' )
>> break;
>>
>> buffer.append( (char) ch );
>>
>> // if single character differs - no need to check
>> further
>> if ( stopFor != null && stopForMatches ) {
>> if ( stopFor.charAt( bufferPos ) ==
>> buffer.charAt( bufferPos ) ) {
>> bufferPos++;
>> if ( bufferPos == stopFor.length() )
>> break;
>> } else
>> stopForMatches = false;
>> }
>> }
>> if ( ch == -1 && buffer.length() == 0 )
>> return null;
>>
>> return buffer.toString();
>> }
>
> The connection is established like this:
>> public synchronized void connect() {
>> logger.info( "opening comm port: " + getPort() );
>> CommPortIdentifier portId = getPortIdentifier();
>>
>> try {
>> serialPort = (SerialPort) portId.open(
>> getPortOwnerName(),
>> PORT_TIMEOUT
>> );
>> } catch ( PortInUseException e ) {
>> throw new RuntimeException( "port " + getPort() + "
>> currently owned by " + e.currentOwner
>> + ", unable to
>> proceed" );
>> }
>>
>> try {
>> serialPort.setSerialPortParams( getSpeed(),
>> SerialPort.DATABITS_8,
>> SerialPort.STOPBITS_1,
>> SerialPort.PARITY_NONE
>> );
>> } catch ( UnsupportedCommOperationException e ) {
>> throw new RuntimeException( "unable to set port
>> parameters", e );
>> }
>>
>> serialPort.disableReceiveTimeout();
>>
>> try {
>> this.in = new BufferedReader( new InputStreamReader(
>> serialPort.getInputStream() ) );
>> this.out = new BufferedWriter( new
>> OutputStreamWriter( serialPort.getOutputStream() ) );
>> } catch ( IOException e ) {
>> disconnect();
>> throw new RuntimeException( "unable to connect to
>> modem", e );
>> }
>>
>> logger.info( "done." );
>> }
>
>
> This happens while connecting to a GSM modem over serial line. Even better:
> this happens even if there is no device connected to RS232 port.
>
> I've tried:
> JDK 1.6, JDK 1.5
>
> Windows XP SP1, Windows Server 2003
>
> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
>
> None of the combinations of these seem to work properly.
>
Hi Leszek
The rxtx mail-list just started up again this week.
I suspect that you need to alter the Timeout and Threshold to match your
expected behavior. I thought timeout and threshold behaved but they may
not be handling some error condition properly.
Perhaps Try the following?
SerialPort.enableReceiveTimeout(0);
SerialPort.enableReceiveThreshold(1);
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Wed Oct 24 16:50:21 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Wed, 24 Oct 2007 16:50:21 -0600 (MDT)
Subject: [Rxtx] [Action Required?] The list is going live again.
In-Reply-To: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
References: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
Message-ID:
On Sun, 21 Oct 2007, tjarvi at qbang.org wrote:
>
> The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
>
> http://mailman.qbang.org/mailman/options/rxtx
>
> If you enter your email address and hit the remind button, a password will be emailed to you.
>
> I'll try to wait a while before opening the gates. We have several emails pending.
>
For those of you that had problems changing your preferences on the
server, I've updated the server configuration and expect you should have
no problems changing them now. It was a security module setting.
Please let me know if you have any problems. It did work for me.
--
Trent Jarvi
tjarvi at qbang.org
From Martin.Oberhuber at windriver.com Thu Oct 25 04:30:10 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Thu, 25 Oct 2007 12:30:10 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C8C4@ism-mail03.corp.ad.wrs.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480358CFC2@ism-mail03.corp.ad.wrs.com>
PS
attached is a simplified version of the patch which only
addresses this particular issue.
Here it's more clear to see what I actually changed.
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Oberhuber, Martin
> Sent: Wednesday, October 24, 2007 4:04 PM
> To: U. George; rxtx at qbang.org
> Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
>
> Hello George,
>
> note that we are talking about
> CommPortIdentifier.getPortIdentifier(String portName)
> where User asks for a specific portName.
>
> If we already have an identifier for that name, just use it.
> If device has been unplugged, error will happen when user
> tries to use that identifier (wherease before my patch,
> getPortIdentifier would return null).
>
> When user asks for a portName that we have not seen before,
> it will still rescan with my patch.
>
> My patch did not change behavior of getPortIdentifiers().
>
> Cheers,
> --
> Martin Oberhuber
> Wind River Systems, Inc.
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
>
> > -----Original Message-----
> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> > On Behalf Of U. George
> > Sent: Wednesday, October 24, 2007 12:34 PM
> > To: rxtx at qbang.org
> > Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
> >
> > > Re-sending due to mailing list issues
> > >
> > > Hi all,
> > >
> > > I have uploaded an exact description of the issue, and
> > >
> > I think issues will again appear when you realize that serial (usb)
> > devices can disappear and reappear from the initial scan (
> even with
> > different device names ) .
> > At startup, there was only a ttyUSB0. But later ttyUSB0
> > disappears, and
> > ttyUSB1 appears. This happens on linux when one un-plugs the
> > USB device
> > while its in the open() state, and reinserts the usb device
> back. The
> > kernel now gives hard failures to the ioctls BUT wont release
> > resources
> > until close() for ttyUSB0, Since you plugged the USB device
> > back in, the
> > kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
> >
> > Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
> > ttyUSB0 is closed, that device (ttyUSB0) will also disappear
> > from /dev (
> > as it is now officially called ttyUSB1 ) .
> > _______________________________________________
> > Rxtx mailing list
> > Rxtx at qbang.org
> > http://mailman.qbang.org/mailman/listinfo/rxtx
> >
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rxtx_48_noSuchPort.diff.txt
Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071025/bb61b7ab/attachment-0004.txt
From sebastien.jean at inrialpes.fr Thu Oct 25 12:51:10 2007
From: sebastien.jean at inrialpes.fr (=?ISO-8859-1?Q?S=E9bastien_Jean?=)
Date: Thu, 25 Oct 2007 20:51:10 +0200
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID: <4CF602F8-2376-464E-8E9A-C7205E36E2D4@inrialpes.fr>
hi arnab,
As Java "int" type is related to a 32 bits signed value, you can
easily set he baudrate to 115200 if you want.
You might have made confusion with the "short" Java type, that is 16
bits long.
S?bastien.
Le 31 juil. 07 ? 17:27, arnab bhaumik a ?crit :
> hi all,
>
> i am wondering how to get this speed (115.2kbps) with rxtx????
>
>
>
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so
> it cant take 115200!!!!!!!!!!!!!!
>
> please help me
> arnab
>
> --
> Arnab Bhaumik / VU2BPW
>
> Proprietor and Design Engineer,
>
> AB Telecomm.
> Rajchandrapur, PO- Ghoshpara(Bally).
> Howrah, West Bengal.
> Pin - 711227
> Ph- (033) 26716307
> Mob- 9433927150
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
From netbeans at gatworks.com Thu Oct 25 15:04:27 2007
From: netbeans at gatworks.com (U. George)
Date: Thu, 25 Oct 2007 17:04:27 -0400
Subject: [Rxtx] rxtx problem
In-Reply-To:
References: <471FA070.5000400@mobilebox.pl>
Message-ID: <472104DB.9070106@gatworks.com>
What it seems to be saying is that there is an error in how rxtx.read()
is suppose to behave.
sun.nio.cs.StreamDecoder.readBytes() thinks that there should be some
bytes returned, or, i suppose, an I/O exception is/should be thrown when
there are no bytes to be returned.
this also needs to be resolved so that readBytes() can handle timeout
exceptions, presuming that rxtx throws that exception in the case of
your device.
>>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
From netbeans at gatworks.com Thu Oct 25 17:26:33 2007
From: netbeans at gatworks.com (U. George)
Date: Thu, 25 Oct 2007 19:26:33 -0400
Subject: [Rxtx] rxtx problem
In-Reply-To: <472104DB.9070106@gatworks.com>
References: <471FA070.5000400@mobilebox.pl>
<472104DB.9070106@gatworks.com>
Message-ID: <47212629.6080304@gatworks.com>
U. George wrote:
> What it seems to be saying is that there is an error in how rxtx.read()
> is suppose to behave.
> sun.nio.cs.StreamDecoder.readBytes() thinks that there should be some
> bytes returned, or, i suppose, an I/O exception is/should be thrown when
> there are no bytes to be returned.
>
> this also needs to be resolved so that readBytes() can handle timeout
> exceptions, presuming that rxtx throws that exception in the case of
> your device.
>
>>>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>>>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
this is the relevant code segment from openjava sources:
try {
> // Read from the input stream, and then update the buffer
> .................
> int n = in.read(bb.array(), bb.arrayOffset() + pos, rem);
> .................
> if (n == 0)
> throw new IOException("Underlying input stream returned zero bytes");
> ..................
> }
> } finally {
> .............
> }
I suppose I have to ask where did the timeout exception go?
From tjarvi at qbang.org Thu Oct 25 17:36:15 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Thu, 25 Oct 2007 17:36:15 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <47212629.6080304@gatworks.com>
References: <471FA070.5000400@mobilebox.pl>
<472104DB.9070106@gatworks.com> <47212629.6080304@gatworks.com>
Message-ID:
On Thu, 25 Oct 2007, U. George wrote:
> U. George wrote:
>> What it seems to be saying is that there is an error in how rxtx.read() is
>> suppose to behave.
>> sun.nio.cs.StreamDecoder.readBytes() thinks that there should be some bytes
>> returned, or, i suppose, an I/O exception is/should be thrown when there
>> are no bytes to be returned.
>>
>> this also needs to be resolved so that readBytes() can handle timeout
>> exceptions, presuming that rxtx throws that exception in the case of your
>> device.
>>
>>>>> Caused by: java.io.IOException: Underlying input stream returned zero
>>>>> bytes
>>>>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
>
> this is the relevant code segment from openjava sources:
> try {
>> // Read from the input stream, and then update the buffer
>> .................
>> int n = in.read(bb.array(), bb.arrayOffset() + pos, rem);
>> .................
>> if (n == 0)
>> throw new IOException("Underlying input stream returned
>> zero bytes");
>> ..................
>> }
>> } finally {
>> .............
>> }
>
> I suppose I have to ask where did the timeout exception go?
>
Hmm
My first thought was I had made very sure the timeouts and thresholds
worked in rxtx. But disabletimeout was used so I wasnt sure if something
different may happen - does not appear so.
I can easily picture rxtx throwing an exception - even an inappropriate
one. But it would just timeout and return if there was a timeout enabled.
There must be an error condition that isn't handled well.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Thu Oct 25 18:22:24 2007
From: netbeans at gatworks.com (U. George)
Date: Thu, 25 Oct 2007 20:22:24 -0400
Subject: [Rxtx] rxtx problem
In-Reply-To:
References: <471FA070.5000400@mobilebox.pl>
Message-ID: <47213340.8090809@gatworks.com>
>>
>> This happens while connecting to a GSM modem over serial line. Even better:
>> this happens even if there is no device connected to RS232 port.
>>
>> I've tried:
>> JDK 1.6, JDK 1.5
>>
>> Windows XP SP1, Windows Server 2003
>>
>> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
OOps, this is a windoz issue ( i hope ). This leaves me out of any
further analysis - :-}
From tjarvi at qbang.org Thu Oct 25 19:04:29 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Thu, 25 Oct 2007 19:04:29 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <47213340.8090809@gatworks.com>
References: <471FA070.5000400@mobilebox.pl>
<47213340.8090809@gatworks.com>
Message-ID:
On Thu, 25 Oct 2007, U. George wrote:
>>>
>>> This happens while connecting to a GSM modem over serial line. Even better:
>>> this happens even if there is no device connected to RS232 port.
>>>
>>> I've tried:
>>> JDK 1.6, JDK 1.5
>>>
>>> Windows XP SP1, Windows Server 2003
>>>
>>> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
>
> OOps, this is a windoz issue ( i hope ). This leaves me out of any
> further analysis - :-}
Perhaps but RXTX just puts a wrapper around windows and treats it as
POSIX.
Thats probably important to remember when we revisit your patch :)
--
Trent Jarvi
tjarvi at qbang.org
From andy.reid at logicacmg.com Fri Oct 26 00:56:09 2007
From: andy.reid at logicacmg.com (Reid, Andy (Space & Defence))
Date: Fri, 26 Oct 2007 07:56:09 +0100
Subject: [Rxtx] Multiple ports
Message-ID:
Hi,
I have a problem in trying to open, write to and then close multiple
ports.
I have a java class for accessing and controlling my com port, if I
create several instances of the class for different com ports and use
the ports after I have opened and closed them several times I often get
problems trying to access one of them.
If I use javax.comm I don't get these problems so I'm trying to
understand if there's something I'm not doing when closing and then
re-opening a port.
I can post code snippets if that would help but I've resisted posting
the whole class for now.
Cheers
Andy
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071026/5b393f73/attachment-0002.html
From tjarvi at qbang.org Fri Oct 26 16:42:01 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Fri, 26 Oct 2007 16:42:01 -0600 (MDT)
Subject: [Rxtx] Multiple ports
In-Reply-To:
References:
Message-ID:
On Fri, 26 Oct 2007, Reid, Andy (Space & Defence) wrote:
> Hi,
>
> I have a problem in trying to open, write to and then close multiple
> ports.
> I have a java class for accessing and controlling my com port, if I
> create several instances of the class for different com ports and use
> the ports after I have opened and closed them several times I often get
> problems trying to access one of them.
> If I use javax.comm I don't get these problems so I'm trying to
> understand if there's something I'm not doing when closing and then
> re-opening a port.
>
> I can post code snippets if that would help but I've resisted posting
> the whole class for now.
>
Hi Andy
Do you have a simple application that reproduces the problem? We have had
a report of problems with 256 serial ports but I had no means of
reproducing it.
As I recall, Sun's CommAPI was limited to 4 ports so you may be onto
something.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sun Oct 21 11:38:45 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sun, 21 Oct 2007 11:38:45 -0600
Subject: [Rxtx] [Action Required?] The list is going live again.
Message-ID: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
http://mailman.qbang.org/mailman/options/rxtx
If you enter your email address and hit the remind button, a password will be emailed to you.
I'll try to wait a while before opening the gates. We have several emails pending.
--
Trent Jarvi
tjarvi at qbang.org
From lists2006.wayne at gmail.com Mon Oct 22 04:27:35 2007
From: lists2006.wayne at gmail.com (Wayne Gemmell)
Date: Mon, 22 Oct 2007 12:27:35 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
Message-ID: <200710221227.36046.wayne@flashmedia.co.za>
Hi All
I have a program the monitors USSD sessions using a wavecom modem. About 2% of
my transactions come back with funny characters in the first 10 or so
characters (I'm not monitoring it they are happening later.). This is
illustrated in the logging output below. I've added the receiving code below.
Has anyone seen similar results?
2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
(time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
private String readInput() {
int numBytes,count = 1;
StringBuffer sb = new StringBuffer();
byte [] readBuffer = new byte[50];
waitForInput=true;
while(waitForInput)
try {
Thread.sleep(count * 100);
count++;
if(count == 50) {
logger.error("Time out waiting for response");
return null;
}
while (inputStream.available() > 0) {
numBytes = inputStream.read(readBuffer);
if(numBytes<=1)
continue;
sb.append(new String(readBuffer)).substring(0,numBytes);
for(int i=0;i
public void serialEvent(SerialPortEvent event) {
// TODO Auto-generated method stub
switch (event.getEventType()) {
case SerialPortEvent.DATA_AVAILABLE:
waitForInput = false;
}
}
--
Regards
Wayne
From netbeans at gatworks.com Mon Oct 22 13:50:37 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 15:50:37 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <471CFF0D.4030601@gatworks.com>
Is it a USB modem? Or a real serial modem?
When serialUSB ( kernel module ) starts up, i usually get some funny
characters from the GPS receiver. After that it appears ok.
maybe a bit of rxtx debugging is in order.
BTW: those funny chars is '\0' or null, or a control-@ ( as i vaguely
remember )
Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2% of
> my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code below.
> Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
> tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new String(readBuffer)).substring(0,numBytes);
> for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From netbeans at gatworks.com Mon Oct 22 16:03:54 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 18:03:54 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <471CFF0D.4030601@gatworks.com>
References: <200710221227.36046.wayne@flashmedia.co.za>
<471CFF0D.4030601@gatworks.com>
Message-ID: <471D1E4A.4080601@gatworks.com>
Also, are u shure this works?
does not a new CharAt(i) get shifted down from the length of the string?
i like to do this in reverse ( for ( int i = sb.length-1; i > 0 ; i-- )
{ if(sb.charAt(i)==0) sb.deleteCharAt(i); }
just a thought :}
>> for(int i=0;i> if(sb.charAt(i)==0)
>> sb.deleteCharAt(i);
>> }
>>
From Martin.Oberhuber at windriver.com Tue Oct 23 10:57:46 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Tue, 23 Oct 2007 18:57:46 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Hello,
I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
Terminal in Eclipse.
On initial startup of my application, /dev/term/b is always
detected. But when I call getPortIdentifier(), the nested
getPortIdentifiers() does not detect it any more. It seems
that testRead() fails when RXTX is being re-initialized.
It fails not always, but approximately 8 times out of 10 tries.
It looks like the code is broken due to the fix in
CommPortIdentifier which was added for
http://bugzilla.qbang.org/show_bug.cgi?id=48
Has anybody seen this before, or can give any advice?
Unfortunately, I currently don't have a compile
environment available on Solaris such that I could
try a debug version to see what's causing the port
detection to fail in native code. Does anybody have
a Solaris debug version available?
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From will.tatam at red61.com Tue Oct 23 12:26:29 2007
From: will.tatam at red61.com (Will Tatam)
Date: Tue, 23 Oct 2007 19:26:29 +0100
Subject: [Rxtx] Release date for 2.2
Message-ID: <471E3CD5.4030605@red61.com>
Before everything went tits up with the server there was talk about
preparing for a 2.2 release. Is there a timescale for this and is there
a document somewhere as to what changes this will contain ?
--
Will Tatam
Systems Architect
Red Sixty One LTD
0845 867 2203 ext 103
From tjarvi at qbang.org Tue Oct 23 17:07:37 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:07:37 -0600 (MDT)
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Message-ID:
On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
> Hello,
>
> I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> Terminal in Eclipse.
>
> On initial startup of my application, /dev/term/b is always
> detected. But when I call getPortIdentifier(), the nested
> getPortIdentifiers() does not detect it any more. It seems
> that testRead() fails when RXTX is being re-initialized.
>
> It fails not always, but approximately 8 times out of 10 tries.
>
> It looks like the code is broken due to the fix in
> CommPortIdentifier which was added for
> http://bugzilla.qbang.org/show_bug.cgi?id=48
>
> Has anybody seen this before, or can give any advice?
>
> Unfortunately, I currently don't have a compile
> environment available on Solaris such that I could
> try a debug version to see what's causing the port
> detection to fail in native code. Does anybody have
> a Solaris debug version available?
>
Hi Martin,
I built an Ad Hoc version for sol10 with -g for you and put it in the
ToyBox.
http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/sparc-sun-solaris2.10-debug
r2 was a second build so its all just 2.1-7.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:12:09 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:12:09 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E3CD5.4030605@red61.com>
References: <471E3CD5.4030605@red61.com>
Message-ID:
On Tue, 23 Oct 2007, Will Tatam wrote:
> Before everything went tits up with the server there was talk about
> preparing for a 2.2 release. Is there a timescale for this and is there
> a document somewhere as to what changes this will contain ?
>
>
Hi Will,
So far, I've been doing the best I can just to pull rxtx out of a pile of
inodes.
We can start looking at a new release now. The first thing I want to do
is go back ane encorperate the changes Martin has been working on. I'll
have a few minor changes also. This is a good time to get the release
out.
There isn't a list of changes right now. What we could do is have Martin
post his changes to the list again and start there. Or I can dig though
my email and find them if he does not have them handy.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:57:40 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:57:40 -0600 (MDT)
Subject: [Rxtx] Wiki and Spambots
In-Reply-To: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
References: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
Message-ID:
On Tue, 17 Jul 2007, Andre-John Mas wrote:
> Hi,
>
> Looks like spambots are wrecking havoc on the Wiki. Had to correct:
>
> http://rxtx.qbang.org/wiki/index.php/Examples
> http://rxtx.qbang.org/wiki/index.php/
> Two_way_communcation_with_the_serial_port
>
> Any chance we can add a captcha for account creation?
>
Late but Done. We actually had spambots trying to write over each other.
I also locked the front page but left everything else editable by anyone
willing to create an account. The pages should be clean again.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 18:29:55 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:29:55 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
Message-ID: <471E9203.9010105@gatworks.com>
> There isn't a list of changes right now. What we could do is have Martin
> post his changes to the list again and start there. Or I can dig though
> my email and find them if he does not have them handy.
here is a diff of the changes I made to my local rxtx ,
gimme a shout when u get ready to review.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071023/66665b8a/attachment-0006.pl
From netbeans at gatworks.com Tue Oct 23 18:37:24 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:37:24 -0400
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID: <471E93C4.4020501@gatworks.com>
a
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so it
> cant take 115200!!!!!!!!!!!!!!
can u tell me why? int is approx +/- 2gig
From tod at todbot.com Tue Oct 23 18:41:29 2007
From: tod at todbot.com (Tod E. Kurt)
Date: Tue, 23 Oct 2007 17:41:29 -0700
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID:
In Java, ints go from -2147483648 to 2147483647, inclusive.
http://java.sun.com/docs/books/jls/third_edition/html/
typesValues.html#4.2.1
On Jul 31, 2007, at 8:27 a, arnab bhaumik wrote:
> hi all,
>
> i am wondering how to get this speed (115.2kbps) with rxtx????
>
>
>
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so
> it cant take 115200!!!!!!!!!!!!!!
>
> please help me
> arnab
>
> --
> Arnab Bhaumik / VU2BPW
>
> Proprietor and Design Engineer,
>
> AB Telecomm.
> Rajchandrapur, PO- Ghoshpara(Bally).
> Howrah, West Bengal.
> Pin - 711227
> Ph- (033) 26716307
> Mob- 9433927150
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Tue Oct 23 19:44:08 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 19:44:08 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E9203.9010105@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>> There isn't a list of changes right now. What we could do is have Martin
>> post his changes to the list again and start there. Or I can dig though my
>> email and find them if he does not have them handy.
>
> here is a diff of the changes I made to my local rxtx ,
> gimme a shout when u get ready to review.
>
Great stuff Uncle George,
I just looked through the diff for flag and discuss items. I'll look
again tomorrow night a little closer. Have you tried the code that
replaces ...
-#if defined(TIOCSERGETLSR)
int change;
if( !ioctl( fd, TIOCSERGETLSR, &change ) ) {
return(1);
}
-#endif /* TIOCSERGETLSR */
... with ...
+ return check_line_status_register_with_GETLSR( eis );
+
+ return check_line_status_register_without_GETLSR( eis );
... on a Solaris/*BSD machine? There is obviously the problem with
multiport serial cards that do not support the ioctl but on systems other
than Linux, there isn't a define for the TIOCSERGETLSR.
It could be that I'm just missing a detail by looking only at the diff.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 20:11:45 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 22:11:45 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID: <471EA9E1.7070707@gatworks.com>
> ... on a Solaris/*BSD machine? There is obviously the problem with
> multiport serial cards that do not support the ioctl but on systems
> other than Linux, there isn't a define for the TIOCSERGETLSR.
>
> It could be that I'm just missing a detail by looking only at the diff.
The issue was on (linux) systems that have TIOCSERGETLSR defined for an
ioctl, but the (USB) device driver itself may or may not have any code
for processing the TIOCSERGETLSR. So u have to support both as if
TIOCSERGETLSR does and does not exist - at run time.
So what happens on a sys that fully implements TIOCSERGETLSR? What
happens on a system that does not implement (define) TIOCSERGETLSR.
I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
appropriate, but I wont be able to test the issue with unplugging the
USB device, and rxtx spinning as a result.
From tjarvi at qbang.org Tue Oct 23 20:39:31 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 20:39:31 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471EA9E1.7070707@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
<471EA9E1.7070707@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>
>> ... on a Solaris/*BSD machine? There is obviously the problem with
>> multiport serial cards that do not support the ioctl but on systems other
>> than Linux, there isn't a define for the TIOCSERGETLSR.
>>
>> It could be that I'm just missing a detail by looking only at the diff.
>
> The issue was on (linux) systems that have TIOCSERGETLSR defined for an
> ioctl, but the (USB) device driver itself may or may not have any code for
> processing the TIOCSERGETLSR. So u have to support both as if TIOCSERGETLSR
> does and does not exist - at run time.
>
> So what happens on a sys that fully implements TIOCSERGETLSR? What happens on
> a system that does not implement (define) TIOCSERGETLSR.
>
> I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
> appropriate, but I wont be able to test the issue with unplugging the USB
> device, and rxtx spinning as a result.
>
Hmm OK.
I had not thought about USB/bluetooth dongles.
We should be able to do what you require and handle the systems that don't
implement the call. It will just take a bit more work. I'll look into it
more tomorrow.
Thanks George
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 22:21:12 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 22:21:12 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471EA9E1.7070707@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
<471EA9E1.7070707@gatworks.com>
Message-ID:
On Tue, 23 Oct 2007, U. George wrote:
>
>> ... on a Solaris/*BSD machine? There is obviously the problem with
>> multiport serial cards that do not support the ioctl but on systems other
>> than Linux, there isn't a define for the TIOCSERGETLSR.
>>
>> It could be that I'm just missing a detail by looking only at the diff.
>
> The issue was on (linux) systems that have TIOCSERGETLSR defined for an
> ioctl, but the (USB) device driver itself may or may not have any code for
> processing the TIOCSERGETLSR. So u have to support both as if TIOCSERGETLSR
> does and does not exist - at run time.
>
> So what happens on a sys that fully implements TIOCSERGETLSR? What happens on
> a system that does not implement (define) TIOCSERGETLSR.
>
> I suppose if TIOCSERGETLSR is not defined, then the old #ifdef would be
> appropriate, but I wont be able to test the issue with unplugging the USB
> device, and rxtx spinning as a result.
>
As a quick followup, this is easy enough to try on Linux. Just undef
TIOCSERGETLSR after the includes and build. When it blows up, thats what
will happen on the traditional systems.
--
Trent Jarvi
tjarvi at qbang.org
From wayne at flashmedia.co.za Wed Oct 24 01:04:06 2007
From: wayne at flashmedia.co.za (Wayne Gemmell)
Date: Wed, 24 Oct 2007 09:04:06 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <200710240904.06544.wayne@flashmedia.co.za>
Hi all
Sorry for the re-post but did this post get through on Monday? I see theres
plenty email today.
Thanks
Wayne
On Monday 22 October 2007 12:27:35 Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2%
> of my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code
> below. Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,
>s tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new
> String(readBuffer)).substring(0,numBytes); for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From Martin.Oberhuber at windriver.com Wed Oct 24 03:17:04 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:17:04 +0200
Subject: [Rxtx] RXTX cannot connect a specific board without HW flow control
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C671@ism-mail03.corp.ad.wrs.com>
Re-sending due to mailing list issue:
Hi RXTX community,
we have an odd problem here: there is one specific board that
RXTX connot connect to at 9600 baud / 8n1 / no flow-control:
I see absolutely no output from the remote.
When I enable flow control, it connects fine.
HyperTerminal connets fine both with and without flow control.
Other boards of the same making (i.e. same electronics, different
physical hardware) connect ok both with and without flow control.
Has anybody seen such behavior before?
Any ideas what could be causing this?
It seems that RXTX is less fault tolerant than HyperTerminal
when it comes to flow control...
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From Martin.Oberhuber at windriver.com Wed Oct 24 03:18:21 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:18:21 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
Re-sending due to mailing list issues
Hi all,
I have uploaded an exact description of the issue, and
a fix which I think is good, to RXTX Bugzilla:
http://bugzilla.qbang.org/show_bug.cgi?id=83
Please consider including this into the code base.
The fix on Bugzilla is slightly updated compared to
what I sent before, and works around another potential
deadlock.
We're using this fixed version for our commercial product,
and it's included in the Eclipse bundles at
http://rxtx.qbang.org/eclipse/
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Oberhuber, Martin
> Sent: Thursday, September 20, 2007 3:11 PM
> To: Trent Jarvi; taj at www.linux.org.uk; tjarvi at mathworks.com;
> rxtx at qbang.org
> Cc: Stieber, Uwe; Gutschelhofer, Martin; Scharf, Michael
> Subject: Deadlock in RXTX 2.1-7
>
> Hello,
>
> We have run into a deadlock with RXTX, see attached thread dump.
> this is critical for our commercial application picking up RXTX,
> and it might be critical for others as well.
>
> The problem occurs when multiple threads (parts of the application)
> try to open a CommPort at the same time - especially in the following
> situation:
> * Client 1 opens COM1
> * Client 2 tries to open with a wait time of e.g. 5 sec
> - PortOwnership notification is sent
> - Client 2 waits 5 sec to own port
> * If Client 3 tries an open() during these 5 sec it will deadlock.
>
> Here is the problematic Code, from CommPortIdentifier:
>
> public synchronized CommPort open(String TheOwner, int i)
> throws gnu.io.PortInUseException
> {
> if(debug)
> System.out.println("CommPortIdentifier:open("+TheOwner
> + ", " +i+")");
> if (Available == false)
> {
> synchronized (Sync)
> {
>
>
> fireOwnershipEvent(CommPortOwnershipListener.PORT_OWNERSHIP_RE
> QUESTED);
> try
> {
> wait(i);
> }
> catch ( InterruptedException e )
> {
> Thread.currentThread().interrupt();
> }
> }
> }
>
>
> And here is what happens:
> * Thread 1 does open() and locks "this",
> then it locks "Sync",
> then it releases the lock on "this" because going into wait()
>
> * While Thread 1 is waiting, thread 2 now locks "this",
> but it cannot continue locking "Sync" because it is still
> owned by Thread 2. So it keeps locking "this" forever
>
> * Therefore, Thread 1 cannot return from the wait()
>
> Holding two locks is very problematic here, and I think that holding
> the global "synchronized(Sync)" should be avoided. That lock is for
> protecting the list of CommPorts; but here, we are dealing
> with parties
> interested in one specific CommPort only so the given
> CommPortIdentifier
> we are dealing with should not be affected. Or was the original
> Intent to ensure that nobody can call getPortIdentifiers() while
> Negotiation between the port owners is going on?
>
> In general, the whole concept of re-initializing RXTX in the
> getPortIdentifiers() Method is very problematic, because
> 1.) it creates new instances of CommPortIdentifier; therefore,
> a "notify" against a given CommPortIdentifier may not wake
> up other threads waiting on a different CommPortIdentifier
> object that's been instanciated for the same port. This
> might be the reason for the comment
> /* this tosses null pointer?? */
> In internalClosePort().
> 2.) Anybody is free to call getPortIdentifiers() at any
> time. Couldn't re-initializing RXTX break any data
> transmissions that others are currently having?
>
> I've been trying to come up with a fix, but I don't think I
> know enough about RXTX to understand how to better update the
> List of known ports in getPortIdentifiers() without having
> to re-initialize everything. So, my fix seems to be more of
> a workaround, although it should address the most burning
> issues of deadlock.
>
> Find attached the new version of CommPortIdentifier that
> I have come up with. Please review and let me know what
> You think! I think that a real fix needs to get the list of
> CommPort names out of the RXTXDriver without re-initializing
> Everything, but I'd like to get your comments.
>
> Thanks,
> --
> Martin Oberhuber
> Wind River Systems, Inc.
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
>
>
From Martin.Oberhuber at windriver.com Wed Oct 24 03:35:03 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 11:35:03 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C6B5@ism-mail03.corp.ad.wrs.com>
Hello Trent,
thanks for your efforts - but it doesn't run on my box.
Looks like you built for SPARC64 but I need SPARC32 ?
java.lang.UnsatisfiedLinkError:
/folk/mober/RSETest/sol-3.3.1/eclipse/plugins/gnu.io.rxtx.solaris.sparc_
2.1.7.3_v20071015/os/solaris/sparc/librxtxSerial.so: ld.so.1: eclipse:
fatal:
/folk/mober/RSETest/sol-3.3.1/eclipse/plugins/gnu.io.rxtx.solaris.sparc_
2.1.7.3_v20071015/os/solaris/sparc/librxtxSerial.so: wrong ELF class:
ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver
And actually, I was not looking for a build with -g but
rather for a build with macros
DEBUG_VERBOSE
ENTER
LEAVE
or whatever else makes sense for logging enabled...
in SerialImp.c, I found the macros mentioned though
you might know better what logging makes sense
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Wednesday, October 24, 2007 1:08 AM
> To: Oberhuber, Martin
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] NoSuchPortException in
> getPortIdentifier() on Solaris
>
> I built an Ad Hoc version for sol10 with -g for you and put it in the
> ToyBox.
>
> http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/spa
> rc-sun-solaris2.10-debug
>
> r2 was a second build so its all just 2.1-7.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:05:45 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:05:45 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C70B@ism-mail03.corp.ad.wrs.com>
Hi Trent,
I found a Java fix which works most of the time:
in getPortIdentifier(), do not re-initialize RXTX
all the time but only when it is necessary.
I uploaded a full description, patch and updated
.java file to
http://bugzilla.qbang.org/show_bug.cgi?id=48
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Wednesday, October 24, 2007 1:08 AM
> To: Oberhuber, Martin
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] NoSuchPortException in
> getPortIdentifier() on Solaris
>
> On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
>
> > Hello,
> >
> > I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> > Terminal in Eclipse.
> >
> > On initial startup of my application, /dev/term/b is always
> > detected. But when I call getPortIdentifier(), the nested
> > getPortIdentifiers() does not detect it any more. It seems
> > that testRead() fails when RXTX is being re-initialized.
> >
> > It fails not always, but approximately 8 times out of 10 tries.
> >
> > It looks like the code is broken due to the fix in
> > CommPortIdentifier which was added for
> > http://bugzilla.qbang.org/show_bug.cgi?id=48
> >
> > Has anybody seen this before, or can give any advice?
> >
> > Unfortunately, I currently don't have a compile
> > environment available on Solaris such that I could
> > try a debug version to see what's causing the port
> > detection to fail in native code. Does anybody have
> > a Solaris debug version available?
> >
>
> Hi Martin,
>
> I built an Ad Hoc version for sol10 with -g for you and put it in the
> ToyBox.
>
> http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/spa
> rc-sun-solaris2.10-debug
>
> r2 was a second build so its all just 2.1-7.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:08:03 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:08:03 +0200
Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port
In-Reply-To: <460801A4097E3D4CA04CC64EE6485848020CB5CC@ism-mail03.corp.ad.wrs.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com>
Hi Greg and others,
I think that the issue is actually fixed by the updates I've submitted
for CommPortIdentifier recently.
With these fixes, it is no longer necessary to get a fresh
CommPortIdentifier.
The problem was, that RXTX had re-initialized its CommPortIdentifier
list
too often, thus losing the context info; that was a problem for other
applications
as well (sharing access to a com port; deadlocks).
All my fixes are included in the patch on
http://bugzilla.qbang.org/show_bug.cgi?id=48
More explanations, and an older interim version of my patches are on
http://bugzilla.qbang.org/show_bug.cgi?id=83
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On
Behalf Of Oberhuber, Martin
Sent: Thursday, June 28, 2007 1:23 PM
To: greg.johnson at esrf.fr
Cc: RXTX Developers and Users; ruskin at pwlinda.mt.umist.ac.uk
Subject: Re: [Rxtx] PortInUseException - Cannot close and reopen
serial port
Hi Greg,
Many many thanks!
Getting a fresh CommPortIdentifier helped indeed.
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: Greg Johnson
[mailto:greg.johnson at manchester.ac.uk]
Sent: Wednesday, June 27, 2007 5:50 PM
To: Oberhuber, Martin
Cc: RXTX Developers and Users;
ruskin at pwlinda.mt.umist.ac.uk
Subject: Re: [Rxtx] PortInUseException - Cannot close
and reopen serial port
Hello Martin,
We found that we had to get a fresh CommPortIdentifier
each time - reusing the previous one, even though the port had been
closed, caused this to barf.
while (true) {
portId=CommPortIdentifier.getPortIdentifier(pName);
Thread.sleep(2000); // or else USB dongles barf
serialport = (SerialPort) portId.open("MyApp",100);
// do something interesting
serialport.close();
}
Previously, we just tried to do
serialport = (SerialPort) portId.open("MyApp,100);
or
SerialPort serialport2 = ...
a second time, but that gave the so-called
PortInUseException.
We're now limping along. Still struggling with
USB-dongles - seems to need a full 2s after insertion to reliably be
able to open the serial port.
This was a problem on OSX and WinXPSP2 both. We
downloaded the "2.1-8" (which reports itself as 2.1-7) from CSV - it
helped on the OSX side as it stopped flooding the console with
irrelevant locking warnings. Other than that, we saw no change in
behaviour.
Cheers,
greg
------------------------------------------------------------------------
-
Greg Johnson
Research Fellow at University of Manchester
Scientific Collaborator at ESRF - European Synchrotron
greg.johnson at esrf.fr
greg.johnson at ieee.org
+33 (0)4 76 88 28 37
On 27 Jun 2007, at 17:35, Oberhuber, Martin wrote:
Hello,
did anybody find a solution for the issue on
Windows, where after
port.close() the port cannot be opened
immediately but throws
a PortInUseException?
There were Reports that it took 30 seconds
before the port got
actually free again, did anybody dig any deeper
and find the
real issue?
This is about rxtx-2.1-7r2 on Windows XP SP2.
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
________________________________
From: rxtx-bounces at qbang.org
[mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson
Sent: Wednesday, March 28, 2007 10:43 PM
To: rxtx at qbang.org
Cc: ruskin at pwlinda.mt.umist.ac.uk
Subject: [Rxtx] Cannot close and reopen
serial port
Dear all,
It appears I cannot close a port
properly:
SerialPort serialport =
portid.open("myprog",100);
// do some stuff, all works fine
serialport.close(); // all seems fine
but...
SerialPort sp2 =
portid.open("myprog",100);
throws PortInUseException.
And when I dig into the rxtx code, I
find in CommPort.java, in close():
CommPortIdentifier cp =
CommPortIdentifier.getPortIdentifier(this);
(line 64 or there abouts)
but this throws a NoSuchPortException
which is caught but ignored (line 74ish).
Can anyone suggest how this could
happen: a port that was valid, opened, and used, throws a NSPE when it
comes to closing it? I'm pulling my (remaining) hair out over this one!
Cheers,
greg
PS And thanks for RXTX - it's great to
have!
PPS (21.-7. winxp/osx both, java 1.5)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071024/ea1ddbfa/attachment-0006.html
From Martin.Oberhuber at windriver.com Wed Oct 24 04:09:16 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:09:16 +0200
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C716@ism-mail03.corp.ad.wrs.com>
Hi Trent and Will,
All of my changes are actually in CommPortIdentifier.java only.
The most recent version is attached to
http://bugzilla.qbang.org/show_bug.cgi?id=48
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Trent Jarvi
> Sent: Wednesday, October 24, 2007 1:12 AM
> To: Will Tatam
> Cc: rxtx at qbang.org
> Subject: Re: [Rxtx] Release date for 2.2
>
> On Tue, 23 Oct 2007, Will Tatam wrote:
>
> > Before everything went tits up with the server there was talk about
> > preparing for a 2.2 release. Is there a timescale for this
> and is there
> > a document somewhere as to what changes this will contain ?
> >
> >
>
> Hi Will,
>
> So far, I've been doing the best I can just to pull rxtx out
> of a pile of
> inodes.
>
> We can start looking at a new release now. The first thing I
> want to do
> is go back ane encorperate the changes Martin has been
> working on. I'll
> have a few minor changes also. This is a good time to get
> the release
> out.
>
> There isn't a list of changes right now. What we could do is
> have Martin
> post his changes to the list again and start there. Or I can
> dig though
> my email and find them if he does not have them handy.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From Martin.Oberhuber at windriver.com Wed Oct 24 04:17:11 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 12:17:11 +0200
Subject: [Rxtx] virtual serial port
In-Reply-To: <1183556787.10682.6.camel@alvin>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C72F@ism-mail03.corp.ad.wrs.com>
Hi Joshua,
I think it's undocumented, but if you look at the
code in RXTXCommDriver.java you'll see that there
are several options to manually specify ports
which RXTX does not detect automatically.
One of them is this:
System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/myPort");
it also takes a list of ports, separated by
path.separator
Note that when you manually specify the ports, it
will not even try to scan ports itself any more.
So scanned ports need to be added to the System
Property.
Hope this helps,
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Joshua Chambers
> Sent: Wednesday, July 04, 2007 3:46 PM
> To: rxtx at qbang.org
> Subject: [Rxtx] virtual serial port
>
> Hello!
>
> Okay, I am trying to write a cross-platform application that
> talks to a
> custom little micro-controller box. This box uses a virtual serial
> port, which happens to have nice support under linux. When
> you plug it
> in, it creates a serial port at /dev/ttyACM0 which I can
> connect to and
> talk to with a regular serial port terminal.
>
> I've also tried this in windows, and with the proper .inf file it uses
> usbser.sys and works fine, I can talk with it. I've had different
> unsuccessful behavior from this library on each platform so far.
>
> Under linux, it seems to be unable to see the port. when I try to do
> CommPortIdentifier.getPortIdentifier("/dev/ttyACM0") I get a
> NoSuchPortException and when I enumerate the ports, I get only
> one, /dev/ttyS0.
>
> Is this any reason I shouldn't be able to point this thing to my
> functioning virtual serial port?
>
> In windows, the port IS listed in the enumeration, but when I try to
> open it, I get a PortInUseException, however when I query to find out
> who the owner is, I get null.
>
> Any help is so greatly appreciated! Thank you!
> Joshua
>
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From netbeans at gatworks.com Wed Oct 24 04:34:22 2007
From: netbeans at gatworks.com (U. George)
Date: Wed, 24 Oct 2007 06:34:22 -0400
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C674@ism-mail03.corp.ad.wrs.com>
Message-ID: <471F1FAE.1010407@gatworks.com>
> Re-sending due to mailing list issues
>
> Hi all,
>
> I have uploaded an exact description of the issue, and
>
I think issues will again appear when you realize that serial (usb)
devices can disappear and reappear from the initial scan ( even with
different device names ) .
At startup, there was only a ttyUSB0. But later ttyUSB0 disappears, and
ttyUSB1 appears. This happens on linux when one un-plugs the USB device
while its in the open() state, and reinserts the usb device back. The
kernel now gives hard failures to the ioctls BUT wont release resources
until close() for ttyUSB0, Since you plugged the USB device back in, the
kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
ttyUSB0 is closed, that device (ttyUSB0) will also disappear from /dev (
as it is now officially called ttyUSB1 ) .
From Martin.Oberhuber at windriver.com Wed Oct 24 08:04:24 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Wed, 24 Oct 2007 16:04:24 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <471F1FAE.1010407@gatworks.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C8C4@ism-mail03.corp.ad.wrs.com>
Hello George,
note that we are talking about
CommPortIdentifier.getPortIdentifier(String portName)
where User asks for a specific portName.
If we already have an identifier for that name, just use it.
If device has been unplugged, error will happen when user
tries to use that identifier (wherease before my patch,
getPortIdentifier would return null).
When user asks for a portName that we have not seen before,
it will still rescan with my patch.
My patch did not change behavior of getPortIdentifiers().
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of U. George
> Sent: Wednesday, October 24, 2007 12:34 PM
> To: rxtx at qbang.org
> Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
>
> > Re-sending due to mailing list issues
> >
> > Hi all,
> >
> > I have uploaded an exact description of the issue, and
> >
> I think issues will again appear when you realize that serial (usb)
> devices can disappear and reappear from the initial scan ( even with
> different device names ) .
> At startup, there was only a ttyUSB0. But later ttyUSB0
> disappears, and
> ttyUSB1 appears. This happens on linux when one un-plugs the
> USB device
> while its in the open() state, and reinserts the usb device back. The
> kernel now gives hard failures to the ioctls BUT wont release
> resources
> until close() for ttyUSB0, Since you plugged the USB device
> back in, the
> kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
>
> Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
> ttyUSB0 is closed, that device (ttyUSB0) will also disappear
> from /dev (
> as it is now officially called ttyUSB1 ) .
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
From tjarvi at qbang.org Wed Oct 24 15:36:21 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Wed, 24 Oct 2007 15:36:21 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <471FA070.5000400@mobilebox.pl>
References: <471FA070.5000400@mobilebox.pl>
Message-ID:
On Wed, 24 Oct 2007, Leszek Gawron wrote:
> Hello,
> as the user list seems inactive you are my last hope to resolve the problem.
> I've had some serious issues with javax comm API so I finally decided to
> switch to RXTX. I keep getting these:
>
>> ERROR 2007-10-24 10:20.10:375 [MessagePoller] smsPoller: error occurred
>> while iterating messages, restarting after delay
>> java.lang.RuntimeException: unable to execute command
>> at com.mobilebox.modem.Modem.execute(Modem.java:330)
>> at com.mobilebox.modem.at.sms.ListMessages.run(ListMessages.java:40)
>> at com.mobilebox.modem.Modem.execute(Modem.java:328)
>> at
>> com.mobilebox.mail2sms.service.impl.SmsService.iterateMessages(SmsService.java:62)
>> at
>> com.mobilebox.mail2sms.service.MessagePoller.run(MessagePoller.java:97)
>> at java.lang.Thread.run(Unknown Source)
>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
>> at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
>> at sun.nio.cs.StreamDecoder.read(Unknown Source)
>> at java.io.InputStreamReader.read(Unknown Source)
>> at java.io.BufferedReader.fill(Unknown Source)
>> at java.io.BufferedReader.read(Unknown Source)
>> at com.mobilebox.modem.Modem.readStopAware(Modem.java:173)
>> at com.mobilebox.modem.Modem.readSingleLine(Modem.java:155)
>> at com.mobilebox.modem.Modem.readSingleLine(Modem.java:150)
>> at com.mobilebox.modem.Modem.readBasicResponse(Modem.java:135)
>> at
>> com.mobilebox.modem.at.SimpleAtCommand.run(SimpleAtCommand.java:41)
>> at com.mobilebox.modem.Modem.execute(Modem.java:328)
>> ... 5 more
>
>
> The code is dead simple:
>
>> private synchronized String readStopAware( String stopFor ) throws
>> IOException {
>> StringBuffer buffer = new StringBuffer();
>> int ch = -1;
>>
>> int bufferPos = 0;
>> boolean stopForMatches = true;
>>
>> while ( true ) {
>> ch = in.read();
>>
>> if ( ch == -1 )
>> break;
>>
>> if ( ch == '\r' )
>> continue;
>>
>> if ( ch == '\n' )
>> break;
>>
>> buffer.append( (char) ch );
>>
>> // if single character differs - no need to check
>> further
>> if ( stopFor != null && stopForMatches ) {
>> if ( stopFor.charAt( bufferPos ) ==
>> buffer.charAt( bufferPos ) ) {
>> bufferPos++;
>> if ( bufferPos == stopFor.length() )
>> break;
>> } else
>> stopForMatches = false;
>> }
>> }
>> if ( ch == -1 && buffer.length() == 0 )
>> return null;
>>
>> return buffer.toString();
>> }
>
> The connection is established like this:
>> public synchronized void connect() {
>> logger.info( "opening comm port: " + getPort() );
>> CommPortIdentifier portId = getPortIdentifier();
>>
>> try {
>> serialPort = (SerialPort) portId.open(
>> getPortOwnerName(),
>> PORT_TIMEOUT
>> );
>> } catch ( PortInUseException e ) {
>> throw new RuntimeException( "port " + getPort() + "
>> currently owned by " + e.currentOwner
>> + ", unable to
>> proceed" );
>> }
>>
>> try {
>> serialPort.setSerialPortParams( getSpeed(),
>> SerialPort.DATABITS_8,
>> SerialPort.STOPBITS_1,
>> SerialPort.PARITY_NONE
>> );
>> } catch ( UnsupportedCommOperationException e ) {
>> throw new RuntimeException( "unable to set port
>> parameters", e );
>> }
>>
>> serialPort.disableReceiveTimeout();
>>
>> try {
>> this.in = new BufferedReader( new InputStreamReader(
>> serialPort.getInputStream() ) );
>> this.out = new BufferedWriter( new
>> OutputStreamWriter( serialPort.getOutputStream() ) );
>> } catch ( IOException e ) {
>> disconnect();
>> throw new RuntimeException( "unable to connect to
>> modem", e );
>> }
>>
>> logger.info( "done." );
>> }
>
>
> This happens while connecting to a GSM modem over serial line. Even better:
> this happens even if there is no device connected to RS232 port.
>
> I've tried:
> JDK 1.6, JDK 1.5
>
> Windows XP SP1, Windows Server 2003
>
> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
>
> None of the combinations of these seem to work properly.
>
Hi Leszek
The rxtx mail-list just started up again this week.
I suspect that you need to alter the Timeout and Threshold to match your
expected behavior. I thought timeout and threshold behaved but they may
not be handling some error condition properly.
Perhaps Try the following?
SerialPort.enableReceiveTimeout(0);
SerialPort.enableReceiveThreshold(1);
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Wed Oct 24 16:50:21 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Wed, 24 Oct 2007 16:50:21 -0600 (MDT)
Subject: [Rxtx] [Action Required?] The list is going live again.
In-Reply-To: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
References: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
Message-ID:
On Sun, 21 Oct 2007, tjarvi at qbang.org wrote:
>
> The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
>
> http://mailman.qbang.org/mailman/options/rxtx
>
> If you enter your email address and hit the remind button, a password will be emailed to you.
>
> I'll try to wait a while before opening the gates. We have several emails pending.
>
For those of you that had problems changing your preferences on the
server, I've updated the server configuration and expect you should have
no problems changing them now. It was a security module setting.
Please let me know if you have any problems. It did work for me.
--
Trent Jarvi
tjarvi at qbang.org
From Martin.Oberhuber at windriver.com Thu Oct 25 04:30:10 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Thu, 25 Oct 2007 12:30:10 +0200
Subject: [Rxtx] Deadlock in RXTX 2.1-7
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C8C4@ism-mail03.corp.ad.wrs.com>
Message-ID: <460801A4097E3D4CA04CC64EE64858480358CFC2@ism-mail03.corp.ad.wrs.com>
PS
attached is a simplified version of the patch which only
addresses this particular issue.
Here it's more clear to see what I actually changed.
Cheers,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> On Behalf Of Oberhuber, Martin
> Sent: Wednesday, October 24, 2007 4:04 PM
> To: U. George; rxtx at qbang.org
> Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
>
> Hello George,
>
> note that we are talking about
> CommPortIdentifier.getPortIdentifier(String portName)
> where User asks for a specific portName.
>
> If we already have an identifier for that name, just use it.
> If device has been unplugged, error will happen when user
> tries to use that identifier (wherease before my patch,
> getPortIdentifier would return null).
>
> When user asks for a portName that we have not seen before,
> it will still rescan with my patch.
>
> My patch did not change behavior of getPortIdentifiers().
>
> Cheers,
> --
> Martin Oberhuber
> Wind River Systems, Inc.
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
>
> > -----Original Message-----
> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org]
> > On Behalf Of U. George
> > Sent: Wednesday, October 24, 2007 12:34 PM
> > To: rxtx at qbang.org
> > Subject: Re: [Rxtx] Deadlock in RXTX 2.1-7
> >
> > > Re-sending due to mailing list issues
> > >
> > > Hi all,
> > >
> > > I have uploaded an exact description of the issue, and
> > >
> > I think issues will again appear when you realize that serial (usb)
> > devices can disappear and reappear from the initial scan (
> even with
> > different device names ) .
> > At startup, there was only a ttyUSB0. But later ttyUSB0
> > disappears, and
> > ttyUSB1 appears. This happens on linux when one un-plugs the
> > USB device
> > while its in the open() state, and reinserts the usb device
> back. The
> > kernel now gives hard failures to the ioctls BUT wont release
> > resources
> > until close() for ttyUSB0, Since you plugged the USB device
> > back in, the
> > kernel creates a new ttyUSB ( ttyUSB1 ) with kernel resources.
> >
> > Without a rescan, rxtx would not be able to see ttyUSB1. As soon as
> > ttyUSB0 is closed, that device (ttyUSB0) will also disappear
> > from /dev (
> > as it is now officially called ttyUSB1 ) .
> > _______________________________________________
> > Rxtx mailing list
> > Rxtx at qbang.org
> > http://mailman.qbang.org/mailman/listinfo/rxtx
> >
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rxtx_48_noSuchPort.diff.txt
Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071025/bb61b7ab/attachment-0005.txt
From sebastien.jean at inrialpes.fr Thu Oct 25 12:51:10 2007
From: sebastien.jean at inrialpes.fr (=?ISO-8859-1?Q?S=E9bastien_Jean?=)
Date: Thu, 25 Oct 2007 20:51:10 +0200
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID: <4CF602F8-2376-464E-8E9A-C7205E36E2D4@inrialpes.fr>
hi arnab,
As Java "int" type is related to a 32 bits signed value, you can
easily set he baudrate to 115200 if you want.
You might have made confusion with the "short" Java type, that is 16
bits long.
S?bastien.
Le 31 juil. 07 ? 17:27, arnab bhaumik a ?crit :
> hi all,
>
> i am wondering how to get this speed (115.2kbps) with rxtx????
>
>
>
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so
> it cant take 115200!!!!!!!!!!!!!!
>
> please help me
> arnab
>
> --
> Arnab Bhaumik / VU2BPW
>
> Proprietor and Design Engineer,
>
> AB Telecomm.
> Rajchandrapur, PO- Ghoshpara(Bally).
> Howrah, West Bengal.
> Pin - 711227
> Ph- (033) 26716307
> Mob- 9433927150
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
From netbeans at gatworks.com Thu Oct 25 15:04:27 2007
From: netbeans at gatworks.com (U. George)
Date: Thu, 25 Oct 2007 17:04:27 -0400
Subject: [Rxtx] rxtx problem
In-Reply-To:
References: <471FA070.5000400@mobilebox.pl>
Message-ID: <472104DB.9070106@gatworks.com>
What it seems to be saying is that there is an error in how rxtx.read()
is suppose to behave.
sun.nio.cs.StreamDecoder.readBytes() thinks that there should be some
bytes returned, or, i suppose, an I/O exception is/should be thrown when
there are no bytes to be returned.
this also needs to be resolved so that readBytes() can handle timeout
exceptions, presuming that rxtx throws that exception in the case of
your device.
>>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
From netbeans at gatworks.com Thu Oct 25 17:26:33 2007
From: netbeans at gatworks.com (U. George)
Date: Thu, 25 Oct 2007 19:26:33 -0400
Subject: [Rxtx] rxtx problem
In-Reply-To: <472104DB.9070106@gatworks.com>
References: <471FA070.5000400@mobilebox.pl>
<472104DB.9070106@gatworks.com>
Message-ID: <47212629.6080304@gatworks.com>
U. George wrote:
> What it seems to be saying is that there is an error in how rxtx.read()
> is suppose to behave.
> sun.nio.cs.StreamDecoder.readBytes() thinks that there should be some
> bytes returned, or, i suppose, an I/O exception is/should be thrown when
> there are no bytes to be returned.
>
> this also needs to be resolved so that readBytes() can handle timeout
> exceptions, presuming that rxtx throws that exception in the case of
> your device.
>
>>>> Caused by: java.io.IOException: Underlying input stream returned zero bytes
>>>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
this is the relevant code segment from openjava sources:
try {
> // Read from the input stream, and then update the buffer
> .................
> int n = in.read(bb.array(), bb.arrayOffset() + pos, rem);
> .................
> if (n == 0)
> throw new IOException("Underlying input stream returned zero bytes");
> ..................
> }
> } finally {
> .............
> }
I suppose I have to ask where did the timeout exception go?
From tjarvi at qbang.org Thu Oct 25 17:36:15 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Thu, 25 Oct 2007 17:36:15 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <47212629.6080304@gatworks.com>
References: <471FA070.5000400@mobilebox.pl>
<472104DB.9070106@gatworks.com> <47212629.6080304@gatworks.com>
Message-ID:
On Thu, 25 Oct 2007, U. George wrote:
> U. George wrote:
>> What it seems to be saying is that there is an error in how rxtx.read() is
>> suppose to behave.
>> sun.nio.cs.StreamDecoder.readBytes() thinks that there should be some bytes
>> returned, or, i suppose, an I/O exception is/should be thrown when there
>> are no bytes to be returned.
>>
>> this also needs to be resolved so that readBytes() can handle timeout
>> exceptions, presuming that rxtx throws that exception in the case of your
>> device.
>>
>>>>> Caused by: java.io.IOException: Underlying input stream returned zero
>>>>> bytes
>>>>> at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
>
> this is the relevant code segment from openjava sources:
> try {
>> // Read from the input stream, and then update the buffer
>> .................
>> int n = in.read(bb.array(), bb.arrayOffset() + pos, rem);
>> .................
>> if (n == 0)
>> throw new IOException("Underlying input stream returned
>> zero bytes");
>> ..................
>> }
>> } finally {
>> .............
>> }
>
> I suppose I have to ask where did the timeout exception go?
>
Hmm
My first thought was I had made very sure the timeouts and thresholds
worked in rxtx. But disabletimeout was used so I wasnt sure if something
different may happen - does not appear so.
I can easily picture rxtx throwing an exception - even an inappropriate
one. But it would just timeout and return if there was a timeout enabled.
There must be an error condition that isn't handled well.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Thu Oct 25 18:22:24 2007
From: netbeans at gatworks.com (U. George)
Date: Thu, 25 Oct 2007 20:22:24 -0400
Subject: [Rxtx] rxtx problem
In-Reply-To:
References: <471FA070.5000400@mobilebox.pl>
Message-ID: <47213340.8090809@gatworks.com>
>>
>> This happens while connecting to a GSM modem over serial line. Even better:
>> this happens even if there is no device connected to RS232 port.
>>
>> I've tried:
>> JDK 1.6, JDK 1.5
>>
>> Windows XP SP1, Windows Server 2003
>>
>> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
OOps, this is a windoz issue ( i hope ). This leaves me out of any
further analysis - :-}
From tjarvi at qbang.org Thu Oct 25 19:04:29 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Thu, 25 Oct 2007 19:04:29 -0600 (MDT)
Subject: [Rxtx] rxtx problem
In-Reply-To: <47213340.8090809@gatworks.com>
References: <471FA070.5000400@mobilebox.pl>
<47213340.8090809@gatworks.com>
Message-ID:
On Thu, 25 Oct 2007, U. George wrote:
>>>
>>> This happens while connecting to a GSM modem over serial line. Even better:
>>> this happens even if there is no device connected to RS232 port.
>>>
>>> I've tried:
>>> JDK 1.6, JDK 1.5
>>>
>>> Windows XP SP1, Windows Server 2003
>>>
>>> rxtx 2.1.7r2, rxtx 2.0 (via javacomm interfaces)
>
> OOps, this is a windoz issue ( i hope ). This leaves me out of any
> further analysis - :-}
Perhaps but RXTX just puts a wrapper around windows and treats it as
POSIX.
Thats probably important to remember when we revisit your patch :)
--
Trent Jarvi
tjarvi at qbang.org
From andy.reid at logicacmg.com Fri Oct 26 00:56:09 2007
From: andy.reid at logicacmg.com (Reid, Andy (Space & Defence))
Date: Fri, 26 Oct 2007 07:56:09 +0100
Subject: [Rxtx] Multiple ports
Message-ID:
Hi,
I have a problem in trying to open, write to and then close multiple
ports.
I have a java class for accessing and controlling my com port, if I
create several instances of the class for different com ports and use
the ports after I have opened and closed them several times I often get
problems trying to access one of them.
If I use javax.comm I don't get these problems so I'm trying to
understand if there's something I'm not doing when closing and then
re-opening a port.
I can post code snippets if that would help but I've resisted posting
the whole class for now.
Cheers
Andy
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071026/5b393f73/attachment-0003.html
From tjarvi at qbang.org Fri Oct 26 16:42:01 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Fri, 26 Oct 2007 16:42:01 -0600 (MDT)
Subject: [Rxtx] Multiple ports
In-Reply-To:
References:
Message-ID:
On Fri, 26 Oct 2007, Reid, Andy (Space & Defence) wrote:
> Hi,
>
> I have a problem in trying to open, write to and then close multiple
> ports.
> I have a java class for accessing and controlling my com port, if I
> create several instances of the class for different com ports and use
> the ports after I have opened and closed them several times I often get
> problems trying to access one of them.
> If I use javax.comm I don't get these problems so I'm trying to
> understand if there's something I'm not doing when closing and then
> re-opening a port.
>
> I can post code snippets if that would help but I've resisted posting
> the whole class for now.
>
Hi Andy
Do you have a simple application that reproduces the problem? We have had
a report of problems with 256 serial ports but I had no means of
reproducing it.
As I recall, Sun's CommAPI was limited to 4 ports so you may be onto
something.
--
Trent Jarvi
tjarvi at qbang.org
From chebart at tiscali.it Mon Oct 29 03:59:32 2007
From: chebart at tiscali.it (chebart at tiscali.it)
Date: Mon, 29 Oct 2007 10:59:32 +0100 (CET)
Subject: [Rxtx] Problem with 5 phone mobile
Message-ID: <32031381.1193651972915.JavaMail.root@ps13>
Hi. My application use 5 phone mobile simultaneously. If i use 3 phone
it's ok, but when i used 5 phone, sometimes all communication
crashed... There are a problem when I read form one cell and,
simultaneously, i open other port!!!
You know this problem!?!?
thanks
__________________________________________________________
Tiscali Tandem Free (Telefono+Adsl). Attiva entro il 1? novembre: chiami in tutta Italia e navighi SENZA LIMITI A SOLI 9,95 ? AL MESE FINO A PRIMAVERA 2008! http://abbonati.tiscali.it/adsl/prodotti/dem/tc/tandemfree_tel_cc/
From tjarvi at qbang.org Sat Oct 13 11:04:12 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sat, 13 Oct 2007 11:04:12 -0600
Subject: [Rxtx] test
Message-ID: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
From dhooker at e2eft.com Mon Oct 15 07:12:25 2007
From: dhooker at e2eft.com (David Hooker)
Date: Mon, 15 Oct 2007 08:12:25 -0500
Subject: [Rxtx] test
In-Reply-To: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
References: <200710131704.l9DH4Cel009722@rxtx.qbang.org>
Message-ID: <005201c80f2d$08453f40$18cfbdc0$@com>
Test Pong.
-----Original Message-----
From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of
tjarvi at qbang.org
Sent: Saturday, October 13, 2007 12:04 PM
To: rxtx at qbang.org
Subject: [Rxtx] test
_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Mon Oct 15 19:15:04 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Mon, 15 Oct 2007 19:15:04 -0600
Subject: [Rxtx] test
Message-ID: <200710160115.l9G1F4Tb030139@rxtx.qbang.org>
>> Test Pong.
While the mail-list is obviously up, I'll be adding everyones names back in from before the hardware failure this week.
A post will follow.
--
From tjarvi at qbang.org Sun Oct 21 11:38:45 2007
From: tjarvi at qbang.org (tjarvi at qbang.org)
Date: Sun, 21 Oct 2007 11:38:45 -0600
Subject: [Rxtx] [Action Required?] The list is going live again.
Message-ID: <200710211738.l9LHcjTs019371@rxtx.qbang.org>
The rxtx mail-list has been repopulated with subscriber information. If you want to receive digest emails, please update your subscription information.
http://mailman.qbang.org/mailman/options/rxtx
If you enter your email address and hit the remind button, a password will be emailed to you.
I'll try to wait a while before opening the gates. We have several emails pending.
--
Trent Jarvi
tjarvi at qbang.org
From lists2006.wayne at gmail.com Mon Oct 22 04:27:35 2007
From: lists2006.wayne at gmail.com (Wayne Gemmell)
Date: Mon, 22 Oct 2007 12:27:35 +0200
Subject: [Rxtx] Wierd input when reading from a GSM modem
Message-ID: <200710221227.36046.wayne@flashmedia.co.za>
Hi All
I have a program the monitors USSD sessions using a wavecom modem. About 2% of
my transactions come back with funny characters in the first 10 or so
characters (I'm not monitoring it they are happening later.). This is
illustrated in the logging output below. I've added the receiving code below.
Has anyone seen similar results?
2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
+CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
2. Data Bundle ",15
2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
(time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
private String readInput() {
int numBytes,count = 1;
StringBuffer sb = new StringBuffer();
byte [] readBuffer = new byte[50];
waitForInput=true;
while(waitForInput)
try {
Thread.sleep(count * 100);
count++;
if(count == 50) {
logger.error("Time out waiting for response");
return null;
}
while (inputStream.available() > 0) {
numBytes = inputStream.read(readBuffer);
if(numBytes<=1)
continue;
sb.append(new String(readBuffer)).substring(0,numBytes);
for(int i=0;i
public void serialEvent(SerialPortEvent event) {
// TODO Auto-generated method stub
switch (event.getEventType()) {
case SerialPortEvent.DATA_AVAILABLE:
waitForInput = false;
}
}
--
Regards
Wayne
From netbeans at gatworks.com Mon Oct 22 13:50:37 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 15:50:37 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <200710221227.36046.wayne@flashmedia.co.za>
References: <200710221227.36046.wayne@flashmedia.co.za>
Message-ID: <471CFF0D.4030601@gatworks.com>
Is it a USB modem? Or a real serial modem?
When serialUSB ( kernel module ) starts up, i usually get some funny
characters from the GPS receiver. After that it appears ok.
maybe a bit of rxtx debugging is in order.
BTW: those funny chars is '\0' or null, or a control-@ ( as i vaguely
remember )
Wayne Gemmell wrote:
> Hi All
>
> I have a program the monitors USSD sessions using a wavecom modem. About 2% of
> my transactions come back with funny characters in the first 10 or so
> characters (I'm not monitoring it they are happening later.). This is
> illustrated in the logging output below. I've added the receiving code below.
> Has anyone seen similar results?
>
>
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Read :
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 INFO main BaseStation - Reply:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main BaseStation - Processing input:
> +CUSD:^@^@^@^@^@^@^@^@^@^@ 1,"1. SMS Bundle
> 2. Data Bundle ",15
> 2007-10-21 06:17:12,170 DEBUG main DBQuery - INSERT INTO vodamon
> (time_stamp,issuccessful,ussd_error_code,max_menu,menu_depth,time_interval,s
> tring_dialled,network) VALUES (NOW(),false,5,2,1,60,'*111#',1);
>
>
>
> private String readInput() {
> int numBytes,count = 1;
> StringBuffer sb = new StringBuffer();
> byte [] readBuffer = new byte[50];
>
> waitForInput=true;
>
> while(waitForInput)
> try {
> Thread.sleep(count * 100);
> count++;
> if(count == 50) {
> logger.error("Time out waiting for response");
> return null;
> }
>
> while (inputStream.available() > 0) {
> numBytes = inputStream.read(readBuffer);
> if(numBytes<=1)
> continue;
> sb.append(new String(readBuffer)).substring(0,numBytes);
> for(int i=0;i if(sb.charAt(i)==0)
> sb.deleteCharAt(i);
> }
>
> Thread.sleep(100);
> }
> } catch (InterruptedException ex) {
> logger.fatal("ouch!!!",ex);
> } catch (IOException ex) {
> logger.fatal("ouch!!!",ex);
> }
> logger.debug("Read :"+new String(sb).trim());
> return new String(sb).trim();
> }
>
> public void serialEvent(SerialPortEvent event) {
> // TODO Auto-generated method stub
> switch (event.getEventType()) {
>
> case SerialPortEvent.DATA_AVAILABLE:
> waitForInput = false;
> }
> }
From netbeans at gatworks.com Mon Oct 22 16:03:54 2007
From: netbeans at gatworks.com (U. George)
Date: Mon, 22 Oct 2007 18:03:54 -0400
Subject: [Rxtx] Wierd input when reading from a GSM modem
In-Reply-To: <471CFF0D.4030601@gatworks.com>
References: <200710221227.36046.wayne@flashmedia.co.za>
<471CFF0D.4030601@gatworks.com>
Message-ID: <471D1E4A.4080601@gatworks.com>
Also, are u shure this works?
does not a new CharAt(i) get shifted down from the length of the string?
i like to do this in reverse ( for ( int i = sb.length-1; i > 0 ; i-- )
{ if(sb.charAt(i)==0) sb.deleteCharAt(i); }
just a thought :}
>> for(int i=0;i> if(sb.charAt(i)==0)
>> sb.deleteCharAt(i);
>> }
>>
From Martin.Oberhuber at windriver.com Tue Oct 23 10:57:46 2007
From: Martin.Oberhuber at windriver.com (Oberhuber, Martin)
Date: Tue, 23 Oct 2007 18:57:46 +0200
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
Message-ID: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Hello,
I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
Terminal in Eclipse.
On initial startup of my application, /dev/term/b is always
detected. But when I call getPortIdentifier(), the nested
getPortIdentifiers() does not detect it any more. It seems
that testRead() fails when RXTX is being re-initialized.
It fails not always, but approximately 8 times out of 10 tries.
It looks like the code is broken due to the fix in
CommPortIdentifier which was added for
http://bugzilla.qbang.org/show_bug.cgi?id=48
Has anybody seen this before, or can give any advice?
Unfortunately, I currently don't have a compile
environment available on Solaris such that I could
try a debug version to see what's causing the port
detection to fail in native code. Does anybody have
a Solaris debug version available?
Thanks,
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
From will.tatam at red61.com Tue Oct 23 12:26:29 2007
From: will.tatam at red61.com (Will Tatam)
Date: Tue, 23 Oct 2007 19:26:29 +0100
Subject: [Rxtx] Release date for 2.2
Message-ID: <471E3CD5.4030605@red61.com>
Before everything went tits up with the server there was talk about
preparing for a 2.2 release. Is there a timescale for this and is there
a document somewhere as to what changes this will contain ?
--
Will Tatam
Systems Architect
Red Sixty One LTD
0845 867 2203 ext 103
From tjarvi at qbang.org Tue Oct 23 17:07:37 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:07:37 -0600 (MDT)
Subject: [Rxtx] NoSuchPortException in getPortIdentifier() on Solaris
In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
References: <460801A4097E3D4CA04CC64EE64858480351C0DB@ism-mail03.corp.ad.wrs.com>
Message-ID:
On Tue, 23 Oct 2007, Oberhuber, Martin wrote:
> Hello,
>
> I'm using rxtx-2.1-7r2 on Solaris 9 and 10 to implement a
> Terminal in Eclipse.
>
> On initial startup of my application, /dev/term/b is always
> detected. But when I call getPortIdentifier(), the nested
> getPortIdentifiers() does not detect it any more. It seems
> that testRead() fails when RXTX is being re-initialized.
>
> It fails not always, but approximately 8 times out of 10 tries.
>
> It looks like the code is broken due to the fix in
> CommPortIdentifier which was added for
> http://bugzilla.qbang.org/show_bug.cgi?id=48
>
> Has anybody seen this before, or can give any advice?
>
> Unfortunately, I currently don't have a compile
> environment available on Solaris such that I could
> try a debug version to see what's causing the port
> detection to fail in native code. Does anybody have
> a Solaris debug version available?
>
Hi Martin,
I built an Ad Hoc version for sol10 with -g for you and put it in the
ToyBox.
http://rxtx.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Solaris/sparc-sun-solaris2.10-debug
r2 was a second build so its all just 2.1-7.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:12:09 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:12:09 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E3CD5.4030605@red61.com>
References: <471E3CD5.4030605@red61.com>
Message-ID:
On Tue, 23 Oct 2007, Will Tatam wrote:
> Before everything went tits up with the server there was talk about
> preparing for a 2.2 release. Is there a timescale for this and is there
> a document somewhere as to what changes this will contain ?
>
>
Hi Will,
So far, I've been doing the best I can just to pull rxtx out of a pile of
inodes.
We can start looking at a new release now. The first thing I want to do
is go back ane encorperate the changes Martin has been working on. I'll
have a few minor changes also. This is a good time to get the release
out.
There isn't a list of changes right now. What we could do is have Martin
post his changes to the list again and start there. Or I can dig though
my email and find them if he does not have them handy.
--
Trent Jarvi
tjarvi at qbang.org
From tjarvi at qbang.org Tue Oct 23 17:57:40 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 17:57:40 -0600 (MDT)
Subject: [Rxtx] Wiki and Spambots
In-Reply-To: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
References: <2CBE96AE-2092-4CF6-848A-15E8D80D58F4@sympatico.ca>
Message-ID:
On Tue, 17 Jul 2007, Andre-John Mas wrote:
> Hi,
>
> Looks like spambots are wrecking havoc on the Wiki. Had to correct:
>
> http://rxtx.qbang.org/wiki/index.php/Examples
> http://rxtx.qbang.org/wiki/index.php/
> Two_way_communcation_with_the_serial_port
>
> Any chance we can add a captcha for account creation?
>
Late but Done. We actually had spambots trying to write over each other.
I also locked the front page but left everything else editable by anyone
willing to create an account. The pages should be clean again.
--
Trent Jarvi
tjarvi at qbang.org
From netbeans at gatworks.com Tue Oct 23 18:29:55 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:29:55 -0400
Subject: [Rxtx] Release date for 2.2
In-Reply-To:
References: <471E3CD5.4030605@red61.com>
Message-ID: <471E9203.9010105@gatworks.com>
> There isn't a list of changes right now. What we could do is have Martin
> post his changes to the list again and start there. Or I can dig though
> my email and find them if he does not have them handy.
here is a diff of the changes I made to my local rxtx ,
gimme a shout when u get ready to review.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071023/66665b8a/attachment-0007.pl
From netbeans at gatworks.com Tue Oct 23 18:37:24 2007
From: netbeans at gatworks.com (U. George)
Date: Tue, 23 Oct 2007 20:37:24 -0400
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID: <471E93C4.4020501@gatworks.com>
a
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so it
> cant take 115200!!!!!!!!!!!!!!
can u tell me why? int is approx +/- 2gig
From tod at todbot.com Tue Oct 23 18:41:29 2007
From: tod at todbot.com (Tod E. Kurt)
Date: Tue, 23 Oct 2007 17:41:29 -0700
Subject: [Rxtx] 115.2kbps with rxtx
In-Reply-To:
References:
Message-ID:
In Java, ints go from -2147483648 to 2147483647, inclusive.
http://java.sun.com/docs/books/jls/third_edition/html/
typesValues.html#4.2.1
On Jul 31, 2007, at 8:27 a, arnab bhaumik wrote:
> hi all,
>
> i am wondering how to get this speed (115.2kbps) with rxtx????
>
>
>
> serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
> SerialPort.STOPBITS_1,
> SerialPort.PARITY_NONE);
>
>
> -------- at this method the first field (9600) is a type int . so
> it cant take 115200!!!!!!!!!!!!!!
>
> please help me
> arnab
>
> --
> Arnab Bhaumik / VU2BPW
>
> Proprietor and Design Engineer,
>
> AB Telecomm.
> Rajchandrapur, PO- Ghoshpara(Bally).
> Howrah, West Bengal.
> Pin - 711227
> Ph- (033) 26716307
> Mob- 9433927150
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
From tjarvi at qbang.org Tue Oct 23 19:44:08 2007
From: tjarvi at qbang.org (Trent Jarvi)
Date: Tue, 23 Oct 2007 19:44:08 -0600 (MDT)
Subject: [Rxtx] Release date for 2.2
In-Reply-To: <471E9203.9010105@gatworks.com>
References: <471E3CD5.4030605@red61.com>
<471E9203.9010105@gatworks.com>
Message-ID: