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: 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-0007.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-0006.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-0004.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards 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-0008.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-0008.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-0007.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-0006.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0001.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? 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-0009.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-0009.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-0008.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-0007.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0002.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0002.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0001.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0001.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0001.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/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-0010.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-0010.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-0009.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-0008.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0003.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0003.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0003.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0002.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0002.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0001.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-0011.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-0011.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-0010.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-0009.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0004.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0004.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0004.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0003.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0003.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0003.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-0012.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-0012.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-0011.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-0010.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0005.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0005.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0005.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0004.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0004.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0004.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-0013.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-0013.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-0012.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-0011.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0006.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0006.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0006.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0005.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0005.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0005.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-0014.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-0014.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-0013.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-0012.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0007.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0007.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0007.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0006.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0006.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0006.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-0015.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-0015.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-0014.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-0013.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0008.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0008.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0008.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0007.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0007.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0007.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-0016.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-0016.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-0015.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-0014.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0009.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0009.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0009.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0008.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0008.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0008.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-0017.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-0017.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-0016.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-0015.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0010.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0010.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0010.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0009.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0009.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0009.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-0018.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-0018.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-0017.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-0016.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0011.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0011.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0011.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0010.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0010.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0010.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-0019.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-0019.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-0018.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-0017.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0012.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0012.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0012.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0011.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0011.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0011.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-0020.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-0020.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-0019.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-0018.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0013.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0013.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0013.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0012.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0012.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0012.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-0021.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-0021.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-0020.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-0019.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0014.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0014.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0014.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0013.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0013.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0013.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-0022.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-0022.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-0021.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-0020.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0015.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0015.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0015.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0014.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0014.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0014.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-0023.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-0023.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-0022.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-0021.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0016.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0016.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0016.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0015.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0015.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0015.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-0024.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-0024.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-0023.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-0022.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0017.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0017.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0017.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0016.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0016.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0016.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-0025.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-0025.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-0024.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-0023.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0018.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0018.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0018.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0017.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0017.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0017.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-0026.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-0026.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-0025.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-0024.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0019.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0019.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0019.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0018.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0018.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0018.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-0027.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-0027.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-0026.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-0025.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0020.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0020.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0020.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0019.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0019.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0019.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-0028.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-0028.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-0027.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-0026.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0021.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0021.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0021.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0020.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0020.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0020.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-0029.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-0029.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-0028.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-0027.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0022.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0022.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0022.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0021.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0021.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0021.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-0030.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-0030.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-0029.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-0028.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0023.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0023.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0023.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0022.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0022.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0022.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-0031.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-0031.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-0030.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-0029.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0024.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0024.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0024.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0023.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0023.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0023.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-0032.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-0032.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-0031.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-0030.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0025.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0025.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0025.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0024.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0024.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0024.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-0033.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-0033.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-0032.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-0031.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0026.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0026.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0026.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0025.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0025.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0025.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-0034.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-0034.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-0033.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-0032.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0027.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0027.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0027.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0026.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0026.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0026.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-0035.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-0035.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-0034.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-0033.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0028.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0028.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0028.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0027.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0027.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0027.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-0036.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-0036.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-0035.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-0034.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0029.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0029.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0029.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0028.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0028.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0028.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-0037.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-0037.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-0036.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-0035.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0030.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0030.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0030.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0029.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0029.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0029.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-0038.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-0038.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-0037.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-0036.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0031.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0031.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0031.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0030.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0030.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0030.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-0039.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-0039.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-0038.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-0037.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0032.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0032.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0032.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0031.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0031.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0031.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-0040.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-0040.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-0039.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-0038.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0033.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0033.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0033.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0032.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0032.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0032.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-0041.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-0041.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-0040.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-0039.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0034.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0034.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0034.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0033.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0033.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0033.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-0042.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-0042.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-0041.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-0040.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0035.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0035.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0035.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0034.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0034.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0034.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-0043.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-0043.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-0042.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-0041.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0036.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0036.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0036.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0035.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0035.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0035.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-0044.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-0044.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-0043.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-0042.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0037.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0037.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0037.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0036.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0036.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0036.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-0045.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-0045.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-0044.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-0043.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0038.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0038.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0038.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0037.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0037.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0037.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-0046.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-0046.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-0045.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-0044.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0039.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0039.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0039.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0038.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0038.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0038.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-0047.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-0047.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-0046.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-0045.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0040.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0040.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0040.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0039.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0039.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0039.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-0048.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-0048.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-0047.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-0046.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0041.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0041.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0041.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0040.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0040.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0040.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-0049.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-0049.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-0048.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-0047.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0042.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0042.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0042.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0041.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0041.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0041.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-0050.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-0050.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-0049.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-0048.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0043.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0043.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0043.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0042.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0042.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0042.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-0051.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-0051.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-0050.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-0049.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0044.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0044.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0044.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0043.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0043.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0043.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-0052.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-0052.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-0051.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-0050.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0045.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0045.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0045.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0044.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0044.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0044.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-0053.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-0053.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-0052.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-0051.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 ajmas at sympatico.ca Mon Oct 29 08:21:28 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 29 Oct 2007 10:21:28 -0400 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX Message-ID: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Hi, I have just found out that there is now JSR-082, which is a specification for a Bluetooth API. I haven' played with it much, other than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for the Nintendo Wii remote. A few questions arise: - I would be curious to know whether anyone has played with this much? - Would it make sense to try to make this an optional dependency for serial communication over Bluetooth? I'll admit I haven't thought out the pros and cons at this point, so making it an optional dependency may not add any real value, but that still bares investigation. Andre From jredman at ergotech.com Mon Oct 29 09:03:24 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 29 Oct 2007 09:03:24 -0600 Subject: [Rxtx] JSR-082 (Bluetooth API) & RXTX In-Reply-To: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> References: <7EBBEB7F-1B61-412C-85BD-567759AF5189@sympatico.ca> Message-ID: <4725F63C.6060209@ergotech.com> Andre, This JSR-82 uses COMM API to get access to the Bluetooth device, making it portable to any platform that has RXTX available. It's missing some things, most notably, RFCOMM, which is the layer that allows a Bluetooth device to do point-to-point serial, but seems to work as advertised: http://sourceforge.net/projects/javabluetooth/ The idea of using JavaCOMM is very clever since it removes the particular library dependencies, but it also means that it only works with Bluetooth devices that look like serial devices (so PCMCIA style, and maybe some USB). It needs a new developer since not much work has been done on it. Jim Andre-John Mas wrote: > Hi, > > I have just found out that there is now JSR-082, which is a > specification for a Bluetooth API. I haven' played with it much, other > than via WiiremoteJ ( http://www.wiili.org/WiiremoteJ ), an API for > the Nintendo Wii remote. A few questions arise: > - I would be curious to know whether anyone has played with this much? > - Would it make sense to try to make this an optional dependency for > serial communication over Bluetooth? > > I'll admit I haven't thought out the pros and cons at this point, so > making it an optional dependency may not add any real value, but that > still bares investigation. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Oct 29 18:40:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 18:40:45 -0600 (MDT) Subject: [Rxtx] Problem with 5 phone mobile In-Reply-To: <32031381.1193651972915.JavaMail.root@ps13> References: <32031381.1193651972915.JavaMail.root@ps13> Message-ID: On Mon, 29 Oct 2007, chebart at tiscali.it wrote: > 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 You may have found a bug in rxtx or the drivers you are using with your phone. If you file a bug in http://bugzilla.qbang.org others may report they are finding the same problem. stack traces or any information on the setup such as which OS is being used would be useful. You can provide the link to the bug here and see what others say. There is a bug floating around with multiple serial ports. I do not know detailed information beyond that. Filing a bug is a good start to figuring out what is going on. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Mon Oct 29 19:38:38 2007 From: keithvz at verizon.net (Keith Monahan) Date: Mon, 29 Oct 2007 21:38:38 -0400 Subject: [Rxtx] DTR-based hardware flow control Message-ID: <47268B1E.8020901@verizon.net> I've got a microcontroller attached via TTL to a usb-serial converter and using RXTX 2.1.7 under WinXP. The USB-Serial converter is based on FTDI's FT232BM converter chip, and supports both RTS/CTS and DTR/DSR based hardware flow control. My particular implementation of this chip(made by Parallax) ONLY supports DTR for flow control. The PC can lower DTR thereby telling the microcontroller to stop sending until the PC can receive the data. The virtual com port drivers for the converter has a "hardware" flow control setting, and I've tested it with some terminal software -- it behaves as expected. I have my microcontroller pound the interface with bytes, and the PC drops DTR as confirmed on my logic analyzer. Whenever I open the port with RXTX, and do a port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); System.out.println("get flow mode is >"+port.getFlowControlMode()+"<"); (I've also tested port.FLOWCONTROL_RTSCTS_OUT) The getFlowControlMode() responds that it is set appropriately. However, with RXTX, at no time does DTR drop, even when I cease reading bytes altogether. Does RXTX support DTR-based hardware flow control and if so, what are the critical things to setup to ensure that it is enabled and functioning? Thank you. Keith M From tjarvi at qbang.org Mon Oct 29 20:29:30 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 Oct 2007 20:29:30 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <47268B1E.8020901@verizon.net> References: <47268B1E.8020901@verizon.net> Message-ID: On Mon, 29 Oct 2007, Keith Monahan wrote: > I've got a microcontroller attached via TTL to a usb-serial converter > and using RXTX 2.1.7 under WinXP. > > The USB-Serial converter is based on FTDI's FT232BM converter chip, and > supports both RTS/CTS and DTR/DSR based hardware flow control. My > particular implementation of this chip(made by Parallax) ONLY supports > DTR for flow control. > > The PC can lower DTR thereby telling the microcontroller to stop sending > until the PC can receive the data. The virtual com port drivers for the > converter has a "hardware" flow control setting, and I've tested it with > some terminal software -- it behaves as expected. I have my > microcontroller pound the interface with bytes, and the PC drops DTR as > confirmed on my logic analyzer. > > Whenever I open the port with RXTX, and do a > > port.setFlowControlMode(port.FLOWCONTROL_RTSCTS_IN); > > System.out.println("get flow mode is > >"+port.getFlowControlMode()+"<"); > > (I've also tested port.FLOWCONTROL_RTSCTS_OUT) > > The getFlowControlMode() responds that it is set appropriately. > > However, with RXTX, at no time does DTR drop, even when I cease reading > bytes altogether. > > Does RXTX support DTR-based hardware flow control and if so, what are > the critical things to setup to ensure that it is enabled and functioning? > > Thank you. > Hi Kevin, I was the one that put that code in years ago. When I did, there was just hardware flow control in my mind. I was not aware of the two different types. As I recall setting either input or output will stomp on both. But I don't think rxtx supports both. There have been posts to the list suggesting there is a win32 api call that would do what you want. If I'm not mistaken, the CommAPI does not allow what you want. That isn't a huge issue. You could propose a patch with pseudo code showing what you would like to do. rxtx has several extensions to the API and just tucks them under the radar. If you get some code close to what you want in termios.c and RXTXPort.java, we can take a look. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Oct 29 23:11:48 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 01:11:48 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> Message-ID: <4726BD14.7080608@gatworks.com> > I was the one that put that code in years ago. When I did, there was just > hardware flow control in my mind. I was not aware of the two different > types. As I remember, DSR/DTR was not used as flow control. It merely indicated that the devices was ready ( ie powered up ) for the transfer of data. For instance a modem wont pickup unless the DTR signal is set. Similarly, if DTR is dropped, the modem will disconnect. Instead of a modem, under hardware control, there is a terminal. I would not expect the terminal to drop DSR if its i/o buffer is (nearly) full. I would expect the DSR to drop if the terminal went off-line. But the DTR driver may interpret this as a disconnect, and close the file-descriptor. But if you really get into the nitty-gritty of things in the device driver of the serial I/O chip, you really should see that the device buffer receives characters at a time, and then at some trigger point, a stop signal is issued. either dtr/dsr can be used, or rts/cts can be used, so long as both ends understand the meaning. Traditionally rts/cts was used for this (character data flow control) purpose. I dont think that any unix's have that changable flow-control feature. From keithvz at verizon.net Mon Oct 29 23:19:44 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 01:19:44 -0400 Subject: [Rxtx] DTR-based hardware flow control] Message-ID: <4726BEF0.3040407@verizon.net> Trent Jarvi wrote: > As I recall setting either input or output will stomp on both. But I > don't think rxtx supports both. There have been posts to the list > suggesting there is a win32 api call that would do what you want. Well I looked through the Platform SDK documentation for Microsoft's Visual Studio, namely via C++. You can use SetCommState() and pass the handle from a CreateFile(), and a DCB structure that contains a variable DCB dcb; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; This is the same DCB structure where you specify baud rate, parity, start and stop bits, etc. While I know how to do this in C++, I'd have no idea how to integrate this with Java. I'm a relatively weak Java programmer. Enough to get by normally. I will try searching the past posts, if you happen to stumble on the posts, if you post a link, it'd be appreciated. My whole idea switching from C++ to Java (and hence rxtx) for my current project is to avoid being platform dependent. While I'll be happy happy happy to fix my problem with Windows, this doesn't fix the problem long term. > If I'm not mistaken, the CommAPI does not allow what you want. That > isn't a huge issue. You could propose a patch with pseudo code showing > what you would like to do. rxtx has several extensions to the API and > just tucks them under the radar. If you get some code close to what you > want in termios.c and RXTXPort.java, we can take a look. I don't understand the low level interworkings of rxtx, but I understand serial protocols well. I could probably come up with some pseudo-code, but I'm not sure how or where this code would plug in. The idea is relatively simple. (this would be located near the low-level input/read code for the interface) //drop dtr if the current buffer gets within 32 bytes of its maximum //32 bytes is entirely out of the air if ((DTRhandshaking == enabled) && (currentreceivebuffercontentsize > (MAX_RECEIVEBUFFERSIZE-32)) then { drop_dtr(); dtrisdropped = true; } < SOMEWHERE IN THE MIDDLE, OTHER CODE IS READING AND FREEING UP THE BUFFER > //reenable DTR once the buffer has been emptied enough that it doesn't //pose an overflow risk. leave some room in the buffer so that the //sender(in this case, the DCE) has enough time to react and stop //sending w/o losing data. if ((DTRhandshaking == enabled) && (dtrisdropped == true) && (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { raise_dtr(); dtrisdropped = false; } The code would be very similar to what you are currently doing with RTS. DTR flow control should behave in exactly the same way. But instead of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on DTE/PC's, and CTS/DSR's are INPUTS from DCE's. I'd love to edit the code and add the functionality, I just don't really know wth I'm doing, how to setup the compiling environment to generate usable libraries, etc. Thanks Keith From keithvz at verizon.net Tue Oct 30 00:07:58 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 30 Oct 2007 02:07:58 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726BD14.7080608@gatworks.com> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> Message-ID: <4726CA3E.50006@verizon.net> U. George wrote: > As I remember, DSR/DTR was not used as flow control. It merely indicated > that the devices was ready ( ie powered up ) for the transfer of data. While this is probably the more common usage, using DTR/DSR for flow control isn't as uncommon as you might think. Microsoft supports it in their standard APIs (see earlier post). FTDI, makers of my USB-serial IC, support it. Parallax, who implemented the USB2SER development tool based on FTDI's chips support it. Some terminals and serial printers use DTR/DSR for flow control. > Instead of a modem, under hardware control, there is a terminal. I would > not expect the terminal to drop DSR if its i/o buffer is (nearly) full. > I would expect the DSR to drop if the terminal went off-line. Sorry to pick nits. Just one quick clarification. Terminals are DTEs, and never drop (or raise) DSR. DSR is an input on a DTE device. Modems and other DCE's output DSR. If you are talking about making a null-modem cable, and cross-wiring two DTEs, then I'll give you slack. (But technically, no one is outputting DSR in that case) :) > either dtr/dsr can be used, or rts/cts can be > used, so long as both ends understand the meaning. Traditionally rts/cts > was used for this (character data flow control) purpose. Agreed. > I dont think that any unix's have that changable flow-control feature. Are you a betting man??? FTDI's chips are supported under linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from the drivers(which are integrated and shipped with Ubuntu) Thanks Keith From netbeans at gatworks.com Tue Oct 30 06:16:04 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 08:16:04 -0400 Subject: [Rxtx] DTR-based hardware flow control] In-Reply-To: <4726BEF0.3040407@verizon.net> References: <4726BEF0.3040407@verizon.net> Message-ID: <47272084.5060005@gatworks.com> > > if ((DTRhandshaking == enabled) && (dtrisdropped == true) && > (currentreceivebuffercontentsize < (MAX_RECEIVEBUFFERSIZE-32)) then { > > raise_dtr(); > dtrisdropped = false; > } > > The code would be very similar to what you are currently doing with RTS. > DTR flow control should behave in exactly the same way. But instead > of an RTS/CTS pair, you have a DTR/DSR pair. RTS & DTR's are OUTPUTS on > DTE/PC's, and CTS/DSR's are INPUTS from DCE's. Generally this code is in the device driver itself. A process, nor thread knows exactly when it will be given a slice of time, or for how long that slice will be. If your interest is in capturing all the serial data, then the kernel *interrupt* routine has to enforce that type of *reliable* control flow. your 32 character buffer zone at user level may not be enough for an active system. From cyrille.dumont at tatexpress.fr Tue Oct 30 06:47:45 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Tue, 30 Oct 2007 13:47:45 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM Message-ID: <472727F1.1000704@tatexpress.fr> Hi, I use Rxtx library to read 1D barcodes via scanners (use event) It works fine Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) When I read a 555 char PDF417, it is cut into 2 strings (2 events are find ... ???) -> 1st : 200 char (allways 200) -> 2sd: 355 char Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for the 1st one ? A way to change this parameter ? (for example, read 1000 char in 1 time) Maybe a way to circumvent this problem ? Thks in advance Best regards From sarah_662005 at yahoo.com Tue Oct 30 12:02:06 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Tue, 30 Oct 2007 11:02:06 -0700 (PDT) Subject: [Rxtx] Urgent!! serialEvent(SerialPortEvent event) never be triggered Message-ID: <600074.21299.qm@web55806.mail.re3.yahoo.com> Hi All, I am using rxtx 2.1-7 on windows XP to try to get incoming numerical data from device through com5. I have been struggling to get it work for days. The problems I got: 1. Sometimes only part of the numerical value can be received when I start the java application (jdk1.6), and sometimes I can only get non-readable chars. 2. serialEvent cannot be triggered when I click on the send data button from the device. I am pasting part of the code below. Please help!!! Thank you. - Sara try { serialPort = (SerialPort) portId.open("TestApp", 2000); } catch (PortInUseException e) { System.err.println(e); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(4800, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN); serialPort.setDTR(true); } catch (UnsupportedCommOperationException e) {} ......... public void serialEvent(SerialPortEvent event) { if(event.getEventType()==SerialPortEvent.DATA_AVAILABLE) { byte[] readBuffer = new byte[14]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } String dataValue = new String(readBuffer); System.out.println("incoming data: " + dataValue); } catch (IOException e) { System.out.println("Error: " + e); } } } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/86a689e2/attachment-0046.html From bhechanova at imsconsultants.com Tue Oct 30 18:45:49 2007 From: bhechanova at imsconsultants.com (Beth Hechanova) Date: Tue, 30 Oct 2007 17:45:49 -0700 Subject: [Rxtx] how to unload librxtxSerial.so Message-ID: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Hi, I'm using the librxtxSerial.so library for serial communications on a linux system and it is working great. My application is running within an Apache Tomcat Webserver and I'm running into an error when I try to "hot deploy" a new version of my application into the webserver. I'm getting an error that says "java.lang.UnsatisfiedLinkError: Native Library /usr/local/jdk1.6.0_02/jre/lib/i386/librxtxSerial.so already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver". Thus I am unable to hot deploy, and must always stop tomcat, deploy the new war file, and start tomcat again. Is there some sort of shutdown / unload call that I can call when my application shuts down to unload the library? I didn't see anything obvious in your api. I'm using v2.1.7 on Linux (Fedora). Thanks, Beth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071030/36f72595/attachment-0046.html From netbeans at gatworks.com Tue Oct 30 19:07:28 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 30 Oct 2007 21:07:28 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> Message-ID: <4727D550.1000700@gatworks.com> > Is there some sort of shutdown / unload call that I can call when my > application shuts down to unload the library? I didn?t see anything > obvious in your api. > Can u tellme what the Standard is to unload a .so library in java ? From Martin.Oberhuber at windriver.com Tue Oct 30 19:39:19 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 02:39:19 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Hi all, there have been discussions about an RXTX 2.2 release. Given that I've found some fairly critical issues with CommPortIdentifier (port ownership listeners; deadlocks) I was wondering what the community would think about an RXTX 2.1-8 release? For Eclipse, we need the fixes I've made, and I don't like the fact that the RXTX Eclipse distribution currently does not build off a well-known label in CVS so it's "different" than other flavors of RXTX. Also, there might be other super-safe but important fixes that I might not be aware of but would like to pick up? For the Eclipse distribution and what was changed, see attached about.html, and http://rxtx.qbang.org/eclipse/ http://rxtx.qbang.org/eclipse/downloads/ 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/3dde9d80/attachment-0046.html From tjarvi at qbang.org Tue Oct 30 22:53:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:53:41 -0600 (MDT) Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: <4726CA3E.50006@verizon.net> References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: On Tue, 30 Oct 2007, Keith Monahan wrote: >> I dont think that any unix's have that changable flow-control feature. > > Are you a betting man??? FTDI's chips are supported under linux > (tested (by me) on Ubuntu Feisty Fawn) and may inherit this capability from > the drivers(which are integrated and shipped with Ubuntu) > Hi Keith, You gave a win32 example thats easy enough to code. Do you have the corresponding ioctl call (C call) that is used by Ubuntu? If we have those two, it should be possible to put something in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 22:58:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 22:58:54 -0600 (MDT) Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671518@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > Hi all, > > there have been discussions about an RXTX 2.2 release. > > Given that I've found some fairly critical issues with > CommPortIdentifier (port ownership listeners; deadlocks) > I was wondering what the community would think about > an RXTX 2.1-8 release? > > For Eclipse, we need the fixes I've made, and I don't > like the fact that the RXTX Eclipse distribution currently > does not build off a well-known label in CVS so it's > "different" than other flavors of RXTX. > > Also, there might be other super-safe but important > fixes that I might not be aware of but would like > to pick up? > > For the Eclipse distribution and what was changed, see > attached about.html, and > http://rxtx.qbang.org/eclipse/ > http://rxtx.qbang.org/eclipse/downloads/ > Hi Ober, A 2.2 release would involve changes to the API which are not currently in the plans. I am looking at putting a 2.1-8 release out. Your changes look fine to me but I've held back comment because it is in an area I'm not too concerned about. George's changes need some work. I've only got minor changes to put in. I'll be out for a week but will be following up. I could put your changes into CVS. As for tagging a release, that involves more work on my end but is doable in a couple weeks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:19:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:19:14 -0600 (MDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <600074.21299.qm@web55806.mail.re3.yahoo.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On Tue, 30 Oct 2007, Sara Hugh wrote: > while (inputStream.available() > 0) > { > int numBytes = inputStream.read(readBuffer); > } > This logic looks a bit odd. You overwrite your data with variable amounts until there is no more input available. Some other comments. You may be getting events other than data available such as parity errors. When in doubt, dont catch and ignore exceptions. When in doubt, examine the return values for methods like read(). serialEvent is triggered if you are using a real serial port. If you are using something else that presents itself as a real serial port via drivers, you may find some aspects do not work. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Oct 30 23:59:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 30 Oct 2007 23:59:37 -0600 (MDT) Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: <472727F1.1000704@tatexpress.fr> References: <472727F1.1000704@tatexpress.fr> Message-ID: On Tue, 30 Oct 2007, Cyrille DUMONT wrote: > Hi, > > I use Rxtx library to read 1D barcodes via scanners (use event) > It works fine > > Now I try to read a PDF417 (2D barcode ; for ex. a 555 characters PDF417) > > When I read a 555 char PDF417, it is cut into 2 strings (2 events are > find ... ???) > -> 1st : 200 char (allways 200) > -> 2sd: 355 char > > Does Someone know why my PDF417 is cut into 2 strings ? Why 200 char for > the 1st one ? > A way to change this parameter ? (for example, read 1000 char in 1 time) > Maybe a way to circumvent this problem ? > > Thks in advance > Best regards > The data available event is being sent before all the data has been received. you can ask it how much data is available and sleep until it has what you want. You can also set timeout and threshold to get read to return only the amount you want. * *timeout threshold Behavior (read) *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available timeout > 0, * threshold = 0, blocks until timeout occurs, returns -1 * on timeout *>0 >0 blocks until timeout, returns - 1 on timeout, magnitude * of threshold doesn't play a role. *0 >0 Blocks until 1 byte, magnitude of threshold doesn't * play a role -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Wed Oct 31 03:50:00 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 05:50:00 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <47284FC8.80904@gatworks.com> >>> I dont think that any unix's have that changable flow-control feature. >> >> Are you a betting man??? FTDI's chips are supported under >> linux (tested (by me) on Ubuntu Feisty Fawn) and may inherit this >> capability from the drivers(which are integrated and shipped with Ubuntu) >> What the hardware has, or does not have, is of no importance. Does the OS support your concept of what DTR/DSR should do. Which is, if the serial device drivers internal buffer is nearly full ( or empty ) , a hardware handshake, initiated by the device ( or driver ) itself, with either the rts/cts or the dtr/dsr signals should change to reflect that condition. At this time there is only one UNIX flag (CRSTCST) in ftdi_sio.c , that I can see, that would enable flow control. A USB packet is sent to the FTDI device, which I think enables (RTS-CTS?) 'flow-control'. There is nothing in the device driver to suggest that flow control is to be by either DTR/DSR, RST/CST, or both. There is nothing to suggest that a user can change which ones should be enforced. But there is this interesting comment: /* Set flow control */ /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ if (cflag & CRTSCTS) { Anyway, all this as per linux 2.6.11 From netbeans at gatworks.com Wed Oct 31 04:21:35 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 06:21:35 -0400 Subject: [Rxtx] DTR-based hardware flow control In-Reply-To: References: <47268B1E.8020901@verizon.net> <4726BD14.7080608@gatworks.com> <4726CA3E.50006@verizon.net> Message-ID: <4728572F.4080300@gatworks.com> What is the name of the application that u use to open the device? From Martin.Oberhuber at windriver.com Wed Oct 31 08:33:22 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:33:22 +0100 Subject: [Rxtx] Multiple ports In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671BED@ism-mail03.corp.ad.wrs.com> Hi Andy, I experienced some transient issues with closing and immediately re-opening a port. What improved the situation for me, was to first unregister the event handler, then wait a little, then close the port. I also noticed an NPE in removeEventListener() once, where the RXTX monitor thread seemed to have died too early. So I finally came up with this code, which reliably closes and re-opens ports for me: try { getSerialPort().removeEventListener(); Thread.sleep(50); //allow a little time for RXTX Native to catch up - makes stuff more stable } catch(Exception e) { Logger.logException(e); } getSerialPort().close(); You might also need the fixes that I've put into the CommPortIdentifier class, since the old code could hickup with multiple Threads and getPortIdentifier(). See http://bugzilla.qbang.org/show_bug.cgi?id=48 http://rxtx.qbang.org/eclipse/downloads 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 Reid, Andy (Space & Defence) Sent: Friday, October 26, 2007 8:56 AM To: rxtx at qbang.org Subject: [Rxtx] Multiple ports 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/20071031/adae1146/attachment-0045.html From Martin.Oberhuber at windriver.com Wed Oct 31 08:56:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Oct 2007 15:56:51 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Hi Trent, what I'm interested in is a super-stable version of RXTX for our commercial product. Which would mean only a couple of hand-selected, reviewed, tested and documented fixes compared to 2.1-7. Would it make sense to start thinking about what kinds of fixes would qualify? 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 31, 2007 5:59 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org > Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) > > On Wed, 31 Oct 2007, Oberhuber, Martin wrote: > > > Hi all, > > > > there have been discussions about an RXTX 2.2 release. > > > > Given that I've found some fairly critical issues with > > CommPortIdentifier (port ownership listeners; deadlocks) > > I was wondering what the community would think about > > an RXTX 2.1-8 release? > > > > For Eclipse, we need the fixes I've made, and I don't > > like the fact that the RXTX Eclipse distribution currently > > does not build off a well-known label in CVS so it's > > "different" than other flavors of RXTX. > > > > Also, there might be other super-safe but important > > fixes that I might not be aware of but would like > > to pick up? > > > > For the Eclipse distribution and what was changed, see > > attached about.html, and > > http://rxtx.qbang.org/eclipse/ > > http://rxtx.qbang.org/eclipse/downloads/ > > > > Hi Ober, > > A 2.2 release would involve changes to the API which are not > currently in > the plans. I am looking at putting a 2.1-8 release out. > Your changes > look fine to me but I've held back comment because it is in > an area I'm > not too concerned about. > > George's changes need some work. I've only got minor changes > to put in. > > > I'll be out for a week but will be following up. I could put > your changes > into CVS. As for tagging a release, that involves more work > on my end but > is doable in a couple weeks. > > -- > Trent Jarvi > tjarvi at qbang.org > From ajmas at sympatico.ca Wed Oct 31 10:40:41 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:40:41 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4727D550.1000700@gatworks.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> Message-ID: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> On 30-Oct-07, at 21:07 , U. George wrote: > >> Is there some sort of shutdown / unload call that I can call when my >> application shuts down to unload the library? I didn?t see anything >> obvious in your api. >> > Can u tellme what the Standard is to unload a .so library in java ? A quick search comes up with this thread: http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 Andre From greg.johnson at manchester.ac.uk Wed Oct 31 10:54:52 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Wed, 31 Oct 2007 17:54:52 +0100 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Oct 31 10:55:45 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 31 Oct 2007 12:55:45 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: On 31-Oct-07, at 01:19 , Trent Jarvi wrote: > On Tue, 30 Oct 2007, Sara Hugh wrote: > >> while (inputStream.available() > 0) >> { >> int numBytes = inputStream.read(readBuffer); >> } >> > > This logic looks a bit odd. You overwrite your data with variable > amounts > until there is no more input available. It does look odd, something along these lines might better (you should replace ASCII with the appropriate character set). Note the use of the String constructor with length parameter, since you should not assume that you got 14 bytes, even if you were meant to. while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Also, from my experience I tend to find InputStream.available() is rarely useful, especially given that not all child classes implement it, and instead use: int numBytes = 0; while ( (numBytes = inputStream.read(readBuffer)) > 0) { String dataValue = new String(readBuffer,0,numBytes,"ASCII"); System.out.println("incoming data: " + dataValue); } Andre From nick.circelli at infrasafe.com Wed Oct 31 11:48:23 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Wed, 31 Oct 2007 12:48:23 -0500 Subject: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584803671C0E@ism-mail03.corp.ad.wrs.com> Message-ID: <26942855A698324184B3BA0F7896028B027774EE@34093-EVS2C1.exchange.rackspace.com> I concur. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Wednesday, October 31, 2007 12:55 PM To: Oberhuber, Martin Cc: rxtx at qbang.org Subject: Re: [Rxtx] What about RXTX-2.1.8 ? (was: Release date for 2.2) I couldn't agree more - we also have a commercial product that uses rxtx, and a stable binary release of 2.1-8 for all platforms would be great. 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 31 Oct 2007, at 15:56, Oberhuber, Martin wrote: > Hi Trent, > > what I'm interested in is a super-stable version > of RXTX for our commercial product. Which would > mean only a couple of hand-selected, reviewed, > tested and documented fixes compared to 2.1-7. > > Would it make sense to start thinking about what > kinds of fixes would qualify? > > 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 31, 2007 5:59 AM >> To: Oberhuber, Martin >> Cc: Trent Jarvi; Will Tatam; rxtx at qbang.org >> Subject: Re: What about RXTX-2.1.8 ? (was: Release date for 2.2) >> >> On Wed, 31 Oct 2007, Oberhuber, Martin wrote: >> >>> Hi all, >>> >>> there have been discussions about an RXTX 2.2 release. >>> >>> Given that I've found some fairly critical issues with >>> CommPortIdentifier (port ownership listeners; deadlocks) >>> I was wondering what the community would think about >>> an RXTX 2.1-8 release? >>> >>> For Eclipse, we need the fixes I've made, and I don't >>> like the fact that the RXTX Eclipse distribution currently >>> does not build off a well-known label in CVS so it's >>> "different" than other flavors of RXTX. >>> >>> Also, there might be other super-safe but important >>> fixes that I might not be aware of but would like >>> to pick up? >>> >>> For the Eclipse distribution and what was changed, see >>> attached about.html, and >>> http://rxtx.qbang.org/eclipse/ >>> http://rxtx.qbang.org/eclipse/downloads/ >>> >> >> Hi Ober, >> >> A 2.2 release would involve changes to the API which are not >> currently in >> the plans. I am looking at putting a 2.1-8 release out. >> Your changes >> look fine to me but I've held back comment because it is in >> an area I'm >> not too concerned about. >> >> George's changes need some work. I've only got minor changes >> to put in. >> >> >> I'll be out for a week but will be following up. I could put >> your changes >> into CVS. As for tagging a release, that involves more work >> on my end but >> is doable in a couple weeks. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> > _______________________________________________ > 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 From jredman at ergotech.com Wed Oct 31 11:53:53 2007 From: jredman at ergotech.com (Jim Redman) Date: Wed, 31 Oct 2007 11:53:53 -0600 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> Message-ID: <4728C131.2080603@ergotech.com> Just to state something obvious, in case it's been overlooked. Is there any way you can put the RXTX jars on the application classpath? You can also put them in the JDK ext directory if you have control over the JDK. We do unload RXTX-based classes, but I have a feeling (and I'll have to check) that we put the jars on the CLASSPATH before running the application. As I recall, we still clean up RXTX based classes fairly aggressively because anything hanging around will cause shared port problems. Jim Andre-John Mas wrote: > On 30-Oct-07, at 21:07 , U. George wrote: > >>> Is there some sort of shutdown / unload call that I can call when my >>> application shuts down to unload the library? I didn?t see anything >>> obvious in your api. >>> >> Can u tellme what the Standard is to unload a .so library in java ? > > A quick search comes up with this thread: > > http://forum.java.sun.com/thread.jspa?threadID=253693&messageID=942427 > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From netbeans at gatworks.com Wed Oct 31 13:37:52 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 31 Oct 2007 15:37:52 -0400 Subject: [Rxtx] how to unload librxtxSerial.so In-Reply-To: <4728C131.2080603@ergotech.com> References: <927B303FE145774289C9CC3312881CC5492BB8@IMS-EMAIL.ims.dom> <4727D550.1000700@gatworks.com> <5EF5D425-F8E3-44BE-A947-13BBD74D5BB6@sympatico.ca> <4728C131.2080603@ergotech.com> Message-ID: <4728D990.8080608@gatworks.com> Jim Redman wrote: > Just to state something obvious, in case it's been overlooked. > > Is there any way you can put the RXTX jars on the application classpath? > You can also put them in the JDK ext directory if you have control > over the JDK. I suppose that depends on how you start the application. If u use the -jar switch, then not very likely. Classpath really gets ignored. i place the rxtx stuff in /usr/local. But I dont use -jar. I think if u place a directory in CLASSPATH, then and the jars in that directory will be scanned. Anyway, the issue was with unloading a .so ( shared unix library ) And as a separate issue, anyone have a shared port problem/example that can be made public? From nsayer at kfu.com Wed Oct 31 14:57:05 2007 From: nsayer at kfu.com (Nicholas Sayer) Date: Wed, 31 Oct 2007 13:57:05 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock Message-ID: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> In perusing the archives, I didn't see this issue raised. MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It would be better for RXTX to simply use exclusive opens or other file level locks rather than refuse to open a device simply because a directory that isn't set up by the OS is missing. I understand that it's likely that the RXTX installation procedure creates this directory. I don't want to have to *install* RXTX. I am bundling it inside a .app (http://javaxm.sf.net/), and that works just fine except for the fact that I have to tell people to do a 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they run the program. From bschlining at gmail.com Wed Oct 31 15:48:38 2007 From: bschlining at gmail.com (Brian Schlining) Date: Wed, 31 Oct 2007 14:48:38 -0700 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: The lock mechanism on Macs was changed a while back in rxtx-2.1.8 (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to make this issue go away in your application. Unfortunately, there hasn't been a 2.1.8release on the rxtx web site or ASFAIK a tag in CVS so that you easily fetch and build it. Is anyone using rxtx 2.1.8 on a Mac? On 10/31/07, Nicholas Sayer wrote: > > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app (http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071031/93503554/attachment-0045.html From greg.johnson at manchester.ac.uk Wed Oct 31 17:50:42 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Thu, 1 Nov 2007 00:50:42 +0100 Subject: [Rxtx] RXTX, MacOS X and /var/lock In-Reply-To: References: <801C3F44-D3C0-466D-9F2D-C47978D68A81@kfu.com> Message-ID: <1532D927-2F12-437F-8479-679DD19C21FA@manchester.ac.uk> Yes, I'm using my own build on 2.1-8 on OSX. We use 2.1-7 on Windows (and Linux) because I really want to build as little as possible of 'support' libraries - I'm really interested in my own problem domain. Which is why I'd really appreciate a binary build of 2.1-8 (which reports itself as such - at the moment, it reports 2.1-7, even though it isn't compatible with a "true" 2.1-7 build!) for the 3 main consumer OSs. And of course, if it were possible to fix some small bugs like the one Martin and I have discussed - a closed port cannot be reopened - so much the better! 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 31 Oct 2007, at 22:48, Brian Schlining wrote: > The lock mechanism on Macs was changed a while back in rxtx-2.1.8 > (See http://rxtx.qbang.org/wiki/index.php/FAQ). So it's possible to > make this issue go away in your application. Unfortunately, there > hasn't been a 2.1.8 release on the rxtx web site or ASFAIK a tag in > CVS so that you easily fetch and build it. Is anyone using rxtx > 2.1.8 on a Mac? > > On 10/31/07, Nicholas Sayer wrote: > In perusing the archives, I didn't see this issue raised. > > MacOS X doesn't have a /var/spool/uucp or /var/lock directory. It > would be better for RXTX to simply use exclusive opens or other file > level locks rather than refuse to open a device simply because a > directory that isn't set up by the OS is missing. > > I understand that it's likely that the RXTX installation procedure > creates this directory. I don't want to have to *install* RXTX. I am > bundling it inside a .app ( http://javaxm.sf.net/), and that works > just fine except for the fact that I have to tell people to do a > 'sudo mkdir /var/lock' and 'sudo chmod 1777 /var/lock' before they > run the program. > > > > > -- > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > Brian Schlining > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/ebb9cb07/attachment-0045.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-0054.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 unpluggi